Lumber unhandled exception parser

Ask for scripts here

Moderators: Murderator+, Murderator

rus_lan
Posts: 24
Joined: 2010-06-07 07:54:20

Lumber unhandled exception parser

Post by rus_lan »

работает нормально но время от времени выдаёт такую ошибку"unhandled exception parser" может крашить клиент но не всегда, при креше пишет "access violation at address 7c9110d9 in module ntdll.dl Wright of address 1cd42e70"
инж 702.11
что только не пытался сделать, чувствую сам не справлюсь помогите.
ещё пишет в левом углу при работе скрипта 2 раза итем нод фаунд... я не могу понять что он найти не может?

var f=file("d:\trees3.dat")
###
var TryHiding=1
###
var TryRecall=1
###
var RechargeBook=0
###
var RuneToHome=1
###
var RuneToLumber=6
###
var LogsQty=500
###
var Quant=1

var GetFromFile=1
###
var ControlOfDanger=0
###
var CastAtAttack=0
###
var EatingFood=0
###
var TypeFood='0x097B'
###
var Reconnect=1
###
var RecallDrop=1
###
var RecallLumber=0
###
var Chest='0x4055A684'
###
var LumberSound=('C:\Warning.wav')
###
var OldX,OldY,time

sub Lumberjacking()
var i=0,j=0,k=0,r=0,q=0,ii,jj
var TopX=324,TopY=65
dim TreeX[5000], TreeY[5000],TreeT[5000]
dim TreeTile[29]
var flag=0,treeCount=0,clicks=0,flag2=0
########################
TreeTile[0]=3277
TreeTile[1]=3280
TreeTile[2]=3283
TreeTile[3]=3286
TreeTile[4]=3289
TreeTile[5]=3291
TreeTile[6]=3294
TreeTile[7]=3296
TreeTile[8]=3299
TreeTile[9]=3302
TreeTile[10]=3393
TreeTile[11]=3394
TreeTile[12]=3395
TreeTile[13]=3396
TreeTile[14]=3415
TreeTile[15]=3416
TreeTile[16]=3417
TreeTile[17]=3418
TreeTile[18]=3419
TreeTile[19]=3438
TreeTile[20]=3439
TreeTile[21]=3440
TreeTile[22]=3441
TreeTile[23]=3442
TreeTile[24]=3460
TreeTile[25]=3461
TreeTile[26]=3462
TreeTile[27]=3290
TreeTile[28]=3288

uo.Exec("filterspeech on")
uo.Exec("filterspeech add 'Where do you want to use the pickaxe?'")

uo.Print('Выбери Топор: ')
uo.Exec('addobject Axe')
while uo.Targeting()
wait(100)
wend

if TryRecall==1 then
uo.Print('Выбери PунБук: ')
uo.Exec('addobject Runebook')
while uo.Targeting()
wait(100)
wend
end if

if ControlOfDanger==1 then
uo.Exec('exec ControlOfDanger')
end if

if Reconnect==1 then
uo.Exec('exec Reconnect')
end if

