Задумка скрипта такая: качает карпентри берёт логи из сундука (160) и начинает делать палки. Как наделал определённое количество летит к вендору и продаёт потом летит домой скидывает деньги в сундук, берёт хавчик, хавает, кладет обратно и начинает опять делать палки! Вот после нескольких кругов вылетает ошибка (Unhandled exception in parser). Не замечал в каком месте, но последний раз скрипт слетел у вендора при продаже!
Народ помогите плиз, ну запаился уже две недели над ним потею поправте не в лом!Скрипт нашёл на форуме и переделал под себя, только одно НО))
Code: Select all
var backpack='0x4051D5A4'
var sunduk='0x41222713'
var rune_to_home='0x416F5F7F'
var rune_to_vendor='0x40DEC9A1'
var TypeFood='0x097B'
var Reconnect=1
var a=0
sub carpentry()
if Reconnect==1 then
uo.Exec('exec Reconnect')
end if
while not uo.dead()
if proverka()==1 then
uo.print('Что то не так...')
else
do_fishing_pole(37)
endif
wend
endsub
sub proverka()
if uo.count(0x13F8)>37 then #Проверяем сколько палок,если больше 37 то реколимся к вендору и продаём!
go_to_vendor()
sell()
go_home()
end if
if uo.count(0x0EED)>0 then
uo.findtype(0x0EED,-1,backpack)
uo.moveitem('finditem',-1,sunduk)
wait(1000)
end if
if uo.count(0x1030)<1 then #проверям инструмент
uo.print("нет инструмента")
return 1
end if
uo.findtype(0x1BDD,-1,backpack)
if uo.findcount()<1 then #проверям логи в паке
uo.findtype(0x1BDD,-1,sunduk) #проверям логи в сундуке
if uo.findcount()>0 then
uo.grab('160','finditem')
EatingFood()
GetRegy()
do_fishing_pole(37)
else
uo.print("не осталось больше логов в ящике")
return 1
end if
end if
a=0
end sub
sub do_fishing_pole(kolvo)
a=0
for var i=0 to kolvo
proverka()
uo.findtype(0x1BDD,-1,backpack)
if uo.getquantity('finditem')<=4 then
uo.cancelmenu()
uo.exec("automenu 'Carpentry' 'Weapons & Tools'")
uo.exec("automenu 'Weapons & Tools' 'gnarled staff'")
uo.usetype('0x1030')
uo.deletejournal()
while 1<>a
if uo.injournal("You put the gnarled staff in your pack.") or uo.injournal("You fail to create the item") then
a=1
end if
wait(10)
wend
else
uo.cancelmenu()
uo.exec("automenu 'Carpentry' 'Weapons & Tools'")
uo.exec("automenu 'Weapons & Tools' 'gnarled staff'")
uo.usetype('0x1030')
uo.deletejournal()
while 1<>a
if uo.injournal("You put the gnarled staff in your pack.") or uo.injournal("You fail to create the item") then
a=1
end if
wait(10)
wend
end if
a=0
next
end sub
sub go_to_vendor()
var lastX=uo.getX(),lastY=uo.getY()
while uo.getX()==LastX and uo.getY()==LastY
CheckLag()
uo.waittargetobject(rune_to_vendor)
uo.cast('Recall')
repeat
wait(1000)
until uo.getX()<>LastX or uo.getY()<>LastY or UO.InJournal("The spell fizzles.") or UO.InJournal('You lack') or UO.Dead()
if UO.InJournal('You lack') or UO.Dead() then
return 1
end if
wend
end sub
sub sell()
for var i=0 to 2
na4alo:
UO.Msg("sell")
Wait(3000)
UO.Sell('sell_FP')
Wait(3000)
if UO.InJournal("Too far away from the Vendor") then
UO.Msg("bye")
Wait(10000)
uo.DeleteJournal()
goto na4alo
end if
next
end sub
sub meditation()
var tj=uo.getname()+": You lose your concentration"
uo.deletejournal()
uo.useskill('Meditation')
wait(1500)
for var i=0 to 150
if uo.journal(0)==tj then
meditation()
return 0
end if
wait(10)
next
while uo.mana<>uo.int
if uo.injournal()==tj then
meditation()
return 0
end if
wait(100)
wend
end sub
sub go_home()
var lastX=uo.getX(),lastY=uo.getY()
while uo.getX()==LastX and uo.getY()==LastY
CheckLag()
uo.waittargetobject(rune_to_home)
uo.cast('Recall')
repeat
wait(1000)
until uo.getX()<>LastX or uo.getY()<>LastY or UO.InJournal("The spell fizzles.") or UO.InJournal('You lack') or UO.Dead()
if UO.InJournal('You lack') or UO.Dead() then
return 1
end if
wend
end sub
sub wait_for_recall()
var tj=uo.getname()+": The spell fizzles.",tj1="You lack sufficient mana for this spell"
var x=uo.getx(),y=uo.gety()
uo.print('Æä¸ì ðåêîëà...')
for var i=0 to 200
if uo.Journal(0)==tj then
uo.print('Fuck ! Fizzle ! Repeat cast...')
uo.cast('Recall','lasttarget')
wait(3000)
wait_for_recall()
return 0
end if
if uo.Journal(0)==tj1 then
uo.print('Ooohhhh ! Shit ! Where is my mana ? Meditation - rulezzzz...')
meditation()
uo.cast('Recall','lasttarget')
wait_for_recall()
return 0
end if
wait(1)
next
wait(3000)
if uo.Journal(0)==tj or uo.Journal(1)==tj or uo.Journal(2)==tj and x==uo.getx() and y==uo.gety() then
uo.print("Oooooo =( I'm here again ! Repeat cast !")
uo.cast('Recall','lasttarget')
wait(4000)
wait_for_recall()
end if
end sub
sub wait_for_cast()
var tj=uo.getname()+": The spell fizzles.",tj1="You lack sufficient mana for this spell"
for var i=0 to 400
if uo.Journal(0)==tj then
uo.print('Fuck ! Fizzle ! Repeat cast...')
uo.cast('last','lasttarget')
wait(3000)
wait_for_cast()
return 0
end if
if uo.Journal(0)==tj1 then
uo.print('Ooohhhh ! Shit ! Where is my mana ? Meditation - rulezzzz...')
meditation()
uo.cast('Recall','lasttarget')
wait_for_cast()
return 0
end if
wait(10)
next
end sub
sub gz_mode()
var vas=uo.gethp()
while 1
if vas>uo.GetHP() then
uo.say('guards')
wait(300)
uo.say('guards')
wait(300)
uo.say('guards')
wait(300)
uo.say('guards')
wait(300)
vas=uo.gethp()
endif
vas=uo.gethp()
wait(30)
wend
end sub
sub kolvo_udoshek()
var k=uo.count(0x13F8)
uo.textprint(k)
end sub
sub podbor()
uo.findtype(0x13F8,-1,'ground')
uo.grab(1,'finditem')
end sub
sub EatingFood()
ToEat()
DropFood()
end sub
sub ToEat()
uo.SetReceivingContainer('backpack')
Open()
uo.FindType(TypeFood,'-1',sunduk)
uo.moveitem('finditem','20')
Checklag()
wait(1000)
repeat
Checklag()
wait(1000)
uo.UseType(TypeFood)
until uo.InJournal('You are simply too full to eat any more!')
Checklag()
wait(1000)
uo.UnsetReceivingContainer()
end sub
sub DropFood()
if uo.Waiting() then
uo.CancelTarget()
end if
var f,Exit
dim Food[1]
Food[0]=TypeFood
uo.SetReceivingContainer(sunduk)
wait(500)
for f=0 to 0
Exit=0
repeat
uo.FindType(Food[f])
if uo.GetQuantity('finditem')>0 then
uo.Grab('0','finditem')
wait(1500)
else
Exit=1
end if
until Exit==1
next
uo.UnSetReceivingContainer(sunduk)
end sub
sub Reconnect()
var ReconnectTime,rFlag
ReconnectTime='0'
rFlag=1
repeat
while (uo.ObjAtLayer('Bpack')=='')
if rFlag then
ReconnectTime=MakeTime()
rFlag=0
end if
wait(100000)
uo.Say('')
wait(3000)
uo.Say('')
wait(3000)
uo.Say('')
wait(3000)
uo.LDblClick(357,164)
uo.LClick(616,459)
wait(3000)
wend
wait(3000)
if (rFlag==0) and (ReconnectTime<>'0') then
uo.TextOpen()
uo.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
rFlag=1
ReconnectTime='0'
end if
until false
end sub
sub MakeTime()
var d,t,ret,i
ret=str(uo.Time())
t=""
for i=0 to Len(ret)
t=ret[Len(ret)-i]+t
if (i==2) or (i==4) then
t=":"+t
end if
next
ret=str(uo.Date())
d=""
for i=0 to Len(ret)
d=ret[Len(ret)-i] + d
if (i==2) or (i==4) then
d="."+d
end if
next
ret=t+" @ "+d
return ret
end sub
sub CheckLag()
if uo.Waiting()>0 then
uo.Exec('canceltarget')
end if
uo.DeleteJournal()
uo.Click('backpack')
repeat
wait(50)
until uo.InJournal('backpack')
end sub
sub GetRegy()
if uo.count('0x0F7B')<10 then
uo.FindType('0x0F7B',-1,sunduk) ;Blood Moss
wait(100)
uo.Grab('10','finditem')
wait(500)
end if
if uo.count('0x0F86')<10 then
uo.FindType('0x0F86',-1,sunduk) ;Mandrake Roots
wait(100)
uo.Grab('10','finditem')
wait(500)
end if
if uo.count('0x0F7A')<10 then
uo.FindType('0x0F7A',-1,sunduk) ;Black Pearls
wait(100)
uo.Grab('10','finditem')
wait(500)
end if
end sub
sub Open()
uo.DeleteJournal()
uo.UseObject(sunduk)
repeat
wait(500)
until uo.InJournal('Contains')
end sub