SRL Archive - OSR Help

Script won't walk


SomeGuyFromHere

2012-12-26 20:38:41

Hey,

so after getting two things done (see my other thread), which took hours but btw feels great now that I got understand how several procedures work :spot: I'm back with a different problem: My second walking procedure isn't working.

The first one does its job more or less well, but the second one just isn't doing anything except turning the screen, not even an attempt to walk can be seen!

I'm using SPS_Path_Generator.
The path which works looks like this (note: these are not the exact paths but pretty close):

Code looks like this:
Procedure WalkToGate;

var
myPath:TPointArray;

begin
SPS_Setup(RUNESCAPE_SURFACE,['7_5', '7_6', '7_7', '8_5', '8_6', '8_7']);//SPS Areas
myPath := [Point(3401, 2536), Point(3432, 2547), Point(3426, 2593), Point(3412, 2627), Point(3406, 2657), Point(3406, 2692), Point(3427, 2716), Point(3470, 2722), Point(3502, 2725), Point(3525, 2761), Point(3528, 2800), Point(3523, 2836), Point(3529, 2881), Point(3569, 2892)];
SPS_WalkPath(myPath);
Writeln('Walked to the gate. Waiting for 4 seconds.');
Wait(4000);
end;


The second, broken one looks about like this:


Code:

Procedure FromGateToLoadstone;

var
myPath:TPointArray;

begin
Writeln('Starting to walk to the second lodestone');
SPS_Setup(RUNESCAPE_SURFACE,['8_6', '8_7', '9_6', '9_7']);//SPS Areas
myPath := [Point(3621, 2893), Point(3631, 2930), Point(3647, 2964), Point(3673, 2983), Point(3711, 3022)];
SPS_WalkPath(myPath);
Wait(2000);
end;

Redid it several times, won't work. Help please? :redface:

Gucci

2012-12-26 20:43:16

Is there a procedure in-between them, like for opening the gate?

Must just not be able to find the points, do you have the newest maps and such?

DannyRS

2012-12-26 20:44:10

try putting points closer / more points

and just FYI you cant call
SPS_Setup(RUNESCAPE_SURFACE,['8_6', '8_7', '9_6', '9_7']);//SPS Areas

more than once in the script, for example:


Program walkingscript;

var
GateToLoadstonePath :TPointArray;

Procedure WalkFromGateToLoadstone;
begin
Writeln('Starting to walk to the second lodestone');
SPS_WalkPath(GateToLoadstonePath);
Wait(2000);
end;

Procedure setglobals;
begin
SPS_Setup(RUNESCAPE_SURFACE,['8_6', '8_7', '9_6', '9_7']);//SPS Areas
GateToLoadstonePath := [Point(3621, 2893), Point(3631, 2930), Point(3647, 2964), Point(3673, 2983), Point(3711, 3022)];
end;

begin
setglobals;
WalkFromGateToLoadstone;
end.

SomeGuyFromHere

2012-12-26 21:31:13

Is there a procedure in-between them, like for opening the gate?

There are, but for testing they're currently commented out:
WalkToGate;
TurnToMakeGateOpenScriptWork;
OpenGate;
FromGateToLoadstone; //this is the second walking script
do you have the newest maps and such?

SPS is up2date.


and just FYI you cant call

[CODE]SPS_Setup(RUNESCAPE_SURFACE,['8_6', '8_7', '9_6', '9_7']);//SPS Areas

more than once in the script, for example:

This is actually what I did. Could this be a problem? Just redid the code as you suggested:

Program WalkFromStartToDwarven;

