Code: Select all
sub Tinkering()
VAR Exit = 0, k, bag
VAR color = '0x0000'
VAR item = '0x09C2'
VAR chesttoput = ''
VAR chestwithbags = ''
VAR chestwithings = ''
uo.Deletejournal()
While UO.SkillVal( 'Tinkering' ) < 1200
uo.useobject(chesttoput)
checklag()
uo.useobject(chestwithbags)
checklag()
uo.useobject(chestwithings)
checklag()
while Exit<>1
If uo.injournal('World Save') then
wait(30000)
end if
While not UO.Hidden()
uo.warmode(0)
UO.UseSkill('Hiding')
Wait(4000)
Wend
check:
uo.findtype('0x0E76', -1 , chesttoput )
if uo.findcount() then
del('255|bag')
uo.click('finditem')
repeat
wait(100)
until uo.injournal('bag')
if uo.injournal('255') then
uo.ignore('finditem')
goto check
else
bag = uo.getserial('finditem')
end if
else
uo.findtype('0x0E76', -1 , chestwithbags )
bag = uo.getserial('finditem')
uo.moveitem( bag , 0 , chesttoput )
checklag()
end if
find:
uo.findtype( item , color ,'backpack')
If UO.FindCount() Then
UO.moveitem('finditem', 0 , bag )
checklag()
goto find
end if
If UO.Count('0x1BEF') < 10 then
UO.FindType('0x1BEF', -1 , chestwithings )
If uo.FindCount() == 0 then
return
end if
UO.moveitem('finditem','100','backpack')
checklag()
end if
UO.DeleteJournal()
checklag()
uo.recall(0x400E5F71 , 0x0003)
k = 0
while NOT UO.InJournal('You put') AND NOT UO.InJournal('failed') AND ( k < 30 )
k = k + 1
wait(500)
wend
wend
end sub
Sub checklag()
del('backpack')
uo.click('backpack')
repeat
wait(50)
until uo.injournal('backpack')
del('backpack')
end sub
Sub del(msg)
while uo.injournal(msg)
uo.setJournalLine(uo.injournal(msg)-1,"Is Empty!")
wend
end sub
Скрипт стоит около сундуков и крафтит ложки. В одном сундуке инготы и мешки с ложками, во втором - пустые мешки. Загвоздка в том, что когда инготов не остается в бекпаке, скрипт отказывается докладывать очередную порцию. Почему?