Переделал, теперь если вводит антимакрос то не копает, просто стоит и дергается мышка, если остановить и снова запустить когда антимакрос не нужно вводить больше то начинает копать нормально. В чем ошибка?
Code:
var pause
pause = 0
sub Mining()
var coordx, coordy, coordz, tilex, tiley, circle
circle = 0
coordx = uo.getx('self')
coordy = uo.gety('self')
coordz = uo.getz('self')
for tilex = coordx - 2 to coordx + 2
for tiley = coordy - 2 to coordy + 2
mine:
uo.deletejournal()
uo.waittargettile('1339', str(tilex), str(tiley), str(coordz))
uo.usetype(0x0E85, 0x0000)
wait(500)
if not uo.LastGump('replyed') then
if uo.LastGump('text', 0) == 'Antimacros System' then
while not uo.injournal('success')
AntiMacros()
wait(500)
wend
endif
endif
while not uo.injournal('put') and not uo.injournal('fail') and not uo.injournal('far away') and not uo.injournal('loosen') and not uo.injournal('no ore') and not uo.injournal('no line') and not uo.injournal('try mining')
wait(100)
wend
if uo.injournal('put') and (uo.injournal('iron') or uo.injournal('marble')) then
circle = circle + 1
else
if uo.injournal('put') then
circle = 2
endif
endif
if not uo.injournal('far away') and not uo.injournal('loosen') and not uo.injournal('no ore') and not uo.injournal('no line') and not uo.injournal('try mining') and not circle > 1 then
goto mine
endif
next
next
uo.msg('Çàêîí÷èë!')
end sub
sub AntiMacros()
dim reindex[8]
reindex[0] = 11
reindex[1] = 12
reindex[2] = 13
reindex[3] = 10
reindex[4] = 16
reindex[5] = 14
reindex[6] = 17
reindex[7] = 15
var GumpID = 0
var ButtonID = 0
var ButtonText
var i = 18
if uo.LastGump('text', 4) <> "0" then
i = 19
end if
GumpID = val(Mid(uo.LastGump('command', i), 16, 4))
ButtonID = reindex[GumpID-2225]
ButtonText = uo.LastGump('command', ButtonID)
uo.LClick(Val(Mid(ButtonText, 7, 3)), Val(Mid(ButtonText, 11, 3)))
while not uo.LastGump('replyed')
wait(100)
wend
end sub