SRL Archive - OSR Help

[SPS] Walking past doors.


Chris!

2013-01-19 03:44:10

Alright, I am unsure as how to go about doing this:

I'm at the Barbarian Outpost deposit box, I want to walk to the Willows but there is a door. I walk to the door and wish to detect if it is open or closed, and then continue walking (after opening the door if open).

Here is my walk to tree procedure.

Procedure OutpostWalkToTree;
var
OutpostToDoor, OutpostToTree: TPointArray;
begin
ClickNorth(SRL_Angle_High);
FFlag(3);
SPS_Setup(RUNESCAPE_SURFACE, ['']);
OutpostToDoor := [Point(1927, 2317), Point(1879, 2315)]; //Walks to door from bank
OutpostToTree := [Point(1879, 2315), Point(1863, 2314)]; //Walks from door to tree
SPS_WalkPath(OutpostToDoor);
if (FindDoor = True) then //FindDoor is my function for detecting the door itself
SPS_WalkPath(OutpostToTree);
while IsMoving do
Antiban
end;


Any help is welcomed.

-Chris!

KeepBotting

2013-01-19 10:44:32

if (FindDoor = True) then
begin
SPS_WalkPath(OutpostToTree);
while IsMoving do
Antiban
end;

Missing a begin right there?

doxin

2013-01-19 13:40:44

From: KeepBotting
if (FindDoor = True) then
begin
SPS_WalkPath(OutpostToTree);
while IsMoving do
Antiban
end;

Missing a begin right there?


i dont think he needs one there since there's only one line right?

i luffs yeww

2013-01-19 13:54:00

From: doxin
i dont think he needs one there since there's only one line right?


Correct.

EDIT:

And to be a bit relevant, here are some threads that showed up when I searched for "find open closed door":

http://villavu.com/forum/showthread.php?t=93020&highlight=find+open+closed+door
http://villavu.com/forum/showthread.php?t=88477&highlight=find+open+closed+door
http://villavu.com/forum/showthread.php?t=77410&highlight=find+open+closed+door
http://villavu.com/forum/showthread.php?t=77827&highlight=find+open+closed+door

Those should help.

doxin

2013-01-19 14:00:41

you could make a TPA of the door and check for the door uptext, or right click the door and click open. then on your find door function have it detect for door, open it if it's closed, then have it return true

DannyRS

2013-01-19 14:15:12

From: Chris!

Procedure OutpostWalkToTree;
var
OutpostToDoor, OutpostToTree: TPointArray;
begin
SPS_WalkPath(OutpostToTree);
while IsMoving do
Antiban
end;


I think

while IsMoving do
Antiban

Will not happen during the path, as SPS_WalkPath will hold you

KeepBotting

2013-01-19 14:54:58

Well then:

  while IsMoving do
Antiban;
end;

Needs a semicolon after Antiban.


As DannyRS said, this may not work at all, try using Flag or FFlag or something similar.

NKN

2013-01-19 15:00:17

From: KeepBotting
Well then:

  while IsMoving do
Antiban;
end;

Needs a semicolon after Antiban.


As DannyRS said, this may not work at all, try using Flag or FFlag or something similar.


1) semi-colon isn't needed.
2) SPS_WalkPath has its own FFLag functions, if it's only 1 point, use SPS_WalkToPos(), then add a While(IsMoving)

Chris!

2013-01-21 00:56:06

Thanks guys, got this sorted.