SRL Archive - Help and Support

stupid question for a srl member


oliver1205

2007-12-08 20:05:44

i no this is a stupid question for a member to be asking but im getting pissed. im trying to fix pentii's MCMB and im getting this error on the find wall line. " Variable Expected in script"


procedure WalkToVW2;
var
i,x,y,FindWalls:Integer;
begin
if(KYAB)then
Begin
for i:= 0 to GetArrayLength(VWTiles)-1 do
ClickTile(VWTiles[i].X,VWTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),240,265,50,1,0)))then
begin
Mouse(MMCX-50,MMCY+35,4,4,true)
wait(200)
Flag;
end;
wait(10)
for i:= 0 to 1 do
begin
if(FindWall(x,y,5,40,35,60))then //////////////////////// THIS LINE
begin
Mouse(x-20,y+15,5,5,True)
wait(200)
Flag;
end
else
begin
Mouse(MMCX-5,MMCY+55,5,5,True)
wait(200)
Flag;
Wait(500)
end;
end;

R0b0t1

2007-12-08 20:39:13

Have you declared x and y?

oliver1205

2007-12-08 21:40:53

yeah. lookit the top of the function.

LordGregGreg

2007-12-08 21:53:04

go through and try adding in semi colons where they belong. Follow the SRL script standards, they have guidelines to help you see where semicolons belong.

Most program languages will not compile if there are semicolons missing, however Scar scripts can get away with it. This is good in some cases, but can lead to logic errors, and the processor getting confused. To avoid this from happening, make sure you have semicolons at the end of each line. (note, some lines do not need semicolons, like "begin")



so add in semicolons everywhere in your script. :D


wait(10);
for i:= 0 to 1 do
begin
if(FindWall(x,y,5,40,35,60))then //////////////////////// THIS LINE
begin
Mouse(x-20,y+15,5,5,True);
wait(200);
Flag;

That's just a demo of what I am talking about.

Good luck.

(EDITED TO ADD IN MORE ENGLISH AND LESS GREGISH :P)

R0b0t1

2007-12-08 22:52:52

What…? I didn't get that, and English is your first language =\

oliver1205

2007-12-09 08:27:48

From: LordGregGreg
go through and try adding in semi colons where they belong. Follow the SRL script standards, they have guidelines to help you see where semicolons belong.

Most program languages will not compile if there are semicolons missing, however Scar scripts can get away with it. This is good in some cases, but can lead to logic errors, and the processor getting confused. To avoid this from happening, make sure you have semicolons at the end of each line. (note, some lines do not need semicolons, like "begin")



so add in semicolons everywhere in your script. :D


wait(10);
for i:= 0 to 1 do
begin
if(FindWall(x,y,5,40,35,60))then //////////////////////// THIS LINE
begin
Mouse(x-20,y+15,5,5,True);
wait(200);
Flag;

That's just a demo of what I am talking about.

Good luck.

(EDITED TO ADD IN MORE ENGLISH AND LESS GREGISH :P)


so if i add a semicolon to the end of each line it should compile?

LordGregGreg

2007-12-09 10:13:35

From: oliver1205
so if i add a semicolon to the end of each line it should compile?


generally, yes.

semi colons belong at the end of each statement. This is "normally" at the end of each line. But not always.

Do a search for… nevermind,.. here
http://www.srl-forums.com/forum/scar-script-official-p284739.html#post284739

Santa_Clause

2007-12-09 23:13:31

if(FindWall(x,y,5,40,35,60))then           //////////////////////// THIS LINE
begin
Mouse(x-20,y+15,5,5,True)
wait(200)
Flag;
end
end else
begin