Page 1 of 1

Оч нужна помощь, зарание благодаарю...

Posted: 2006-04-06 23:10:03
by Sanch
Собственно есть скрипт на мининг, но с ним небольшая проблема, либо с переменно используемой в скрипте на копку, либо в работе с глобальными переменными, тк в скриптописании я еще нуб, в чем именно проблема понять никак ен могу, выдает ошибку когда должен менять место копки Line 474: Variable alredy defined - MX, все о чем идет речь подчеркнуто, лишнее вырезано, зарание премного благодрен за помощь:


сори за офф топ, все уже исправил сам, чуток напряг мозги.

sub Mining()
uo.setglobal('per1', '0')
wait(100)
uo.setglobal('per2', '1')
wait(100)
uo.setglobal('per3', '0')
wait(100)
uo.setglobal('per4', '1')
....
end sub

sub Obkopka()
uo.exec('exec CheckingPK')
step1:
VAR mx, my, mz, a, b, c
mx = uo.getx('self')
my = uo.gety('self')
mz = uo.getz('self')
uo.deletejournal()
for a = mx-2 to mx+2
for b = my-2 to my+2
while not uo.Hidden()
uo.warmode('0')
uo.useskill('Stealth')
wait(4000)
wend
uo.print('Копаем тут: '+str(mx-a)+' '+str(my-b))
c = val(uo.getglobal('per3')) + 1
wait(100)
uo.setglobal('per3', str(c))

while not uo.injournal('no ore here') and not uo.injournal('far away')
uo.deletejournal()
if uo.waiting() then
uo.canceltarget()
else
wait(100)
endif
uo.waittargettile('1341', str(a), str(b), str(mz))
uo.usetype('0x0E85')
while not uo.injournal('You put') and not uo.injournal('no ore') and not uo.injournal('but fail') and not uo.injournal('far away') and not uo.injournal('broken')
wait (500)
wend
uo.set('finddistance', '5')
uo.findtype( '0x000E', '-1', '1' )
if uo.findcount() > 0 then
KillElemental()
else
wait(100)
endif
if val(uo.getglobal('per3')) > 25 then
wait(500)
uo.setglobal('per3', '0')
ChengePlace()
goto step1
else
wait(100)
endif

if uo.weight > 600 then
uo.exec('exec GoHome')
wait(100)
return
else
wait(100)
endif
wend
uo.deletejournal()
next
next
goto step1
end sub

sub ChengePlace()
VAR a, b, c, d
if val(uo.getglobal('per4')) > 3 then
uo.setglobal('per4', '1')
uo.exec('exec Teleportation')
wait(100)
uo.exec('terminate Obkopka')
return
endif
if val(uo.getglobal('per4')) == 1 then
for a = 1 to 5
uo.press(40)
wait(300)
next
endif
if val(uo.getglobal('per4')) == 2 then
for b = 1 to 5
uo.press(39)
wait(300)
next
endif
if val(uo.getglobal('per4')) == 3 then
for c = 1 to 5
uo.press(38)
wait(300)
next
endif
d = val(uo.getglobal('per4')) + 1
wait(100)
uo.setglobal('per4', str(d))
end sub

Posted: 2006-04-06 23:18:44
by Sanch
Сори, всем спасибо, напряг серое вещество и сам исправил :D