if RecallLumber==1 then
uo.Exec('exec RecallToLumber')
wait(9000)
end if
#####################################
if GetFromFile==1 then
uo.Print('Загружаем координаты из файла...')
f.open()
treeCount=safe call f.ReadNumber()
for i=1 to treeCount
TreeT[i]=safe call f.ReadNumber()
TreeX[i]=safe call f.ReadNumber()
TreeY[i]=safe call f.ReadNumber()
next
f.close()
else
######################################
uo.Print('Выбери Кирку: ')
uo.Exec('addobject Pickaxe')
while uo.Targeting()
wait(100)
wend
uo.Print('Собираем координаты деревьев в округе...')
repeat
clicks=0
flag=0
uo.DeleteJournal()
#######################
uo.UseObject('Pickaxe')
waitForTarget()
uo.DeleteJournal()
WaitForTryRock()
###############################
flag=0
for k=0 to 28
if uo.LastTile(0)==TreeTile[k]+1 then
flag=2
end if
next
if flag==0 then
for k=0 to 28
if uo.LastTile(0)==TreeTile[k] then
flag=1
end if
next
end if
if uo.Lasttile(1)==uo.GetX() and uo.Lasttile(2)==uo.GetY() then
flag=3
end if
#########################
if flag==1 then
flag2=0
if treeCount>0 then
for ii=1 to treeCount
if TreeX[ii]==uo.LastTile(1) and TreeY[ii]==uo.LastTile(2) then
flag2=1
end if
next
end if
if flag2==0 then
treeCount=treeCount+1
TreeX[treeCount]=uo.LastTile(1)
TreeY[treeCount]=uo.LastTile(2)
TreeT[treeCount]=uo.LastTile(0)
uo.Print('Найдено дерево номер '+str(treeCount)+' : x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2)))
end if
end if
##########################
if flag==2 then
flag2=0
if treeCount>0 then
for ii=1 to treeCount
if TreeX[ii]==uo.LastTile(1) and TreeY[ii]==uo.LastTile(2) then
flag2=1
end if
next
end if
if flag2==0 then
treeCount=treeCount+1
TreeX[treeCount]=uo.LastTile(1)
TreeY[treeCount]=uo.LastTile(2)
TreeT[treeCount]=uo.LastTile(0)-1
uo.print('Найдено дерево номер '+str(treeCount)+' : x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2)))
end if
end if
until (flag==3) or (treeCount==5000)
uo.Exec("filterspeech off")
uo.Print('Анализ закончен, координаты деревьев записаны в файл C:\trees3.dat')
SaveToFile(treeCount,TreeX,TreeY,TreeT)
end if
uo.Print('Деревьев найдено: '+str(treeCount))
wait(2000)
######################################
while 1==1
if treeCount>0 then
for i=1 to treeCount
if TryRecall==1 and uo.Count('ZLK')>=LogsQty or uo.Weight>=uo.STR*4+20 then
ToRecall()
end if
uo.Print('Идем к дереву номер '+str(i)+': x='+str(TreeX[i])+' y='+str(TreeY[i]))
InfoLogs()
flag=GotoXY(TreeX[i],TreeY[i])
if flag==1 then
if TryHiding==1 then
ToHide()
end if
GetTree(str(TreeT[i]),str(TreeX[i]),str(TreeY[i]),str(uo.GetZ()))
end if
next
end if
wend
end sub

sub GetTree(Type,X,Y,Z)
var i
uo.Print('Начинаем рубку дерева...')
for i=0 to Quant
if uo.Warmode()==1 then
return 0
end if
wait(200)
uo.DeleteJournal()
uo.findtype( '0x002F', '-1', 'ground' )
if uo.findcount() then
entkill()
endif
uo.findtype( '0x000D', '-1', 'ground' )
if uo.findcount() then
vortpause()
endif
uo.WaitTargetTile(Type,X,Y,Z)
uo.UseObject('Axe')
if WaitForChange()==1 then
return 1
end if
next
return 0
end sub

sub ToRecall()
RecallToHome()
DropLogs()
InfoLogs()
if RechargeBook==1 then
RechargeBook()
wait(4000)
end if
if EatingFood==1 then
EatingFood()
end if
wait(3000)
RecallToLumber()
end sub

sub RecallToHome()
uo.Print('Прыгаем Домой.')
RunebookRecall(RuneToHome)
end sub

sub RecallToLumber()
uo.Print('Прыгаем в Лес.')
RunebookRecall(RuneToLumber)
end sub

sub ToHide()
while not uo.Hidden()
uo.Print('Пытаемся уйти в хайд...')
uo.DeleteJournal()
uo.UseSkill('Stealth')
wait(4100)
wend
wait(100)
end sub

sub WaitForRecall()
var Text1=uo.GetName()+': The spell fizzles.'
var mess='',LastX=uo.GetX(),LastY=uo.GetY()
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text1 then
return 0
end if
if uo.GetX()<>LastX or uo.GetY()<>LastY then
return 1
end if
wait(50)
next
return 0
end sub

sub WaitForHide()
var Text1=uo.GetName()+': You have hidden yourself well'
var Text2=uo.GetName()+": You can't seem to hide here."
var mess
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text1 then
return 1
end if
if uo.Journal(0)==Text2 then
return 0
end if
wait(50)
next
return 0
end sub

sub WaitForChange()
var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.'
var Text2='There are no logs here to chop.'
var Text3="You can't reach this."
var Text4='That is too far away.'
var Text5="You can't do much in your current state."
var mess
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 then
return 1
end if
if uo.Journal(0)==Text1 then
return 0
end if
if mess[0]=='Y' and mess[1]=='o' and mess[2]=='u' and mess[4]=='p' and mess[5]=='u' and mess[6]=='t' then
return 0
end if
wait(50)
next
return 0
end sub

sub WaitForTryRock()
var Text1='That is too far away.'
var Text2='Try mining in rock.'
var Text3='There is no ore here to mine.'
var Text4='You have no line of sight to that location'
var Text5="You can't see the target"
for var i=0 to 50
if uo.Journal(0)==Text1 or uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 or uo.Journal(0)==Text5 then
return 1
end if
wait(200)
next
return 0
end sub

sub WaitForTarget()
for var i=0 to 50
if uo.Targeting()==1 then
return 1
end if
wait(200)
next
return 0
end sub

sub WaitForChangeXY(myX,myY,LastX,LastY)
for var i=1 to 50
if LastX<>myX or LastY<>myY then
return 1
end if
wait(200)
next
return 0
end sub

sub GotoXY(x,y)
var myX,myY,LastX=0,LastY=0,i,halt=0,z,r=0
for i=1 to 60
myX=uo.GetX()
myY=uo.GetY()
if LastX==myX and LastY==myY then
halt=halt+1
else
halt=0
end if
if halt>=10 then
if uo.GetDir()==1 then
for z=0 to 8
uo.Press(40)
next
end if
if uo.GetDir()==3 then
for z=0 to 8
uo.Press(37)
next
end if
if uo.GetDir()==5 then
for z=0 to 8
uo.Press(38)
next
end if
if uo.GetDir()==7 then
for z=0 to 8
uo.Press(39)
next
end if
halt=15
end if
if Numb(x-myX)<=1 and Numb(y-myY)<=2 then
return 1
end if
if x<=myX then
if y<=myY then
for z=0 to 3
uo.Press(38)
next
else
for z=0 to 3
uo.Press(37)
next
end if
else
if y<=myY then
for z=0 to 3
uo.Press(39)
next
else
for z=0 to 3
uo.Press(40)
next
end if
end if
LastX=myX
LastY=myY
wait(200)
next
return 0
end sub

sub Numb(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub

sub SaveToFile(treeCount,TreeX,TreeY,TreeT)
var f=file("C:\trees3.dat")
var s=0,i=0
f.open()
f.create()
s=safe call f.writeln(treeCount)
for i=1 to treeCount
s=safe call f.writeln(str(TreeT[i])+' '+str(TreeX[i])+' '+str(TreeY[i]))
next
f.close()
end sub

sub DropLogs()
var Time,Space
Time=Time()
Space=' '
uo.TextOpen()
uo.TextPrint("Выкладываем логи - " +Space +Time)
ToHide()
var a,Exit
dim Logs[1]
Logs[0]=0x1BDD
uo.Print('Выкладываем Логи.')
for a=0 to 0
MovingItems(Logs[a],'-1',-1,0)
next
uo.Print('Логи Выложены.')
end sub

sub InfoLogs()
uo.Print('У вас всего '+str(uo.Count('0x1BDD'))+' логов в сумке')
uo.Print('Из них '+str(uo.Count('0x1BDD','0x0000'))+' простых и ' +str(uo.Count('0x1BDD')-uo.Count('0x1BDD','0x0000'))+' цветных')
end sub

sub RunebookRecall(n)
OldX=uo.GetX()
OldY=uo.GetY()
repeat
uo.Exec('warmode 0')
uo.UseObject('Runebook')
CheckLag()
uo.LClick(135, n*15+55)
CheckLag()
time=uo.Timer()
repeat
wait(500)
until OldX<>uo.GetX() or OldY<>uo.GetY() or uo.Dead() or uo.InJournal('needs') or uo.InJournal('fizzles') or time+200<uo.Timer()
until OldX<>uo.GetX() or OldY<>uo.GetY() or uo.Dead() or uo.InJournal('needs')
end sub

sub Open(Container)
uo.DeleteJournal()
uo.UseObject(Container)
repeat
wait(500)
until uo.InJournal('Contains')
end sub

sub MovingItems(tItem,cItem,qItem,FromBackPack)
var idResivCont
var idSendCont
if FromBackPack==1 then
idResivCont=uo.GetSerial('backpack')
idSendCont=Chest
else
idSendCont=uo.GetSerial('backpack')
idResivCont=Chest
end if
CheckLag()
uo.FindType(tItem,cItem,idSendCont)
while uo.GetQuantity('finditem')>0
uo.MoveItem('finditem',qItem,idResivCont)
wait(1000)
CheckLag()
if qItem>0 then
return
end if
uo.FindType(tItem,cItem,idSendCont)
wend
end sub

sub RechargeBook()
var Time,Space
Time=Time()
Space=' '
uo.TextOpen()
uo.TextPrint("Речарим рунбуку - " +Space +Time)
repeat
MovingItems('0x1F4C','-1',-1,1)
uo.UseObject('Runebook')
wait(1000)
Checklag()
uo.Lclick(296,91)
wait(1000)
until uo.InJournal('charges are 50') or uo.InJournal('fully')
while uo.Count('0x1F4C')>0
MovingItems('0x1F4C','-1',-1,0)
end sub

sub EatingFood()
var Time,Space
Time=Time()
Space=' '
uo.TextOpen()
uo.TextPrint("Кушаем - " +Space +Time)
MovingItems(TypeFood,'-1',20,1)
repeat
CheckLag()
uo.UseType(TypeFood)
while not uo.InJournal('full') and not uo.InJournal('stuffed') and not uo.InJournal('hungry') and not uo.InJournal('satiated') and not uo.Dead()
wait(100)
wend
until uo.InJournal('too full') or uo.Dead()
MovingItems(TypeFood,'-1',-1,0)
end sub

sub WriteNames()
var Time,Space
Time=Time()
Space=' '
uo.GetStatus("uo.JournalSerial(0)")
uo.SetGlobal("name",uo.GetName(uo.JournalSerial(0)))
uo.TextOpen()
uo.TextPrint("Вас атаковал - "+uo.GetName(uo.JournalSerial(0)) +Space +Time)
end sub

sub ControlOfDanger()
uo.DeleteJournal()
var Enemy='0x00000000'
repeat
if uo.InJournal('is attacking you') or uo.InJournal('OOPS !!!') or uo.InJournal('Wis Quas') then
WriteNames()
uo.Exec('terminate Lumberjacking')
Enemy=uo.JournalSerial(uo.InJournal('is attacking you')-1)
uo.PlayWav(LumberSound)
if CastAtAttack==1 then
uo.Cast('Magic Arrow',Enemy)
end if
uo.DeleteJournal()
RecallAtDanger()
end if
wait(1000)
until false
end sub

sub RecallAtDanger()
var mX,mY
reccal:
uo.DeleteJournal()
if uo.Waiting() then
uo.CancelTarget()
end if
mX=uo.GetX("self")
mY=uo.GetY("self")
uo.DeleteJournal()
uo.FindType('0x1F14',-1,'mY')
uo.Cast('Recall','finditem')
uo.TextOpen()
uo.TextPrint("Пытаемся сбежать!")
uo.SayU('This script coded by Cooler!')
uo.SayU('Fuck your self!')
wait(4000)
if not uo.GetX("self")<>mX and not uo.GetY("self")<>mY then
goto reccal
end if
uo.TextOpen()
uo.TextPrint("Сбежали удачно!")
if RecallDrop==1 then
RecallToHome()
DropLogs()
InfoLogs()
end if
Terminate()
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(20000)
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 Time()
var hh,mm,ss,hms,t=str(uo.Time())
if len(t)<=2 then
hh="0"
mm="0"
ss=t
endif
if len(t)==3 then
hh="0"
mm=left(t,len(t)-2)
ss=right(t,len(t)-1)
endif
if len(t)==4 then
hh="0"
mm=left(t,len(t)-2)
ss=right(t,len(t)-2)
endif
if len(t)==5 then
hh=left(t,len(t)-4)
hms=left(t,len(t)-2)
mm=right(hms,len(hms)-1)
ss=right(t,len(t)-3)
endif
if len(t)==6 then
hh=left(t,len(t)-4)
hms=left(t,len(t)-2)
mm=right(hms,len(hms)-2)
ss=right(t,len(t)-4)
endif
return hh+":"+mm+":"+ss
end sub

sub Terminate()
uo.Print('Скрипт и все его функции выключены!')
uo.DeleteJournal()
uo.Exec('terminate all')
wait(100)
uo.Exec('terminate all')
wait(100)
uo.Exec('terminate all')
wait(100)
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 AttackEnts()
repeat
if uo.InJournal('is attacking you') or uo.InJournal('OOPS!!!') or uo.InJournal('Ent') then
uo.Exec('terminate Lumberjacking')


uo.DeleteJournal()
end if
wait(1000)
until uo.dead()
end sub

Sub entkill()
uo.findtype( '0x002F', '-1', 'ground' )
if uo.findcount() then
uo.Usetype('0x0F0E','0x0631') ; Invise
uo.UseType('0x1F66') ; Vortex scroll
uo.WaitTargetobject ('finditem')
while not UO.Hidden()
UO.Warmode("0")
uo.print("I?y?ainy...")
UO.UseSkill("Hiding")
wait(4000)
wend
wait (3000)
endif
endsub

Sub vortpause()
uo.findtype( '0x000D', '-1', 'ground' )
if uo.findcount() then
while not UO.Hidden()
UO.Warmode("0")
uo.print("I?y?ainy...")
UO.UseSkill("Hiding")
wait(4000)
wend
wait (20000)
endif
endsub

sub dsd()
while 1==1
uo.deletejournal()
repeat
wait(100)
until uo.injournal( "battle" )
wait(50)
UO.Exec('warmode 0')
wait(500)
wend
end sub
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Lumber unhandled exception parser

Post by Mirage »

переназначить нагрузку проца на одно ядро. Как это сделать (как результат - как тебе избавится от ошибки) есть в важных прикрепленных верху темах. Хотя бы почитал.
rus_lan
Posts: 24
Joined: 2010-06-07 07:54:20

Re: Lumber unhandled exception parser

Post by rus_lan »

Mirage wrote:переназначить нагрузку проца на одно ядро. Как это сделать (как результат - как тебе избавится от ошибки) есть в важных прикрепленных верху темах. Хотя бы почитал.

отлично, только где о этом прочитать я не понял(( дай ссылку плз
rus_lan
Posts: 24
Joined: 2010-06-07 07:54:20

Re: Lumber unhandled exception parser

Post by rus_lan »

rus_lan wrote:
Mirage wrote:переназначить нагрузку проца на одно ядро. Как это сделать (как результат - как тебе избавится от ошибки) есть в важных прикрепленных верху темах. Хотя бы почитал.

отлично, только где о этом прочитать я не понял(( дай ссылку плз

ты имеешь в виду дуалкоре лаунчер??
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Lumber unhandled exception parser

Post by Mirage »

да :D Если не хочется качать и настраивать то нажимаешь CTRL+SHIFT+ESC -> Процессы -> client.exe правой кнопкой мыши -> задать соответствие -> галку поставить на ОДНО CPU (любое).
И еще можно понижающую нагрузку программку Грина использовать.. Можно будет играть в несколько окон без особых тормозов.
rus_lan
Posts: 24
Joined: 2010-06-07 07:54:20

Re: Lumber unhandled exception parser

Post by rus_lan »

Mirage wrote:да :D Если не хочется качать и настраивать то нажимаешь CTRL+SHIFT+ESC -> Процессы -> client.exe правой кнопкой мыши -> задать соответствие -> галку поставить на ОДНО CPU (любое).
И еще можно понижающую нагрузку программку Грина использовать.. Можно будет играть в несколько окон без особых тормозов.

спасибо все заработало))))) без крашей СЛАВА БОГУ! а если на нуле стоит значит 2 проца работает я правильно понимаю?
и это только к на этом процессе работает в смысле на client.exe, а на остальных 2?
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Lumber unhandled exception parser

Post by Mirage »

обе галки = 2 ядра обрабатывают процесс => нагрузка на каждое в 2 раза меньше => производительность выше. Но ультима игра 1998 года выпуска на такие перлы не расчитана притом что сам по себе клиент <4.00 нагружает на 80-100% одноядерный процессор.
Одна галка - более привычная обстановка для клиента. Если использовать понижение нагрузки то будет 1 клиент жрать 10-20% ядра.
0 галок не получится - вида не даст :D

Интересно как обстоят дела на ubunte с нагрузкой процессора. Планирую скорый переход на linux, но ультиму бросать не хоца :mrgreen:
rus_lan
Posts: 24
Joined: 2010-06-07 07:54:20

Re: Lumber unhandled exception parser

Post by rus_lan »

первый раз на ёко пишу... не ожидал если честно что ответ будет и решение))) спасибо за ваш труд!
Андрюха из Одессы
Posts: 164
Joined: 2009-03-21 10:03:06
Location: Одесса-Мама
Contact:

