SRL Archive - OSR Help

SPS get current location?


ifrootloops

2012-02-20 16:31:06

is there any way that SPS can retrieve my current location?

EDIT: I can't figure out how to use SPS_GetMyPos()
HELP please!

PatDuffy

2012-02-20 16:33:00

SPS_GetMyPos

lilcmp1

2012-02-20 16:34:01

Yup SPS_GetMyPos()


Var
MyPos: Tpoint;

Begin
MyPos:= Sps_GetMyPos()
End.


Grr Ninja'd

ifrootloops

2012-02-20 16:52:51

thanks guys : )

now to put that into an if statement and correct my position if needs be ;)

ifrootloops

2012-02-20 18:57:43

can someone please show me how to use this?

I'm having trouble and my procedure fails over time

lilcmp1

2012-02-20 19:26:30

I thought that might happen. Are you trying to check where you are? When changing fishing spots in one of my scripts I use this;

writeln('moving');
MyPos := SPS_GetMyPos();
First := Point(4528, 3561);
if ((myPos.y) < 3585) AND (((mypos.y) > 3555)) then
begin
Writeln('walking to second spot');
SPS_WalkToPos(Point(4509, 3599));
end else
Begin
Writeln('Walking to first spot');
SPS_WalkToPos(First);
End;
This checks if my y position is in a certain range and if it is move to the other spot. You could also you mypos.x to check your x number.

Or is your question in reference to setting up SPS? Might show your script if this doesn't help.

ifrootloops

2012-02-20 20:28:44

Cool Stuff. I'm just adding some polished touches to my fully operational Ape Atoll Agility script. (75+ agility necessary - doesn't support failing obs)

I'm using SPS because the public script kept breaking on me. But a couple of times it would fail on the clicking.

So to speed my bot up; I was hoping to test the location of my character - in two instances - before continuing with the agility course, making sure that the character is appropriately located.

here are the procedures for the two walks:


procedure walkToStone;
begin
writeln('Moving To Stone');
SPS_Setup(RUNESCAPE_SURFACE, ['7_14','6_14','8_14','7_13','6_13']);
toStone := Point(2854, 5724);
SPS_WalkToPos(toStone);
end;

and

procedure moveToSwing;
begin
writeln('Moved To Swing');
SPS_Setup(RUNESCAPE_SURFACE, ['7_14','6_14','8_14','7_13','6_13']);
toSwing := Point(2850, 5756);
SPS_WalkToPos(toSwing);
end;

I've cleaned up some of the antibans and wait periods to make it easier to read.

My concern is ensure that my character is on the correct tile before continuing the course, because a few times it misclicked.

ie: If player position is not what it should be, repeat the walking procedure.
if player position is where it should be, continue with script.

lilcmp1

2012-02-20 23:40:43


procedure moveToSwing;
begin
Repeat
writeln('Moved To Swing');
SPS_Setup(RUNESCAPE_SURFACE, ['7_14','6_14','8_14','7_13','6_13']);
toSwing := Point(2850, 5756);
SPS_WalkToPos(toSwing);

MyPos:= SPS_GetMyPos()

Until (MyPos.x=2850) AND (MyPos.y=5756)
end;

Well this might work but it depends how well SPS works at ape atoll. It works better in some areas than others detecting your exact point. Also sometimes you pick a point you can't exactly get to (like mountain side you can't walk to but it still takes you to a general spot) That's why I used a y between two areas to get a general idea.