The shard where I play uses the mondains legacy game.
I have made an script in order to sell my fishes more quickly. The script works fine and serves it's purpose. But I would like to improve this part:
set %amount 30
click 240 80 x %amount ; It clicks 30 times on the first element of the menu list
click 315 420 ; accept button
gosub waitForGumpDisappear
finditem %fishType C_ , #backpackID
}
There is a way to know wich fish it's gonna be first in the buy_list menu?
So I could make something like this:
set %amount #findStack
click 240 80 x %amount ; It clicks 30 times on the first element of the menu list
click 315 420 ; accept button
gosub waitForGumpDisappear
finditem %fishType C_ , #backpackID
}
Use #findstack to determine the number of clicks that have to be made.
Another thing I would like to improve it's the method to open the buy_list gump, I've tried the exevent popup without success with something like this:
finditem %vendor G_10
if #FINDCNT > 0
exevent Popup #findid 1
halt
The complete working script that I'm currently using:
;==================================
; Script Name: SellSub
; Author: VicVega
; Version: 0.1
; Client Tested with: 5. Something
; EUO version tested with: 1.5 (Version 148)
; Shard: Epsilon UO
; Revision Date: 12-04-09
; Public Release:
; PSL Release:
; Purpose: Sells all fish in your Backpack to an NPC
;==================================
set %fishType GQD_TLW_VLW_DMW_LGW_NGW_GMW_FQD_OGW_WLW_
+YLW_DQD_SLW_ULW_FMW_EMW_XLW_RLW_EQD
set %vendor Conway
sell:
;open vendor's popup menu and click sell option
finditem %fishType C_ , #backpackID
while #findkind <> -1
{
msg %vendor sell $
gosub waitForgump
set %amount 30
click 240 80 x %amount
click 315 420 ; accept button
gosub waitForGumpDisappear
finditem %fishType C_ , #backpackID
}
exit
sub waitForGump
set %timeout #scnt + 5
loop:
If #contname <> bill_gump
{
if #scnt > %timeout
return
else
goto loop
}
return
sub waitForGumpDisappear
set %timeout #scnt + 5
loop2:
If #contname = bill_gump
{
if #scnt > %timeout
return
else
goto loop2
}
return
Also later on I'm planning on add another sub in order to know how muck money it's gained in the complete transaction.