Re: Lumber unhandled exception parser

Post by Андрюха из Одессы »

Mirage, на бубунте бегал. шанс 50% на 50%. Либо компиз отключишь и будешь нормально играть. Либо придется голову себе морочить. На тысяче компах, бубунта будет вести себя по-разному. Желаю обойтись малой кровью.
Спасибо всем, у кого учился!

Меня трудно найти, легко потерять, и невозможно забыть. Я - рабочий исходник!
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Lumber unhandled exception parser

Post by Mirage »

пасибо. буду значит переходить плавно с 2 системами на компе 8)
Valov
Posts: 64
Joined: 2009-06-01 10:02:57

Re: Lumber unhandled exception parser

Post by Valov »

На бесте играю. Вылетает парсер после указания инструментов ни сделав и единого шага. Ходилку наверно корректировать?
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Lumber unhandled exception parser

Post by Mirage »

Ты пробовал сделать что написано выше?
Valov
Posts: 64
Joined: 2009-06-01 10:02:57

Re: Lumber unhandled exception parser

Post by Valov »

да на одно ядро всё поставил
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Lumber unhandled exception parser

Post by Mirage »

Code: Select all

sub RechargeBook() 
   var Time,Space
   Time=Time()
   Space=' '
   uo.TextOpen()
   uo.TextPrint("Речарим рунбуку - " +Space +Time)
   repeat
      MovingItems('0x1F4C','-1',-1,1)
      uo.UseObject('Runebook')
      wait(1000)
      Checklag()
      uo.Lclick(296,91)
      wait(1000)
   until uo.InJournal('charges are 50') or uo.InJournal('fully')
   while uo.Count('0x1F4C')>0
      MovingItems('0x1F4C','-1',-1,0)
   end sub


не хватает wend
Valov
Posts: 64
Joined: 2009-06-01 10:02:57

Re: Lumber unhandled exception parser

Post by Valov »

ни в этом дело . Я упростил скрипт чтоб он просто ходил и рубил остальное вырезал
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Lumber unhandled exception parser

Post by Mirage »

А ну тогда все ясно. Ошибка у тебя В скрипте. 8)

На будущее, когда чтото будешь спрашивать, сразу предупреждай что пишешь для телепатов ;) А то малоли.


PS C твоей стороны можно попытаться ХОТЯ БЫ показать скрипт который у тебя не работает. Не считаешь так? :mrgreen:
Valov
Posts: 64
Joined: 2009-06-01 10:02:57

Re: Lumber unhandled exception parser

Post by Valov »

var f=file("d:\trees3.dat")

var TryHiding=1

var Quant=1

var GetFromFile=1

var Reconnect=1

var LumberSound=('C:\Warning.wav')
var OldX,OldY,time

sub Lumberjacking()
var i=0,j=0,k=0,r=0,q=0,ii,jj
var TopX=324,TopY=65
dim TreeX[5000], TreeY[5000],TreeT[5000]
dim TreeTile[29]
var flag=0,treeCount=0,clicks=0,flag2=0
########################
TreeTile[0]=3277
TreeTile[1]=3280
TreeTile[2]=3283
TreeTile[3]=3286
TreeTile[4]=3289
TreeTile[5]=3291
TreeTile[6]=3294
TreeTile[7]=3296
TreeTile[8]=3299
TreeTile[9]=3302
TreeTile[10]=3393
TreeTile[11]=3394
TreeTile[12]=3395
TreeTile[13]=3396
TreeTile[14]=3415
TreeTile[15]=3416
TreeTile[16]=3417
TreeTile[17]=3418
TreeTile[18]=3419
TreeTile[19]=3438
TreeTile[20]=3439
TreeTile[21]=3440
TreeTile[22]=3441
TreeTile[23]=3442
TreeTile[24]=3460
TreeTile[25]=3461
TreeTile[26]=3462
TreeTile[27]=3290
TreeTile[28]=3288

