Rock5's BuyFromItemShop userfunction

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#81 Post by rock5 » Fri Feb 01, 2013 3:32 pm

From your original description the character goes back to the daily spot after mailing. The mailbox should close by itself. Is there any time that the character doesn't go back to the daily spot but instead changes character near the mailbox? If so then, yes, you need to do a

Code: Select all

RoMScript("MailFrame:Hide()")
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

fobsauce
Posts: 46
Joined: Wed Dec 15, 2010 3:40 pm

Re: Rock5's BuyFromItemShop userfunction

#82 Post by fobsauce » Sun Feb 03, 2013 11:10 am

So I sometimes had a problem getting this function to work. It seems to have the issue when I have a static popup, most often the warning about unhealthy memory. It may be a good idea to look for and close the popups before purchasing from the item shop.

Code: Select all

warningmemorypopup = RoMScript('StaticPopup_Visible("WARNING_MEMORY")')
	if warningmemorypopup == "StaticPopup1" then
		RoMScript('StaticPopup_OnClick(StaticPopup1, 1);')
	end

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#83 Post by rock5 » Sun Feb 03, 2013 1:20 pm

That looks wrong. It would only work if the popup is staticpopup1. What if it's a different one? Try this instead

Code: Select all

warningmemorypopup = RoMScript('StaticPopup_Visible("WARNING_MEMORY")')
   if warningmemorypopup then
      RoMScript('StaticPopup_OnClick('..warningmemorypopup ..', 1);')
   end
But you're right. This userfunction doesn't make sure it's using the right popup. I'll fix it.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#84 Post by rock5 » Sun Feb 03, 2013 1:29 pm

I just copied the code from my 'rent' userfunction. Try this and let me know if it works and I'll upload it to the first post.

--== Obsolete file deleted ==--
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

fobsauce
Posts: 46
Joined: Wed Dec 15, 2010 3:40 pm

Re: Rock5's BuyFromItemShop userfunction

#85 Post by fobsauce » Sun Feb 03, 2013 6:18 pm

It works as long as there are no other popups before it (as Staticpopup1)
but when I tested it by sending that character a party invite first, the function would then hang.

If I'm not being clear then basically...if

local staticpopup = RoMScript("StaticPopup_Visible('PASSWORD_CONFIRM')")

equals to StaticPopup1 then it works. Otherwise it hangs.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#86 Post by rock5 » Sun Feb 03, 2013 10:51 pm

I understand. That's what I tried to fix but I missed 1 'staticpopup1' when it first opens the password popup.

This should work. I actually tested it. Actually, because I know it works, I'll post it on the first post.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Buster99
Posts: 69
Joined: Fri Nov 25, 2011 9:27 am

Re: Rock5's BuyFromItemShop userfunction

#87 Post by Buster99 » Tue Feb 05, 2013 11:19 am

Just wanted to give an update to my problem and what seems to have fixed it (crossing fingers). Server been down lately so will be testing more soon.

After much trial and error what fixed the problem was taking your suggestion, Rock, of moving the purchasing of buying the Item Shop Puris down further int the script. I tried putting the RomScript in onload to get the items to populate with a wait but it still didn't do the trick. But after clearning bags, recalling, running to the mailbox THEN purchasing the Puris it seems to work.

Side note: I still don't understand why it works exactly. e.g. - I deleted all script except logging char in, purchasing Puris, logging in next character. Tested this shorter script at length and it never had any errors. Odd. Anyways.

Thanks for help.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#88 Post by rock5 » Tue Feb 05, 2013 11:58 am

I just tried opening the ItemShop with the mailbox open. It opened but I did get the "close mailbox before continuing" message but I only got it once. If I tried it again it didn't show it. There could be some bug involved with that. Did you end up trying to close the mailbox first before buying your puris? The fact that you don't have problems with the short script which doesn't check the mail supports the theory that it is related to the mail.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#89 Post by Desmond » Wed Apr 09, 2014 12:21 pm

And, what command do I must to insert, that a boat was purchased for counters by a clearing stone?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#90 Post by rock5 » Wed Apr 09, 2014 8:38 pm

