Yoko

All sides of Injection
It is currently 2025-11-11 09:59:14

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2007-09-02 09:04:10 
Offline

Joined: 2007-09-02 08:55:43
Posts: 1
Долго искал на форуме, но не нашёл темы, в которой это рассматривалось бы, создал новую.

Суть проблемы такова, при запуске скрипта вылетает ошибка:
Line 152: parse error

Проблема в том, что у меня в скрипте только 151 строка, как с этим бороться?

P.S. убрал из скрипта много полезного, но не помогло, сначала он был 252 строки и тогда писало ошибку в 253.

Вот сам скрипт:
Quote:
sub Main()
VAR ret = 1
Repeat
While ret
Mine()
Wait(1000)
If ret == 1 Then
Move()
Wait(1000)
Endif
Wend
Smelt()
Wait(1000)
Until UO.Dead or UO.Weight > 600
endsub

sub Mine()
VAR x, y, ret = 1, l = 1, lopata = '0x0F39', kirka = '0x0E86'
UO.FindType(lopata)
If UO.FindCount() == 0 Then
l=0
EndIf
UO.FindType(kirka)
If UO.FindCount() == 0 && l == 0 Then
ret = 0
EndIf
If UO.Weight > 625 Then
ret = 0
EndIf
for x=-2 to 2
for y=-2 to 2
uo.deletejournal()
while not uo.hidden()
uo.useskill('Stealth')
wait(5000)
wend
uo.waittargettile(0,uo.getx()+x,uo.gety()+y,uo.getz())
if l==1 Then
uo.usetype(lopata)
else
uo.usetype(kirka)
endif
wait(300)
if uo.lastmessage()=='Òóò íè÷åãî íåòó.' or uo.lastmessage()=='Ïîïðîáóéòå êîïàòü â äðóãîì ìåñòå.' or uo.lastmessage()=='Ó âàñ íåò îáçîðà ê ýòîìó ìåñòîïîëîæåíèþ' then
wait(50)
else
while uo.lastmessage() == 'Ãäå âû õîòèòå èñïîëüçîâàòü Pickaxe?' || uo.lastmessage() == 'Ãäå âû õîòèòå èñïîëüçîâàòü Shovel?'
wait(100)
wend
y=y-1
endif
next
next
endsub

sub Move()
VAR ret = 1, x, y, sx, sy
sx = UO.GetX()
sy = UO.GetY()
While ret
Go_To(sx-3,sy-4)
VAR A, B, C
A = abs( x - sx )
B = abs( y - sy )
If A > B Then
C = A
Else
C = B
EndIf
if C > 4 then
ret = 0
endif
Wend
endsub

sub Smelt()
VAR smore, sx, sy, ore = '0x19B9'
sx = UO.GetX()
sy = UO.GetY()
Go_To(sx+1,sy+1) ; forge
Wait(10000)
UO.FindType(ore)
While UO.FindCount()
smore = UO.GetSerial('finditem')
UO.Ignore('finditem)
DelJournal("Get minimum")
While not UO.InJournal("Get minimum")
UO.Useobject(smore)
wait(300)
Wend
UO.FindType(ore)
Wend
Wait(500)
Go_To(sx,sy)
Wait(10000)
endsub

sub Go_To(x,y)
var fx,fy
var xx=x
var yy=y
var forstep=300
repeat
fx=uo.GetX()
fy=uo.GetY()
Step(xx,yy,forstep)
until x==fx && y==fy
endsub

sub Step(x,y,forstep)
VAR xx=x, yy=y, sx=UO.GetX(), sy=GetY()
VAR mx=sx-xx
VAR my=sy-yy
if uo.GetX() <> x then
if uo.GetY() <> y then
if mx<0 then
if my<0 then
uo.Press(40)
wait(forstep)
else
uo.Press(39)
wait(forstep)
endif
else
if my<0 then
uo.Press(37)
wait(forstep)
else
uo.Press(38)
wait(forstep)
endif
endif
else
if mx<0 then
uo.Press(34)
wait(forstep)
else
uo.Press(36)
wait(forstep)
endif
endif
else
if my<0 then
uo.Press(35)
wait(forstep)
else
uo.Press(33)
wait(forstep)
endif
endif
endsub


Скрипт на самом деле ещё не дописан, он не будет выполнять своих функций пока, но все места, где будет вставлен код на мой взгляд правильно закрыты.


Top
   
 Post subject:
PostPosted: 2007-09-02 15:26:47 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Скорее всего кто-то не закрыт.. например иф..

Попробуйте расставить отстпуы, мы не роботы - нам с отступами легче.

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2007-09-02 17:00:42 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
В функции Smelt закрой кавычку в вызове uo.Ignore


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited