SRL Archive - OSR Help

Identifier Needed ...!!!????


sm0k3

2011-03-27 17:24:28

starting from line 57

Procedure WalkToSnape;
begin
if SPS_WalkPath(MainPath3) then
loc:='Snape';
Writeln('Walked To SnapeGrass');
end;

ends up with

[Error] (58:1): Identifier expected at line 57
Compiling failed.

i dont understand
what identifier is missing??

**BANNED The Man

2011-03-27 17:30:05

From: sm0k3
starting from line 57

Procedure WalkToSnape;
begin
if SPS_WalkPath(MainPath3) then
begin
loc := 'Snape';
Writeln('Walked To SnapeGrass');
end;
end;

ends up with

[Error] (58:1): Identifier expected at line 57
Compiling failed.

i dont understand
what identifier is missing??


That work?

sm0k3

2011-03-27 17:31:55

huh .. i dont get wat you mean ..

its just part of the script but thats whats giving me probs


EDIT

oh i see .. lol
il try it now

Edit 2

No same thing

Sex

2011-03-27 17:36:42

You need to post even more. What he posted shows a complete procedure that has nothing wrong with it :p.

sm0k3

2011-03-27 17:40:43

program SnapeRunner;
//{$DEFINE SMART} //Uncomment for SMART
{.include SRL/SRL.scar}
{.i SRL/SRL/core/SPS/SPS.simba}

const

sUser = '';//Stats username
sPass = '';//Stats Password
Debug = True; //Print Debug Info To Simba Leave on for beta
SMARTstats = True; // set false if you dont want Stats Shown in SMART
Version = 'Beta'; // Scripts Version Name


var

MainPath1, MainPath2, MainPath3r, MainPath2r, MainPath3: TPointArray; // Main Path Between snapegrass and Bank TPointArray
Movestart: TPointArray; // Path From Tele poin in Fallador
Picked, Runs, earns, antibans: Integer;
loc: string;
procedure WalkToStart;
begin
if SPS_WalkPath(movestart) then
Writeln('Walked To Starting Position');
end;
Procedure WalkToWall;
begin
if (loc = 'Bank') then
begin
if SPS_WalkPath(MainPath1) then
loc:='Wall';
Writeln('Walked To Wall');
end;
if (loc = 'Gate') then
begin
if SPS_WalkPath(MainPath2r) then
loc:='Wall';
Writeln('Walked To Wall');
end
end;
Procedure WalkToGate;
begin
begin
if (loc = 'Wall') then
begin
if SPS_WalkPath(MainPath2) then
loc:='Gate';
Writeln('Walked To Gate');
end;
if (loc = 'Snape') then
begin
if SPS_WalkPath(MainPath3r) then
loc:='Gate';
Writeln('Walked To Gate');
end
end;
Procedure WalkToSnape;
begin
if SPS_WalkPath(MainPath3) then
begin
loc:= 'Snape';
Writeln('Walked To SnapeGrass');
end;
end;
Procedure WalkToBank;
begin
if SPS_WalkPath(MainPath1r) then
Writeln('Walked To Bank');
loc:='Bank';
end;
Procedure OverWall;
begin
FindObjectEx(x, y, ['Crumbling', 'all'], [9939631], 25, 50, MSX1, MSY1, MSX2, MSY2);
Mouse(x, y, 2, 2, true);
end;
begin
SetupSRL;
SPS_Areas := ['8_3', '8_4'];

Movestart:=[Point(3484, 1576),Point(3434, 1579),Point(3405, 1603)];

MainPath1:=[Point(3378, 1644),Point(3371, 1678)];

MainPath2:=[Point(3358, 1680),Point(3359, 1697),Point(3359, 1724),
Point(3360, 1733),Point(3360, 1746),Point(3359, 1768),
Point(3360, 1978),Point(3356, 1793),Point(3356, 1809),
Point(3357, 1821)];

MainPath3:=[Point(3359, 1840),Point(3368, 1857),Point(3361, 1809),
Point(3374, 1898),Point(3393, 1916),Point(3404, 1927),
Point(3404, 1956),Point(3403, 1985),Point(3398, 2007),
Point(3367, 2031),Point(3352, 2044),Point(3322, 2044),
Point(3299, 2028),Point(3286, 2011),Point(3268, 1985),
Point(3258, 1960),Point(3255, 1939),Point(3246, 1911)];
MainPath1r:=InvertTPA(MainPath1);
MainPath2r:=InvertTPA(MainPath2);
MainPath3r:=InvertTPA(MainPath3);
WalkToStart;
loc:= 'Bank';
WalkToWall;
OverWall;
WalkToGate;
end.
here you go .. unfinished lol i may have messed it up a bit whil trying to sort it out . also
the MainPath3r:=InvertTPA(MainPath3); is there because
if SPS_WalkPath(InvertTPA(MainPath3))
ends in a Type missmatch error or somthing

Sex

2011-03-27 17:41:22

Get your stats password out of there.

I'll take a look.

Edit: I reformatted and I don't have SRL and when I try to download it (using the extension) it fails and can't untar it…

Um, what this error basically means is that your begin and ends are mismatched.

Try making sure you have one end for every begin. Also make sure each end has a semicolon after it save the last end in the program.

sm0k3

2011-03-27 18:05:00

Ah fixed but now i get

MainPath1r:=InvertTPA(MainPath1);

[Error] (95:33): Type mismatch at line 94
Compiling failed.

if i change to


if SPS_WalkPath(invertTPA(MainPath2)) then
Begin

it tells me thats a type mismatch
mainpath2 is a TpointArray ..Check Above
i thought invertTPA was how to reverse the path for SPS

Sex

2011-03-27 18:21:47

Iirc, InvertTPA is a procedure and not a function. Just do InvertTPA(MainPath1);

sm0k3

2011-03-27 18:28:56

right now ive got


Procedure WalkToWall;
begin
if (loc = 'Bank') then
begin
if SPS_WalkPath(MainPath1) then
loc:='Wall';
Writeln('Walked To Wall');
end;
if (loc = 'Gate') then
begin
if invertTPA(MainPath2) then
loc:='Wall';
Writeln('Walked To Wall');
end
end;

still saying the invertTPA line is a type mismatch

here's they array


MainPath2:=[Point(3358, 1680),Point(3359, 1697),Point(3359, 1724),
Point(3360, 1733),Point(3360, 1746),Point(3359, 1768),
Point(3360, 1978),Point(3356, 1793),Point(3356, 1809),
Point(3357, 1821)];

Sex

2011-03-27 19:03:31

Since InvertTPA is not a function you cannot use it in a if statement like that…um I don't know what you're doing that for as it would return true always if it were a function.

sm0k3

2011-03-27 19:24:06

marpis said
If you want to run the same path to the other end, you can reverse the path by using InvertTPA:
InvertTPA(MyPath);

so im trying to run the path backwards

the way i understood it was if .

if SPS_WalkPath(movestart) then
Writeln('Walked To Starting Position');

walked the path then

if SPS_WalkPath(InvertTPA(movestart)) then
Writeln('Walked Back From Starting Position');

This would walk Back allong the same path

EDIT: Oh i get it i have to use invertTPA before the if and then again after SPS_WalKPath to set it foward again :duh:

Sex

2011-03-27 23:46:12

InvertTPA is a procedure not a function meaning it does NOT return a result. All it does is change the variable in it to the inverted path. So:
 InvertTPA(MoveStart);
if SPS_WalkPath(MoveStart) then
Writeln('blah blah blah '); //etc...

Dgby714

2011-03-28 01:03:28

function InvertTPAWrap(TPA: TPointArray): TPointArray;
begin
Result := TPA;
InvertTPA(Result);
end;

Sex

2011-03-28 01:14:08

Yeah you could always just make a wrapper for it and use that :p. I don't know why the normal one isn't a function..

sm0k3

2011-03-28 01:26:59

Right got that compleatly sorted.

ive been looking into SPS

it may just be me but when walking the EXACT same path
it still manages to wander of in a compleatly different direction < very rarly though