Mining выдает ошибку не существующей линии

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Daimond
Posts: 9
Joined: 2006-07-16 23:48:35

Mining выдает ошибку не существующей линии

Post by Daimond »

вообщем запускаю скрипт а он выдет ошибку на 345 линии хотя всего 335 линей в чем может быть проблема ?

Помогите советом.

Сам скрипт:


Code: Select all

sub main ()
var i, x, y, z, t, x1, y1, down, pick
UO.exec('terminate reconnector')
UO.exec('exec reconnector')
save()
UO.DeleteJournal ()
UO.Print ("select place to mine")
UO.infotile ()
wait (5000)
t=UO.lasttile (0)
z=UO.lasttile (3)

down = 1

UO.unequip ("Rhand")
wait (1000)
UO.FindType ("0x0E85")
wait (1000)
pick = UO.GetSerial ("finditem")
UO.equip ("Rhand", pick)

while not UO.Dead ()

UO.DeleteJournal ()
x=UO.GetX ()
y=UO.GetY ()

UO.exec ("waittargettile '" + str(t) + "' '" + str(x) + "' '" + str(y) + "' '" + str(z) + "'")
UO.useobject (pick)

while not UO.inJournal ("no more ore") and not UO.inJournal ("tool broke") and not UO.InJournal ("stop mining") and not UO.inJournal ("cannot see that") and not UO.inJournal ("far away")
wait (1000)
if UO.InJournal ("element") then
goto theend
endif
wend

if UO.InJournal ("tool broke") then
UO.FindType ("0x0E85")
wait (1000)
pick = UO.GetSerial ("finditem")
UO.equip ("Rhand", pick)
endif

x1=x+down
y1=y
repeat:
gotoxy (x1, y1, 0)

carry ()

x=UO.GetX ()
y=UO.GetY ()

if x<>x1 or y<>y1 then
if not UO.InJournal ("You are too fatigued to move") then
y=y+1
gotoxy (x, y, 0)
down=-down

carry ()

wait (1000)
UO.findtype ("ore", -1, 1)
UO.grab (2000, "finditem")
wait (1000)

UO.ServerPrint (".hungry")
wait (1000)
if UO.LastMessage () == "You aren't hungry at all" then
UO.exec ("usetype '0x097B'")
wait (2000)
endif
else
wait (60000)
endif
endif
wend
theend:
end sub

sub carry ()
UO.findtype (0x19B9, 0x0602, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x0000, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x0231, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x045E, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x0585, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x006F, 1)
UO.grab (2000, "finditem")
wait (1000)

UO.findtype (0x19B9, 0x0481, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x0042, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x009C, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x0602 , 1)
UO.grab (2000, "finditem")
wait (1000)
end sub

sub take ()
while not UO.Dead ()
UO.findtype (0x19B9, 0x0000, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x07DF, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x0482, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x045E, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x07D6, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x006F, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x05D7, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x094E, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x0940, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x09F9, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x094A, 1)
UO.grab (2000, "finditem")
wait (1000)
UO.findtype (0x19B9, 0x045E, 1)
UO.grab (2000, "finditem")
wait (1000)
wend
end sub

sub gotoxy(x,y,prec)
var ld=0,ldc=0
var dx,dy
var mx,my
var ox,oy,mk,k
#uo.print(">")
#uo.track("1",str(x),str(y))
start:
mx=UO.GetX()
my=UO.GetY()
dx=mx-x
if dx<0 then
dx=0-dx
endif
dy=my-y
if dy<0 then
dy=0-dy
endif
if dy>dx then
dx=dy
end if
if dx<=prec then
return
end if
if not ldc then
uo.print(STR(dx))
end if
if dx<3 then
mk=70
else
mk=15
end if

ox=mx
oy=my
for k=1 to mk
mx=UO.GetX()
my=UO.GetY()
if mx<>ox or my<>oy then
goto sdidapl
end if
wait(10)
next
sdidapl:

mx=UO.GetX()
my=UO.GetY()
dx=mx-x
if dx<0 then
dx=0-dx
endif
dy=my-y
if dy<0 then
dy=0-dy
endif
if dy>dx then
dx=dy
end if

if dx<=prec then
return
end if
if ld==dx then
ldc=ldc+1
if ldc>15 then
uo.print("Can not reach location!")
return
end if
else
ld=dx
end if

if mx==x then
if my==y then
return
endif
if my>y then
#UO.Print("UR")
UO.Press(33)
goto start
endif
#UO.Print("DL")
UO.Press(35)
goto start
end if
if mx<x then
if my>y then
#UO.Print("R")
UO.Press(39)
goto start
endif
if my==y then
#UO.Print("DR")
UO.Press(34)
goto start
endif
#UO.Print("D")
UO.Press(40)
goto start
end if
if my<y then
#UO.Print("L")
UO.Press(37)
goto start
endif
if my==y then
#UO.Print("LU")
UO.Press(36)
goto start
endif
#UO.Print("U")
UO.Press(38)
goto start
end sub
sub save()
if UO.injournal('Saving World State') then
UO.print('Caaa??ea ne?eioa ia 30 nae.')
UO.Print('-------------------------')
Wait(30000)
UO.deletejournal()
endif
deathchk()
end sub

sub deathchk()
if UO.dead() then
uo.print('Ou oia?!')
UO.Print('-------------------------')
UO.Snap()
UO.exec('terminate all')
endif
end sub
sub Reconnector()
var RFlag
RFlag = 1
Repeat
While (UO.ObjAtLayer('Bpack') == '')
if RFlag Then
RFlag = 0
endif
Wait(20000) # WorldSave Protection
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.LClick(616,459)
Wait(3000)
WEnd
Wait(3000)
if (RFlag == 0) Then

RFlag = 1
endif
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
EndIf
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
EndIf
Next
Ret = T + " @ " + D
RETURN Ret
end sub
GAUHAR
Posts: 137
Joined: 2006-11-06 21:45:23

Post by GAUHAR »

Вопрос. В твоем скрипте есть такая строчка:
repeat:
для чего она?
Это вроде как метка для оператора goto, но repeat вроде как зарезервированное слово, с которого начинается цикл repeat .... until.
Если это не метка, а нелепая ошибка, то все равно в скрипте нет условия until.
Попробуй убрать эту строку, может ошибка пропадет.

п.с. скрипт только глянул одним глазком.
Post Reply