uo.Exec("filterspeech on")
uo.Exec("filterspeech add 'Where do you want to use the pickaxe?'")

uo.Print('Âûáåðè Òîïîð: ')
uo.Exec('addobject Axe')
while uo.Targeting()
wait(100)
wend



if Reconnect==1 then
uo.Exec('exec Reconnect')
end if


#####################################
if GetFromFile==1 then
uo.Print('Çàãðóæàåì êîîðäèíàòû èç ôàéëà...')
f.open()
treeCount=safe call f.ReadNumber()
for i=1 to treeCount
TreeT[i]=safe call f.ReadNumber()
TreeX[i]=safe call f.ReadNumber()
TreeY[i]=safe call f.ReadNumber()
next
f.close()
else
######################################
uo.Print('Âûáåðè Êèðêó: ')
uo.Exec('addobject Pickaxe')
while uo.Targeting()
wait(100)
wend
uo.Print('Ñîáèðàåì êîîðäèíàòû äåðåâüåâ â îêðóãå...')
repeat
clicks=0
flag=0
uo.DeleteJournal()
#######################
uo.UseObject('Pickaxe')
waitForTarget()
uo.DeleteJournal()
WaitForTryRock()
###############################
flag=0
for k=0 to 28
if uo.LastTile(0)==TreeTile[k]+1 then
flag=2
end if
next
if flag==0 then
for k=0 to 28
if uo.LastTile(0)==TreeTile[k] then
flag=1
end if
next
end if
if uo.Lasttile(1)==uo.GetX() and uo.Lasttile(2)==uo.GetY() then
flag=3
end if
#########################
if flag==1 then
flag2=0
if treeCount>0 then
for ii=1 to treeCount
if TreeX[ii]==uo.LastTile(1) and TreeY[ii]==uo.LastTile(2) then
flag2=1
end if
next
end if
if flag2==0 then
treeCount=treeCount+1
TreeX[treeCount]=uo.LastTile(1)
TreeY[treeCount]=uo.LastTile(2)
TreeT[treeCount]=uo.LastTile(0)
uo.Print('Íàéäåíî äåðåâî íîìåð '+str(treeCount)+' : x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2)))
end if
end if
##########################
if flag==2 then
flag2=0
if treeCount>0 then
for ii=1 to treeCount
if TreeX[ii]==uo.LastTile(1) and TreeY[ii]==uo.LastTile(2) then
flag2=1
end if
next
end if
if flag2==0 then
treeCount=treeCount+1
TreeX[treeCount]=uo.LastTile(1)
TreeY[treeCount]=uo.LastTile(2)
TreeT[treeCount]=uo.LastTile(0)-1
uo.print('Íàéäåíî äåðåâî íîìåð '+str(treeCount)+' : x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2)))
end if
end if
until (flag==3) or (treeCount==5000)
uo.Exec("filterspeech off")
uo.Print('Àíàëèç çàêîí÷åí, êîîðäèíàòû äåðåâüåâ çàïèñàíû â ôàéë C:\trees3.dat')
SaveToFile(treeCount,TreeX,TreeY,TreeT)
end if
uo.Print('Äåðåâüåâ íàéäåíî: '+str(treeCount))
wait(2000)
######################################
while 1==1
if treeCount>0 then
for i=1 to treeCount
uo.Print('Èäåì ê äåðåâó íîìåð '+str(i)+': x='+str(TreeX[i])+' y='+str(TreeY[i]))
flag=GotoXY(TreeX[i],TreeY[i])
if flag==1 then
if TryHiding==1 then
ToHide()
end if
GetTree(str(TreeT[i]),str(TreeX[i]),str(TreeY[i]),str(uo.GetZ()))
end if
next
end if
wend
end sub

sub GetTree(Type,X,Y,Z)
var i
uo.Print('Íà÷èíàåì ðóáêó äåðåâà...')
for i=0 to Quant
if uo.Warmode()==1 then
return 0
end if
wait(200)
uo.DeleteJournal()
endif
uo.WaitTargetTile(Type,X,Y,Z)
uo.UseObject('Axe')
if WaitForChange()==1 then
return 1
end if
next
return 0
end sub



sub ToHide()
while not uo.Hidden()
uo.Print('Ïûòàåìñÿ óéòè â õàéä...')
uo.DeleteJournal()
uo.UseSkill('Stealth')
wait(4100)
wend
wait(100)
end sub



sub WaitForHide()
var Text1=uo.GetName()+': You have hidden yourself well'
var Text2=uo.GetName()+": You can't seem to hide here."
var mess
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text1 then
return 1
end if
if uo.Journal(0)==Text2 then
return 0
end if
wait(50)
next
return 0
end sub

sub WaitForChange()
var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.'
var Text2='There are no logs here to chop.'
var Text3="You can't reach this."
var Text4='That is too far away.'
var Text5="You can't do much in your current state."
var mess
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 then
return 1
end if
if uo.Journal(0)==Text1 then
return 0
end if
if mess[0]=='Y' and mess[1]=='o' and mess[2]=='u' and mess[4]=='p' and mess[5]=='u' and mess[6]=='t' then
return 0
end if
wait(50)
next
return 0
end sub

sub WaitForTryRock()
var Text1='That is too far away.'
var Text2='Try mining in rock.'
var Text3='There is no ore here to mine.'
var Text4='You have no line of sight to that location'
var Text5="You can't see the target"
for var i=0 to 50
if uo.Journal(0)==Text1 or uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 or uo.Journal(0)==Text5 then
return 1
end if
wait(200)
next
return 0
end sub

sub WaitForTarget()
for var i=0 to 50
if uo.Targeting()==1 then
return 1
end if
wait(200)
next
return 0
end sub

sub WaitForChangeXY(myX,myY,LastX,LastY)
for var i=1 to 50
if LastX<>myX or LastY<>myY then
return 1
end if
wait(200)
next
return 0
end sub

sub GotoXY(x,y)
var myX,myY,LastX=0,LastY=0,i,halt=0,z,r=0
for i=1 to 60
myX=uo.GetX()
myY=uo.GetY()
if LastX==myX and LastY==myY then
halt=halt+1
else
halt=0
end if
if halt>=10 then
if uo.GetDir()==1 then
for z=0 to 8
uo.Press(40)
next
end if
if uo.GetDir()==3 then
for z=0 to 8
uo.Press(37)
next
end if
if uo.GetDir()==5 then
for z=0 to 8
uo.Press(38)
next
end if
if uo.GetDir()==7 then
for z=0 to 8
uo.Press(39)
next
end if
halt=15
end if
if Numb(x-myX)<=1 and Numb(y-myY)<=2 then
return 1
end if
if x<=myX then
if y<=myY then
for z=0 to 3
uo.Press(38)
next
else
for z=0 to 3
uo.Press(37)
next
end if
else
if y<=myY then
for z=0 to 3
uo.Press(39)
next
else
for z=0 to 3
uo.Press(40)
next
end if
end if
LastX=myX
LastY=myY
wait(200)
next
return 0
end sub

sub Numb(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub

sub SaveToFile(treeCount,TreeX,TreeY,TreeT)
var f=file("C:\trees3.dat")
var s=0,i=0
f.open()
f.create()
s=safe call f.writeln(treeCount)
for i=1 to treeCount
s=safe call f.writeln(str(TreeT[i])+' '+str(TreeX[i])+' '+str(TreeY[i]))
next
f.close()
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(20000)
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 Time()
var hh,mm,ss,hms,t=str(uo.Time())
if len(t)<=2 then
hh="0"
mm="0"
ss=t
endif
if len(t)==3 then
hh="0"
mm=left(t,len(t)-2)
ss=right(t,len(t)-1)
endif
if len(t)==4 then
hh="0"
mm=left(t,len(t)-2)
ss=right(t,len(t)-2)
endif
if len(t)==5 then
hh=left(t,len(t)-4)
hms=left(t,len(t)-2)
mm=right(hms,len(hms)-1)
ss=right(t,len(t)-3)
endif
if len(t)==6 then
hh=left(t,len(t)-4)
hms=left(t,len(t)-2)
mm=right(hms,len(hms)-2)
ss=right(t,len(t)-4)
endif
return hh+":"+mm+":"+ss
end sub

sub Terminate()
uo.Print('Ñêðèïò è âñå åãî ôóíêöèè âûêëþ÷åíû!')
uo.DeleteJournal()
uo.Exec('terminate all')
wait(100)
uo.Exec('terminate all')
wait(100)
uo.Exec('terminate all')
wait(100)
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




uo.DeleteJournal()
end if
wait(1000)
until uo.dead()
end sub
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Lumber unhandled exception parser

Post by Mirage »

Code: Select all

sub GetTree(Type,X,Y,Z)
   var i
   uo.Print('Íà÷èíàåì ðóáêó äåðåâà...')
   for i=0 to Quant
      if uo.Warmode()==1 then
         return 0
      end if
      wait(200)
      uo.DeleteJournal()
   endif
   uo.WaitTargetTile(Type,X,Y,Z)
   uo.UseObject('Axe')
   if WaitForChange()==1 then
      return 1
   end if
next
return 0
end sub

ошибка в циклах. Лишний endif

Code: Select all

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
uo.DeleteJournal()   ;  <--- это что за фигня?
end if
wait(1000)
until uo.dead()
end sub


может не стоит трогать то что работает? ;)
Valov
Posts: 64
Joined: 2009-06-01 10:02:57

Re: Lumber unhandled exception parser

Post by Valov »

Сам такого же мнения но где я играю ресурсодобывающие скрипты строго караются и фиксятся в корне , приходится заново лясы изобретать и доказывать что не верблюд. Функцию чеклаг тоже править надо ? Йа её не трогал.
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Lumber unhandled exception parser

Post by Mirage »

Ну и не добывай скритом ;)
после чеклага в оригинале было это

Code: Select all

sub AttackEnts() 
repeat
if uo.InJournal('is attacking you') or uo.InJournal('OOPS!!!') or uo.InJournal('Ent') then
uo.Exec('terminate Lumberjacking')

Ты это удалил. Либо удали по нормальному либо верни на место
Post Reply