sub charm
gosub TM_AdvJournalSync FAIL
gosub TM_AdvJournalSync Charm
set #lobjectid %flute2
wait %lagwaits
gosub TM_AdvJournalscan CHARM Valid recharge
If #result = #false
{
event macro 17
}
wait %lagwaits
gosub TM_AdvJournalscan CHARM Valid recharge
If #result = #true
{
wait 1s
gosub charm
}
set #ltargetid %target1
set #ltargetkind 1
wait %lagwaits
event macro 22
wait %lagwaits
gosub TM_AdvJournalscan FAIL Valid don't_seem
If #result = #true
{
wait 1s
gosub charm
}
gosub worldxyztoscreenxy %xhole %yhole %zhole
click %_cursorx %_cursory
ignoreitem %target2
return
;-----------------------------
sub charm
retry_charm:
gosub TM_AdvJournalSync FAIL
gosub TM_AdvJournalSync Charm
set #lobjectid %flute2
wait %lagwaits
event macro 17
wait %lagwaits
gosub TM_AdvJournalscan CHARM Valid recharge
wait %lagwaits
If #result = #true
{
wait 1s
set #targcurs 0
goto retry_charm
}
set #ltargetid %target1
set #ltargetkind 1
wait %lagwaits
event macro 22
wait %lagwaits
gosub TM_AdvJournalscan FAIL Valid don't_seem
If #result = #true
{
wait 10
gosub charm
}
wait 5
gosub worldxyztoscreenxy %xhole %yhole %zhole
click %_cursorx %_cursory
ignoreitem %target2
return
set %Search1 2 ; first search within 4 tiles
set %Search2 3
set %search3 5
;and so on
set %closestHoleID N/A
for %i 1 %holeCount
{
set %holeX %holeX . %i
set %closest ( %holeD - %snakeloc )
}
;still working on this part
Sorry that I didn't mention the extra brace. I knew that, but deleted it from the version I was working with. I found it using the ScriptUO editor and it's Tools/Syntax_Error_Check menu option.
%looptimer #scnt + 8
at the start of the main loop. I used repeat
wait 1s
until #scnt >= %looptimer /code]
Because of hole travel times, the whole cycle sometimes take more than 8 seconds. I wanted to take advantage of the travel time while waiting to recharge.
I noticed though, that the timer for some reason Always waited 8 seconds after arriving at the hole. I didnt know why, so I went with the journal check method instead