EasyUO.com
http://www.easyuo.com/forum/

How to store setshopitem
http://www.easyuo.com/forum/viewtopic.php?f=2&t=53819
Page 1 of 1

Author:  Poopa [ Tue Dec 25, 2018 7:58 am ]
Post subject:  How to store setshopitem

So I've been working on a small script to help in Trade Deals, mainly because when I get in a rush I buy too few or too many items, so I"ve got that process working fine, but I can only buy one type of item at a time, then I have to go back and reopen the npc menu and buy the next item. I can't quite figure out how to buy all 5 items from a single purchase. I know it has something to do with the SetShopItem command, but I can't resolve how to list more than one item in the script..for instance.. will buy 5 of the current item in the list, but how would I set up 5 lines representing 5 different items, or can I ? I can't seem to find any documentation on setshopitem.

Any thoughts ?

Author:  Scripty [ Wed Dec 26, 2018 3:19 am ]
Post subject:  Re: How to store setshopitem

Scroll down the list and do a 'if #shopItemType = %yourItemType' then click it, and then 'setShopItem #shopItemId %yourItemAmountToBuy.' It's pretty simple. Then click the BUY button on the gump... it doesn't actually show you any info that you set it correctly. It just buys that amount you set 'in memory." You'll know you're successful when you buy the right amount of items. You can also use #shopItemMax… like if you wanted to buy out all the regs available from an npc. I have some selling functions available here that might help somewhere. There's examples of buying all over though. Selling was never implemented in EUO I think though, but I think I wrote some selling functions and posted them on here also. Lookup good examples of both.

Author:  Poopa [ Wed Dec 26, 2018 7:10 am ]
Post subject:  Re: How to store setshopitem

Awesome, thank you.

So setshopitem is limited to a single item then ? On a trade run you would normally buy 5 different items at one time doing it manually, I want to be able to code the purchase of all 5 at one time. I tested setshopitem1 thinking it would work, but it doesn't.

Author:  Orngrimm [ Wed Dec 26, 2018 8:18 am ]
Post subject:  Re: How to store setshopitem

As far as i understand, #shopItemType changes with every click on scroll. So basically:

- Click scroll down till #shopItemType = %item1ToBuy
- setShopItem #shopItemId %item1ToBuy_Amount
- Click scroll down till #shopItemType = %item2ToBuy
- setShopItem #shopItemId %item2ToBuy_Amount
...
- Click scroll down till #shopItemType = %itemNToBuy
- setShopItem #shopItemId %itemNToBuy_Amount
Then click BUY and you should buy all items you selected and set an amount to buy...

However, thats what i got from the comment (excellent one by the way!) of Scripty... Untested method and theory.

Author:  Poopa [ Wed Dec 26, 2018 9:07 am ]
Post subject:  Re: How to store setshopitem

Your reply was technically correct, however each item has to be dbl clicked to send it down to the lower gump window before
works, then it will simply buy the top item on the buy page. However you can manually put all five items in using their unique ids and will buy them all at the prices set with the id. So now I'm struggling with how to gather all of that information, but I'll figure it out. I already have it working on each single purchase, i've made a giganticly embarassing series of buttons for each item, so if I hit my "Robe20" menu button it will search the shop, and buy 20 robes (if they're in stock in that quantity), but I have to do that 5 times for the entire trade order, I can almost buy them manually just as fast but with errors on my part, the script buys them perfectly each time, but slow.

Author:  Poopa [ Wed Dec 26, 2018 12:58 pm ]
Post subject:  Re: How to store setshopitem

Ok I was totally overthinking it, setshopitem #shopitemid was all I needed for as many items as I want...thanks for the help. I"m probably overdoing this entire script, but it's working now .

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/