Alexandria Uptime: 100.71 Days
Total players online: 5



Take the Tour | Site Map

It is currently Thu Jul 18, 2019 10:00 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How to store setshopitem
PostPosted: Tue Dec 25, 2018 7:58 am 
Offline
Script Scribe
Script Scribe

Joined: 05/07/2012 14:53
Posts: 105

Groups:
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 ?


Top
  Profile 
PostPosted: Wed Dec 26, 2018 3:19 am 
Offline
Legendary Scripter
Legendary Scripter
User avatar

Joined: 07/10/2004 17:11
Posts: 2361

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.

_________________


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Wed Dec 26, 2018 7:10 am 
Offline
Script Scribe
Script Scribe

Joined: 05/07/2012 14:53
Posts: 105

Groups:
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.


Top
  Profile 
PostPosted: Wed Dec 26, 2018 8:18 am 
Offline
Administrator
Administrator
User avatar

Joined: 08/12/2003 07:28
Posts: 19086
Location: Switzerland

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.

_________________
EUO Member and postwhore since: 19th Dezember, 2002; Loosing on freeshard Alexandria since: 5th January, 2005
Searches cure for cancer since: 17th November, 2003 on GRID.org & Worldcommunitygrid.org
Made scripts for Project 'Programmers for Alexandria' worth 50$
Image
Quote "mmorning": Where would theses boards be if Orn didn't miss all the sarcasm. Man its great having him here :)
Quote "author-unknown": Good idea. I gotta start doing that too. You're a trendsetter Orn. :)
Quote "dreyfus": #true is always #true


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Wed Dec 26, 2018 9:07 am 
Offline
Script Scribe
Script Scribe

Joined: 05/07/2012 14:53
Posts: 105

Groups:
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.


Top
  Profile 
PostPosted: Wed Dec 26, 2018 12:58 pm 
Offline
Script Scribe
Script Scribe

Joined: 05/07/2012 14:53
Posts: 105

Groups:
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 .


Top
  Profile 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Aaz and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Hosted by CalWeb Internet Services, Inc.