SRL Archive - OSR Help

[Error] (1:1): Variable Expected at line 0


noway123

2012-02-07 17:41:08

My Error:


[Error] (1:1): Variable Expected at line 0


My code:

[PHP]procedure DropAllEx;
var
Fish, i: Integer;
begin
if(not LoggedIn) then exit;
if(not InvCount > 26) then exit else
begin
Fish := DTMFromString('mlwAAAHicY2dgYLBlYmCwBGJnIPYGYicgtg ZiEyB+AZT/AMRvgfghEN8G4sdA/A6IZ02eDCSZsOL/DLgBIx4MBQB4Ngrv');
for i := 1 to 28 do
if(ExistsItemDTM(Fish, ItemCoords(i).x, ItemCoords(i).y)) then DropItem(i);
FreeDTM(Fish);
end;
end; [/PHP]

If i remove this code it works…

[PHP]for i := 1 to 28 do
if(ExistsItemDTM(Fish, ItemCoords(i).x, ItemCoords(i).y)) then DropItem(i);[/PHP]

I cant find my error. Can you help me :confused:.

Noway123

kevin33

2012-02-07 17:52:59

Is this the whole script? If so your problem I think lies in the fact that you do not have a program name. Dont take my word for it though. I have never encountered this error before. You also dont have the includes and what not.

laakerules

2012-02-07 17:59:31

If you posted the hole script in simba tags not php then we could help a lil more

noway123

2012-02-07 18:05:46

program test;
{.include SRL/SRL.scar}

procedure DropAllEx;
var
Fish, i: Integer;
begin
if(not LoggedIn) then exit;
if(not InvCount > 26) then exit else
begin
Fish := DTMFromString('mlwAAAHicY2dgYLBlYmCwBGJnIPYGYicgtgZiEyB+AZT/AMRvgfghEN8G4sdA/A6IZ02eDCSZsOL/DLgBIx4MBQB4Ngrv');
for i := 1 to 28 do
if(ExistsItemDTM(Fish, ItemCoords(i).x, ItemCoords(i).y)) then DropItem(i);
FreeDTM(Fish);
end;
end;

begin
DropAllEx;
end.

thx for your help. i hope you can find the error :P

edit: its just funny cause line 0 does not exist but it gives me an error there.

Kyle Undefined

2012-02-07 18:14:08

You were passing in values into the ExistsItemDTM function when you needed to pass variables. This compiles:


program test;
{$i srl/srl.simba}

procedure DropAllEx();
var
Fish, i, x, y: Integer;
begin
if(not(LoggedIn))then
exit;

if(not(InvCount > 26))then
exit
else
begin
Fish := DTMFromString('mlwAAAHicY2dgYLBlYmCwBGJnIPYGYicgtgZiEyB+AZT/AMRvgfghEN8G4sdA/A6IZ02eDCSZsOL/DLgBIx4MBQB4Ngrv');
for i := 1 to 28 do
if(ExistsItemDTM(Fish, x, y)) then
DropItem(i);
FreeDTM(Fish);
end;
end;

begin
SetupSRL();
DropAllEx();
end.

laakerules

2012-02-07 18:16:37

Haha just when I was looking at it and gonna say that Kyle ds better and posted it fixed! :p

Hope it's doing good for you! :)

noway123

2012-02-07 18:26:24

thank you. Iam used to Java thats probably why i made this mistake :P.
Just started to learn the basics :P
Thanks again.

laakerules

2012-02-07 20:31:41

Ya I was too, now I'm more used to simba! :) pascal

pigggy

2012-03-25 16:14:58

can someone help me? im getting the same problem but idk what a ExistsItemDTM is :(

m34tcode

2012-03-26 03:40:25

I always do the same thign he did with TPoints O.o

Example would be getMousePos(TP.x,TP.y) or findobj(TP.x,TP.y,other stufff…