{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

var
WalkToGatePath:TPointArray;
GateToLoadstonePath :TPointArray;

[B](...)[/B]

Procedure WalkToGate;

begin
SPS_WalkPath(WalkToGatePath);
Writeln('Walked to the gate. Waiting for 4 seconds.');
Wait(4000);
end;

[B](...)[/B]


Procedure FromGateToLoadstone;

begin
Writeln('Starting to walk to the second lodestone');
SPS_WalkPath(GateToLoadstonePath);
Wait(2000);
end;


Procedure setglobals;
begin
SPS_Setup(RUNESCAPE_SURFACE,['7_5', '7_6', '7_7', '8_5', '8_6', '8_7', '9_6', '9_7']);//SPS Areas
GateToLoadstonePath := [Point(3621, 2893), Point(3631, 2930), Point(3647, 2964), Point(3673, 2983), Point(3711, 3022)];
WalkToGatePath := [Point(3401, 2536), Point(3432, 2547), Point(3426, 2593), Point(3412, 2627), Point(3406, 2657), Point(3406, 2692), Point(3427, 2716), Point(3470, 2722), Point(3502, 2725), Point(3525, 2761), Point(3528, 2800), Point(3523, 2836), Point(3529, 2881), Point(3569, 2892)];


end;


begin
SRL_SixHourFix := True;
SetupSRL;
StartLogin;
setglobals;
//WalkToGate;
//TurnToMakeGateOpenScriptWork;
//OpenGate;
FromGateToLoadstone;

end.

The second walking script still doesn't do anything though, apart from turning the screen and giving out the Writeln of course.

DannyRS

2012-12-26 21:37:29

From: SomeGuyFromHere

The second walking script still doesn't do anything though, apart from turning the screen and giving out the Writeln of course.


try re-doing points closer together? and take a look at

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

that might still be working

Gucci

2012-12-26 22:05:24

Try this path:

FromGateToLodestone := [Point(3581,2842),Point(3588,2882),Point(3603,2915),Point(3634,2935),Point(3676,2944)];

And judging from the difference of your path and mine I'm thinking it can't find the points you've set

___

2012-12-26 22:57:44

If you are walking to the lodestone, why not just use a lodestone teleport?

Gucci

2012-12-26 23:17:39

From: ___
If you are walking to the lodestone, why not just use a lodestone teleport?


Lol can't believe no one else mentioned that ;)

Yeah you could teleport using:

LodestoneTeleport('Falador');

SomeGuyFromHere

2012-12-27 08:11:09

Part of the job of the script is to activate lodestones, on the way to the dwarven mine. You will see when the whole thing is finished :)

Trying the corrected path now, will report back shortly.

EDIT: No movement, and this time I made the points so close to each other it's ridiculous. Really out of ideas right now.

It's not the only path that doesn't work: For example I created another simple script that just walks around a little in the area before the gate:

SPS_Setup(RUNESCAPE_SURFACE,['7_6', '7_7', '8_6', '8_7']);//SPS Areas
myPath := [Point(3576, 2894), Point(3564, 2891), Point(3545, 2888), Point(3530, 2880), Point(3527, 2853), Point(3527, 2832), Point(3528, 2812), Point(3529, 2797)]
SPS_WalkPath(myPath);
Wait(2000);

A similar path worked fine before, now it doesn't do anything.
The "walk to path" one works fine though.

J J

2012-12-27 08:57:33

From: Gucci
Lol can't believe no one else mentioned that ;)

Yeah you could teleport using:

LodestoneTeleport('Falador');


Pretty sure that does just click on the falador lodestone in the lodestone screen.
Watch out for people closing the Taverley gate.

SomeGuyFromHere

2012-12-28 16:29:25

OK, I'm pretty sure it has nothing to do with the path since, as I wrote above, the second walking procedure doesn't do anything, no matter if the walking points are before or after the gate. In fact when I use the exact same path in a different script it works great, but not in the one I'm working at.

Here's the whole thing as it looks right now. The path used in GateToLodestonePath is not walking you to any lodestone but nethermind that, I just want it to do anything except turning…

Could you guys scan through it and tell me what I did wrong?

Program WalkFromStartToDwarven;

