Posted: 2006-04-12 15:51:39
К тому что отквоченный кусок кода не будет работать так как ты этого хотел.
Destruction wrote:Зависит от того, насколько часто пользовать.
Вот ты сам подумай, где инжа глобалы хранит? Прально, где-то внутри, сидит, хранит, память засоряет потихоньку.
А изиуо грамотно, в реестр, чтобы не мучаться.
Запусти сначало такой скрипт:Code: Select all
sub MySub()
var i=0
repeat
i=i+1
uo.setGlobal("MyName",str(i))
until false
endsub
А затем такой:Code: Select all
sub MySub()
var i=0
repeat
i=i+1
uo.setEasyUO(1,str(i))
until false
endsub
И сравни, который дольше проживёт.
К тому что отквоченный кусок кода не будет работать так как ты этого хотел.
Sanch wrote:Есть небольшой вопросик, можно ли с помощью uo.Print напечатать пробел?
а именно: ' 'Sanch wrote:uo.print('!!!КОПАЕМ ТУТ!!!>>> : '+str(mx-a)+' '+str(my-b))
Code: Select all
Если "фразы" в строке и плюсы разделить пробелами, то получится так:
uo.print('!!!КОПАЕМ ТУТ!!!>>> : ' + str(mx-a) + ' ' + str(my-b))
Code: Select all
sub CheckingPlayers()
while uo.life > 0
uo.setglobal('per4', '1') #отвечает за синхронизацию поиска#
wait(200)
uo.set('finddistance', '14')
uo.findtype('0x0190', '-1', '1') #тип игрока мужского пола#
if uo.findcount() > 1 then
uo.usetype('0x0F08')
wait(100)
uo.exec('terminate Obkopka')
wait(500)
uo.exec('exec Teleportation')
wait(500)
return
else
wait(200)
uo.setglobal('per4', '0')
wait(1000)
endif
uo.setglobal('per4', '1')
wait(200)
uo.set('finddistance', '14')
uo.findtype('0x0191', '-1', '1') #тип игрока женского пола#
if uo.findcount() > 0 then
uo.usetype('0x0F08')
wait(100)
uo.exec('terminate Obkopka')
wait(500)
uo.exec('exec Teleportation')
wait(500)
return
else
wait(200)
uo.setglobal('per4', '0')
wait(1000)
endif
wend
end sub
sub Obkopka()
VAR mx, my, mz, a, b, c, d
step1:
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('per2')) + 1
wait(100)
uo.setglobal('per2', str(c))
while not uo.injournal('no ore here') and not uo.injournal('location') and not uo.injournal('far away') and not uo.injournal('in rock') and not uo.injournal('You broke')
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('heavy') and not uo.injournal('location') and not uo.injournal('no ore') and not uo.injournal('but fail') and not uo.injournal('far away') and not uo.injournal('in rock') and not uo.injournal('You broke')
wait(500)
wend
while val(uo.getglobal('per4')) == 1
wait(50)
wend
uo.set('finddistance', '3')
uo.findtype('0x000E', '-1', '1') #тип элементаля#
if uo.findcount() > 0 then
d = uo.getserial('finditem')
uo.setglobal('per5', 'd')
KillElemental()
else
wait(100)
endif
if val(uo.getglobal('per2')) > 25 then
uo.setglobal('per2', '1')
wait(100)
ChengePlace()
goto step1
else
wait(100)
endif
if uo.weight > 600 then #максимальный вес#
uo.deletejournal()
wait(100)
uo.exec('terminate CheckingPlayers')
wait(500)
uo.exec('exec GoHome')
wait(500)
return
else
wait(100)
endif
wend
uo.deletejournal()
next
next
goto step1
end sub