ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: talkmill on September 10, 2008, 10:18:00 AM

Title: Reliable buying
Post by: talkmill on September 10, 2008, 10:18:00 AM
Hi, has anyone got a good idea on how to make a reliable buying sub (or can point me to one). I've tested quite a few and tested writing my own. The thing i have a problem with is the double click to select a particular item. Sometime this works, sometimes not, and i cant seem to figure out why. I've tested using: double click X X mc (instead of click d) which work a bit better but still not good. 30% of the time no item is selected. Is there a good way to do this "click" or to verify if the click succeded (if the item appeared in the buy list) without using ocr?
Title: Re: Reliable buying
Post by: TrailMyx on September 10, 2008, 11:21:36 AM
I haven't ever used the buy/sell agents in Razor.  Perhaps that's a possibility.
Title: Re: Reliable buying
Post by: talkmill on September 10, 2008, 11:22:51 AM
Hmmm, true. I will test that, thx :)
Title: Re: Reliable buying
Post by: talkmill on September 10, 2008, 11:28:16 AM
Or hmmm, don't think that is an option. That would be good if i buy the same type of item every time. Bot i'm writing a script for filling bods (normal iron smith bods) that can be filled by buying items from blacksmiths. For that to work in razor i guess a buy agent for every type of bod-item is necessary which really isn't that good :)
Title: Re: Reliable buying
Post by: Endless Night on September 10, 2008, 01:21:46 PM
Thier is a way for reliable buying...  i wrote code that did it once...   heres a snippet from some of my code dont know if this was the very reliable one or not.. but its got to do with wait times.

     if #SHOPITEMTYPE = %BuySellItems && #SHOPITEMPRICE <= %BuySellMaxMinPrice
      {
       wait 3
       gosub gumpclick -55 -137 DMC ; D MC
       wait 2
       gosub gumpclick -55 -137 DMC ; D MC
       wait 2
       If #shopItemMax > %BuySellQuantity
         setShopItem #shopItemID %BuySellQuantity
       ELSE
         setShopItem #shopItemID #shopItemMax
      }
Title: Re: Reliable buying
Post by: talkmill on September 10, 2008, 10:58:24 PM
Ahh thx, i'll try your wait times to see if i get better results :)
Title: Re: Reliable buying
Post by: talkmill on September 11, 2008, 09:09:07 AM
Didn't help. Tried that one and nothing happens. The only thing that works for now is:

Code: [Select]
click x y mc
click x y mc

I'm not getting why this work and not dmc, is there some kind of delay in mc or is there some other way these two type work in different ways?
Title: Re: Reliable buying
Post by: Hardyz on September 12, 2008, 05:34:44 PM
Hi, has anyone got a good idea on how to make a reliable buying sub (or can point me to one). I've tested quite a few and tested writing my own. The thing i have a problem with is the double click to select a particular item. Sometime this works, sometimes not, and i cant seem to figure out why. I've tested using: double click X X mc (instead of click d) which work a bit better but still not good. 30% of the time no item is selected. Is there a good way to do this "click" or to verify if the click succeded (if the item appeared in the buy list) without using ocr?

What I like to do is after I buy it I look to see if the items are in my pack using finditem.  If it is a stackable item and you might have some in your pack you can count the stack or you can count the amount of items prior to buying.
Title: Re: Reliable buying
Post by: Endless Night on September 12, 2008, 06:28:21 PM
i like it hardyz i must rember that and implement in my scripts