SRL Archive - RS3 Help

SPS - Where am I functions?


Wu-Tang Clan

2014-01-24 16:21:47

I understand sps.getplayerpos(); and sps.debugplayerpos(); but is there a function that outputs which map you are using?
Basically my setup is in the fightcaves, and I have 2 different maps- FC_01 is in the lobby, FC_02 is in the fight cave. I want the script to be able to determine the position of the player in each map. When I do things like getplayer it notices the map I'm using and everything.
procedure WhereAreWe;
begin
WriteLn(SPS.getPlayerPos());
sps.debugPlayerPos();
//FC_02 = {X = 70, Y = 106}
//FC_O1 = {X = 98, Y = 110}
Writeln(sps.getName());
if sps.getName() = 'FC_01' then
begin
writeln('We are in FC_01');
end;
if sps.getName() = 'FC_02' then
begin
writeln('We are in FC_02');
end;
end;
This doesn't do anything
and all the WriteLn(); does is says 'sps' in the debug box…
So the question is, how do I get a function to output which map I'm using? I checked the include but didn't see anything.

The Mayor

2014-01-24 16:51:48

If I understand this correctly, you are trying to return your position on both maps at the same time? Why would you want to do that? and how can you be inside the cave and inside the lobby at the same time? The map you're using is obviously the last one you setup?

Ian

2014-01-24 17:01:55

If you want to find which map you are on you could always just put them both on one map and then use getplayerpos to find your position as you would normally.

The Mayor

2014-01-24 17:07:16

From: BMWxi
If you want to find which map you are on you could always just put them both on one map and then use getplayerpos to find your position as you would normally.


Which is what I did with GAO http://i.imgur.com/xNSHhmu.png

If the MM color is black or has another unique color in the cave you could just use:

minimap.getBlackBackground(): integer; or minimap.getColorPercent(color, tolerance: integer): extended;

to determine if you are in the cave.

Wu-Tang Clan

2014-01-24 17:22:47

From: The Mayor
Which is what I did with GAO http://i.imgur.com/xNSHhmu.png

If the MM color is black or has another unique color in the cave you could just use:

minimap.getBlackBackground(): integer; or minimap.getColorPercent(color, tolerance: integer): extended;

to determine if you are in the cave.

OO I'll definitely give that a try, thanks guys.

Olly

2014-01-24 17:32:21

TSPSArea.getName() just returns the name of the variable used… you can take advantage of having sps areas by using two different variables..


var
sps_inside, sps_outside: TSPSArea;

begin
sps_inside.init(..);
sps_outside.init(..);

writeln(sps_inside.getPlayerPos());
writeln(sps_outside.getPlayerPos());
end.