Sorry, I didn't understand that.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#91 Post by Desmond » Thu Apr 10, 2014 3:56 am

What is needed code to buy a stone?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#92 Post by rock5 » Thu Apr 10, 2014 6:28 am

Everything you need to know is on the first post. Don't you understand it?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#93 Post by Desmond » Thu Apr 10, 2014 8:29 am

These 2 functions allow you to buy items from the Item Shop for yourself and as a present.

There are instruction in the file on how to use them which I will copy here.


Code:
-- Syntax:
-- BuyFromItemShop(itemGUID, secondaryPassword [, number] )
-- BuyPresentFromItemShop(itemGUID, secondaryPassword, recipient [,subject] [,body])
--
-- Arguments:
-- itemGUID (type number) - The uniquie id of the shop selection. See below for instructions on how to get this value.
-- secondaryPassword (type string) - Your secondary password for that account
-- number (type number) - The number you want to buy of that selection. Optional. If not specified will, buy only one.
-- recipient (type string) - The person you want to send the present to.
-- subject (type string) - The subject of the message sent with the present. Optional.
-- body (type string) - The body of the message sent with the present. Optional.
--
-- Examples:
-- To buy 2 items with GUID of 100
-- BuyFromItemShop(100, "secpass', 2)
-- To buy an item with GUID of 100 and send it as a present
-- BuyPresentFromItemShop(100, "secpass', "recipientName")
--
-- WARNING! GUIDs are unique per server. GUIDs given by other users might be wrong for your
-- server. So it's important to get your own GUIDs using the instructions below.
--
-- How to get 'itemGUID':
-- 1. Open the Item Shop.
-- 2. Find the item you want to buy. Make sure it's the right item. I take no responsability if your make a mistake.
-- 3. Select the 'Buy' button so that the 'Buy' popup appears.
-- 4. Now enter this command,
-- /script SendSystemChat(ItemMallFrame.selectItem.GUID)
-- 5. The number it prints is the 'itemGUID' of the item you want to buy.






Attachments:
File comment: Version 1.3.1
- Fixed uses correct popup even is others are open
userfunction_BuyFromItemShop.lua [3.91 KiB]
Downloaded 180 times



herein to understand unreal

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#94 Post by rock5 » Thu Apr 10, 2014 8:49 am

Desmond wrote:herein to understand unreal
Sorry, I don't understand.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#95 Post by Desmond » Thu Apr 10, 2014 8:57 am

code what buy for Badges stones?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#96 Post by rock5 » Thu Apr 10, 2014 9:04 am

I can't tell you what GUID to use because they are different on each server. The instructions to get the GUID are listed above. Here they are again.

Code: Select all

1. Open the Item Shop.
2. Find the item you want to buy. Make sure it's the right item. I take no responsibility if your make a mistake.
3. Select the 'Buy' button so that the 'Buy' popup appears.
4. Now enter this command,
/script SendSystemChat(ItemMallFrame.selectItem.GUID)
5. The number it prints is the 'itemGUID' of the item you want to buy.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#97 Post by Desmond » Thu Apr 10, 2014 9:09 am

and that dalie

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#98 Post by lisa » Thu Apr 10, 2014 9:16 am

You need to get the item ID, it is different for each server.
Ви повинні отримати ідентифікатор елемента, він відрізняється для кожного сервера.

Try to buy 1 of the item and use this code when the confirm appears, you don't need to actually buy the item.
Спробуйте купити 1 даного пункту і використовувати цей код при появі підтвердження, вам не потрібно насправді купуєте деталь.

Code: Select all

/script SendSystemChat(ItemMallFrame.selectItem.GUID)
isid.jpg
Then post what is printed on screen here.
Тоді після того, що друкується на екрані тут.

No I don't speak Ukranian.
Ні я не кажу українська.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's BuyFromItemShop userfunction

#99 Post by Desmond » Thu Apr 10, 2014 9:24 am

BuyFromItemShop(829, "km80673460297", 1)

this code to buy?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's BuyFromItemShop userfunction

#100 Post by rock5 » Thu Apr 10, 2014 9:36 am

If that is the number that was printed then it looks OK.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests