SRL Archive - OSR Help

Oldschool walking script help


downwindchubs

2013-06-02 10:53:12

ok so I have written a walking script to walk from lumbridge to port sarim (yes it is very messy and not the best way to do it but it doesnt matter as long as it works) but every time I try to run it I get an "compiling failed, unexpected end of file" error.

http://pastebin.com/trkFUGxg

thankyou



this is the error:

[Hint] C:\Simba\Includes\SPS/sps-osr.simba(480:3): Variable 'Z' never used at line 479
[Hint] C:\Simba\Includes\SPS/sps-osr.simba(482:3): Variable 'DEGREEFIX' never used at line 481
[Hint] C:\Simba\Includes\SPS/sps-osr.simba(483:3): Variable 'FINDPOINT' never used at line 482
[Error] (34590:1): Unexpected end of file at line 34589
Compiling failed.

EngageTheRage

2013-06-02 11:00:24

ok so to get it to compile, remove the
 procedure WalkAroundGE;

and instead as the first line of the script put:
program WalkAroundGE;

and at the end of the script change:
end;
to
end.

now it will compile. however you have setup anything so there are no players defined, no smart client spawned and srl is not setup. So it wont actually do anything :/

i havent tested it out, but i have put it in my default script as a procedure and then called it. this should load-up/connect-to SMART login (if you enter your details) and then carry out your procedure :)


program TestScript;
{$DEFINE SMART8}
{$i SRL-OSR/Srl.simba}
{$I SPS/sps-osr.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := TRUE;
end;

procedure SetupSmartClient;
begin
SMART_FixSpeed := True;
ClearDebug;
SetupSRL;
ActivateClient;
DeclarePlayers;
WriteLn('players declared ...');
LoginPlayer;
WriteLn('logged in.');
end;

procedure WalkAroundGE;
var
First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth, Eleventh, twe, thir, fourt, fitht, sixt, eighte, ninete, twent, tone, ttwo, tthree, tfour, tfive :TPoint;
begin
SPS_Setup(RUNESCAPE_SURFACE, ['10_5', '10_6', '10_7', '11_5', '11_6', '11_7']);
First := Point(4686, 3730);
Second := Point(4735, 3696);
Third := Point(4687, 3648);
Fourth := Point(4669, 3584);
Fifth := Point(4661, 3518);
Sixth := Point(4627, 3484);
Seventh := Point(4561, 3471);
Eighth := Point(4492, 3457);
Ninth := Point(4426, 3436);
Tenth := Point(4360, 3422);
Eleventh := Point(4294, 3404);
twe := Point(4229, 3415);
thir := Point(4162, 3434);
fourt := Point(4100, 3455);
fitht := Point(4052, 3497);
sixt := Point(3993, 3531);
eighte := Point(3937, 3568);
ninete := Point(3874, 3587);
twent := Point(3904, 3644);
tone := Point(3904, 3709);
ttwo := Point(3906, 3771);
tthree := Point(3918, 3830);
tfour := Point(3946, 3830);
tfive := Point(3957, 3830);


SPS_WalkToPos(First);
SPS_WalkToPos(Second);
SPS_WalkToPos(Third);
SPS_WalkToPos(Fourth);
SPS_WalkToPos(Fifth);
SPS_WalkToPos(Sixth);
SPS_WalkToPos(Seventh);
SPS_WalkToPos(Eighth);
SPS_WalkToPos(Ninth);
SPS_WalkToPos(Tenth);
SPS_WalkToPos(eleventh);
SPS_WalkToPos(twe);
SPS_WalkToPos(thir);
SPS_WalkToPos(fourt);
SPS_WalkToPos(fitht);
SPS_WalkToPos(sixt);
SPS_WalkToPos(eighte);
SPS_WalkToPos(ninete);
SPS_WalkToPos(twent);
SPS_WalkToPos(tone);
SPS_WalkToPos(ttwo);
SPS_WalkToPos(tthree);
SPS_WalkToPos(tfour);
SPS_WalkToPos(tfive);
SetRun(True)
end;

begin
SetupSmartClient;

WalkAroundGE;

WriteLn('Script Complete!');
end.

Sjoe

2013-06-02 11:04:04

U could try BlindWalk instead of WalkToPos

Here's a tut: http://villavu.com/forum/showthread.php?t=99716&highlight=

downwindchubs

2013-06-02 11:06:18

From: EngageTheRage
ok so to get it to compile, remove the
 procedure WalkAroundGE;

and instead as the first line of the script put:
program WalkAroundGE;

and at the end of the script change:
end;
to
end.

now it will compile. however you have setup anything so there are no players defined, no smart client spawned and srl is not setup. So it wont actually do anything :/

i havent tested it out, but i have put it in my default script as a procedure and then called it. this should load-up/connect-to SMART login (if you enter your details) and then carry out your procedure :)


