Code: Select all
Sub SELLITEM(ITEMTOSELL)
/declare OldMoney local
/declare NewMoney local
/click left auto
/sendkey down shift
/autoinv
:Finding
/doevents
/finditem similar "@ITEMTOSELL"
/if "$find()"=="FALSE" /goto :Done
:WaitFind
/doevents
/if "$cursor()"=="FALSE" /goto :WaitFind
:Selling
/doevents
/varcalc OldMoney $char(gold)*100+$char(silver)*10+$char(copper)
/click left merchant buy
/doevents
/delay 1s
/click left merchant sell
/delay 1s
:WaitSell
/doevents
/varcalc NewMoney $char(gold)*100+$char(silver)*10+$char(copper)
/if n @NewMoney==@OldMoney /goto :WaitSell
/goto :Finding
:Done
/doevents flush
/sendkey up shift
/return
It works... a few problems though.
I had to add
Code: Select all
/delay 1s
/click left merchant sell
/delay 1s
kept getting WOAH! HOLD YOUR HORSES... messages from the merchant (not good)..
Also, I had to add the superflous sell click because sometimes the first click never registers.
I figure that I need to tweak the timing, just not really sure of what value to tweak sections too.

