finditem IIF G_2
if #FINDCNT > 0
{
for #FINDINDEX 1 #FINDCNT
{
event property #FINDID
if spring , #SPC , cleaning in #PROPERTY && current , #SPC , points in #PROPERTY && #FINDCOL = 1102
goto found_box
}
}
display ok I cannot locate the collection box
stop
found_box:
set %box #FINDID
set %total 0
repeat
finditem TVH C
if #FINDKIND <> -1
{
if #FINDCOL <> 1164
{
ignoreitem #FINDID
continue
}
set %ticket #FINDID
gosub TicketValue %ticket
set %total %total + #RESULT
}
if #CONTSIZE <> 345_359
{
finditem %box G_2
if #FINDKIND <> -1
{
set #LOBJECTID #FINDID
event macro 17 0 ; last object
gosub GumpWait generic_gump
}
}
set %clickx #CONTPOSX + 39
set %clicky #CONTPOSY + 168
click %clickx %clicky f
target 5s
set #LTARGETID %ticket
set #LTARGETKIND 1
event macro 22 0
gosub GumpWait generic_gump
until #FINDKIND = -1
display ok %total
stop
sub TicketValue
namespace push
namespace local TV
event property %1
str pos #PROPERTY $ 2
str del #PROPERTY 1 #STRRES
set !tempstr #STRRES
str pos !tempstr p
set #STRRES #STRRES - 1
str left !tempstr #STRRES
set !tempstr #STRRES
repeat
str pos !tempstr ,
if #STRRES > 0
{
str del !tempstr #STRRES 1
set !tempstr #STRRES
}
until #STRRES = 0
set #RESULT !tempstr
namespace pop
return #RESULT
;-------------------------------------------------------------------------------
sub GumpWait
wait 10
set %timedelay #SCNT
loopwait1:
if #CONTNAME = %1 || #CONTNAME = %2
return
if #SCNT > %timedelay + 7
return
goto loopwait1
return