ScriptUO

Official ScriptUO EasyUO Scripts => Script Library => Character skill advancement => Topic started by: Cerveza on January 31, 2011, 09:46:41 AM

Title: Tracking Trainer
Post by: Cerveza on January 31, 2011, 09:46:41 AM
Just a little thing I threw together.... stand at the bank and let er rip.

Code: [Select]
set %trackGumpSize 440_135
set %trackGumpClickX 333
set %trackGumpClickY 120

repeat
event macro 13 38
gosub GumpAndSizeWait NULL generic_gump %trackGumpSize
gosub offsetClick %trackGumpClickX %trackGumpClickY l
wait 5s
event macro 8 7
wait 5s
until #false

;-------------------------------------------------------------------------------
; %1 = GumpAndSizeWait
; %2 = Gumpname 1
; %3 = Gumpname 2
sub GumpAndSizeWait
  set %timedelay #SCNT
  wait 5
  GumpWait_loop1:
    if #CONTNAME = %2 && #CONTSIZE = %3
      return #FALSE ; no error
    if #SCNT > %timedelay + 7
      return #TRUE ; error, timeout
    goto GumpWait_loop1
return #TRUE ; should never get here.

sub OffsetClick
  set %tempx %1 + #CONTPOSX
  set %tempy %2 + #CONTPOSY
  click %tempx %tempy %3
return