program TestScript;
{$DEFINE SMART8}
{$i SRL-OSR/Srl.simba}
{$I SPS/sps-osr.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := TRUE;
end;

procedure SetupSmartClient;
begin
SMART_FixSpeed := True;
ClearDebug;
SetupSRL;
ActivateClient;
DeclarePlayers;
WriteLn('players declared ...');
LoginPlayer;
WriteLn('logged in.');
end;

procedure WalkAroundGE;
var
First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth, Eleventh, twe, thir, fourt, fitht, sixt, eighte, ninete, twent, tone, ttwo, tthree, tfour, tfive :TPoint;
begin
SPS_Setup(RUNESCAPE_SURFACE, ['10_5', '10_6', '10_7', '11_5', '11_6', '11_7']);
First := Point(4686, 3730);
Second := Point(4735, 3696);
Third := Point(4687, 3648);
Fourth := Point(4669, 3584);
Fifth := Point(4661, 3518);
Sixth := Point(4627, 3484);
Seventh := Point(4561, 3471);
Eighth := Point(4492, 3457);
Ninth := Point(4426, 3436);
Tenth := Point(4360, 3422);
Eleventh := Point(4294, 3404);
twe := Point(4229, 3415);
thir := Point(4162, 3434);
fourt := Point(4100, 3455);
fitht := Point(4052, 3497);
sixt := Point(3993, 3531);
eighte := Point(3937, 3568);
ninete := Point(3874, 3587);
twent := Point(3904, 3644);
tone := Point(3904, 3709);
ttwo := Point(3906, 3771);
tthree := Point(3918, 3830);
tfour := Point(3946, 3830);
tfive := Point(3957, 3830);


SPS_WalkToPos(First);
SPS_WalkToPos(Second);
SPS_WalkToPos(Third);
SPS_WalkToPos(Fourth);
SPS_WalkToPos(Fifth);
SPS_WalkToPos(Sixth);
SPS_WalkToPos(Seventh);
SPS_WalkToPos(Eighth);
SPS_WalkToPos(Ninth);
SPS_WalkToPos(Tenth);
SPS_WalkToPos(eleventh);
SPS_WalkToPos(twe);
SPS_WalkToPos(thir);
SPS_WalkToPos(fourt);
SPS_WalkToPos(fitht);
SPS_WalkToPos(sixt);
SPS_WalkToPos(eighte);
SPS_WalkToPos(ninete);
SPS_WalkToPos(twent);
SPS_WalkToPos(tone);
SPS_WalkToPos(ttwo);
SPS_WalkToPos(tthree);
SPS_WalkToPos(tfour);
SPS_WalkToPos(tfive);
SetRun(True)
end;

begin
SetupSmartClient;

WalkAroundGE;

WriteLn('Script Complete!');
end.


ok thankyou man that got it working :)

downwindchubs

2013-06-02 11:10:22

From: Sjoe
U could try BlindWalk instead of WalkToPos

Here's a tut: http://villavu.com/forum/showthread.php?t=99716&highlight=


Im not sure what that is sorry, haha im a complete newbie to scripting

downwindchubs

2013-06-02 11:12:00

Ok now it logs in fine but just stands there and doesn't do anything :/

Sjoe

2013-06-02 11:16:25

From: downwindchubs
Ok now it logs in fine but just stands there and doesn't do anything :/


See what SPS_GetMyPos returns. or call SPS_Debug := True; in your mainloop.

If your points return Point(1-,1-) then the map isn't working

downwindchubs

2013-06-02 11:20:57

From: Sjoe
See what SPS_GetMyPos returns. or call SPS_Debug := True; in your mainloop.

If your points return Point(1-,1-) then the map isn't working

How do I do this again? sorry :L

Sjoe

2013-06-02 11:26:26

From: downwindchubs
How do I do this again? sorry :L


Read these tutorials to get a better understanding of sps(skip the making a map part)

http://villavu.com/forum/showthread.php?t=81109
http://villavu.com/forum/showthread.php?t=84360

downwindchubs

2013-06-02 11:28:51

From: Sjoe
Read these tutorials to get a better understanding of sps(skip the making a map part)

http://villavu.com/forum/showthread.php?t=81109
http://villavu.com/forum/showthread.php?t=84360


okayy thanks