{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

var
WalkToGatePath:TPointArray;
GateToLodestonePath :TPointArray;


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '********'; // Player username
Pass := '********'; // Player password
BoxRewards := ['XP', 'ostume', 'mote', 'oins', 'une', 'ssence'];
LampSkill := Skill_Mining;
Active := True;
end;
end;



Procedure StartLogin;

begin
ClearDebug;
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
DeclarePlayers;
LoginPlayer;

end;

Procedure WalkToGate;

begin
SPS_WalkPath(WalkToGatePath);
Writeln('Walked to the gate. Waiting for 4 seconds.');
Wait(4000);
end;

Procedure OpenGate;

var
x, y: Integer;

begin
if FindObjCustom(x, y, ['Open Gate'], [3622483, 3094077], 3)
then
begin
Writeln('Gate found. Clicking.');
ClickMouse(x, y, mouse_Left);
Writeln('OK, clicked on the gate. Waiting for 12 seconds for the process to finish...');
Wait(12000);
end
else Writeln('Gate not found, is it already open? Checking...');
if FindObjCustom(x, y, ['Close Gate'], [3622483, 3094077], 3)
then Writeln('Gate is already open! Continuing with walking.')
else
Writeln('Something might have gone wrong, no gate in sight, neither open or closed. Teleporting back to Burthorpe.')
LodestoneTeleport('Burthorpe');
end;




Procedure TurnToMakeGateOpenScriptWork;
begin
//ClickMouse(260, 188, mouse_Left);
KeyDown(37);
wait(1000);
KeyUp(37);
wait(3000);
end;




Procedure FromGateToLodestone;

begin
Writeln('Starting to walk to the second lodestone');
SPS_WalkPath(GateToLodestonePath);
Wait(2000);
end;


Procedure setglobals;
begin

SPS_Setup(RUNESCAPE_SURFACE,['7_5', '7_6', '7_7', '8_5', '8_6', '8_7', '9_6', '9_7']);//SPS Areas
GateToLodestonePath := [Point(3568, 2889), Point(3540, 2890), Point(3531, 2870), Point(3529, 2842), Point(3529, 2803), Point(3529, 2768), Point(3523, 2727), Point(3518, 2690), Point(3506, 2657), Point(3505, 2624), Point(3517, 2600), Point(3512, 2563), Point(3518, 2522), Point(3476, 2522), Point(3435, 2533), Point(3393, 2539), Point(3386, 2505)];
WalkToGatePath := [Point(3422, 2482), Point(3435, 2519), Point(3431, 2563), Point(3419, 2606), Point(3404, 2653), Point(3409, 2695), Point(3444, 2731), Point(3483, 2730), Point(3526, 2778), Point(3527, 2814), Point(3527, 2856), Point(3531, 2891), Point(3573, 2889)];

end;


begin
SRL_SixHourFix := True;
SetupSRL;
StartLogin;
setglobals;
WalkToGate;
TurnToMakeGateOpenScriptWork;
OpenGate;
FromGateToLodestone;

end.

DannyRS

2012-12-28 16:43:40

what part is not working

and can you post whole script

{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

var
WalkToGatePath:TPointArray;
GateToLodestonePath :TPointArray;


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '********'; // Player username
Pass := '********'; // Player password
BoxRewards := ['XP', 'ostume', 'mote', 'oins', 'une', 'ssence'];
LampSkill := Skill_Mining;
Active := True;
end;
end;



Procedure StartLogin;

begin
ClearDebug;
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
DeclarePlayers;
LoginPlayer;

end;

Procedure WalkToGate;

begin
SPS_WalkPath(WalkToGatePath);
Writeln('Walked to the gate. Waiting for 4 seconds.');
Wait(4000);
end;

Procedure OpenGate;
var
x, y: Integer;
begin
if FindObjCustom(x, y, ['pen'], [3622483, 3094077], 3)
then
begin
Writeln('Gate found. Clicking.');
ClickMouse(x, y, mouse_Left);
Writeln('OK, clicked on the gate. Waiting for 12 seconds for the process to finish...');
Wait(12000);
end else
Writeln('Gate not found, is it already open? Checking...');

if FindObjCustom(x, y, ['lose'], [3622483, 3094077], 3) then
Writeln('Gate is already open! Continuing with walking.')
else
begin // needed because two lines or more after
Writeln('Something might have gone wrong, no gate in sight, neither open or closed. Teleporting back to Burthorpe.')
LodestoneTeleport('Burthorpe');
end; // needed
end;

begin

end.

SomeGuyFromHere

2012-12-28 19:44:10

Hey DannyRS,

as I wrote above the problem is within the second walking script (FromGateToLodestone), and I suspect that it might be some error in my scripting.
The rest of the script works fine more or less.

and can you post whole script

It is the whole script!

Also: Could the whole thing be a problem with the SPS maps? They're up2date according to Simba, but look at this comparison between the SPS map and an actual screenshot from Runescape:


Gucci

2012-12-28 20:12:02

I don't think the new maps have been pushed through Simba, get it all from here

SomeGuyFromHere

2012-12-29 10:57:27

Even with the new SPS maps stuff still looks different. Just have a look at 8_7 in your SPS image folder (the region near the dwarven mine), the objects are completely misplaced compared to the actual map, no wonder SPS can't find anything!

Or is the map dependant on the server/world you use?

The Killer

2012-12-29 11:20:30

From: SomeGuyFromHere
Even with the new SPS maps stuff still looks different. Just have a look at 8_7 in your SPS image folder (the region near the dwarven mine), the objects are completely misplaced compared to the actual map, no wonder SPS can't find anything!

Or is the map dependant on the server/world you use?


just make a custom map.
and the map isn't dependant on the world you use.
edit: if you don't know how check out google's tut here

Gucci

2012-12-29 11:46:45

Or use radial walk, it would work really well there

SomeGuyFromHere

2012-12-30 07:36:54

Used RadicalWalk, works like a charm - Thanks everyone!
:spot::spot::spot::spot: