SRL Archive - RS3 Help

SPS mapping


Clutch

2015-03-11 01:40:48

– WARNING: .getPlayerPos(): Didn't find enough matches accurately calc your postion
– .getPlayerPos(): result = {X = -1, Y = -1}, took 421 ms

I am getting the above error. Basically I've spent 2 days getting ideas from others and doing research yet still am unable to get this to work. When I call on a single map it loads and works perfectly. When I try doing a 2nd or even 3rd map is when I start having issues. It's not updating the playerPos. It's comparing my old maps last point ex. 322,400 to my next maps first point 322,400. In this scenario it will run although 90% of the time it runs incorrectly or I just got lucky with the way it had been setup. Normally though my first point is something like 70,150, now it's the same location on the minimap BUT the player position isn't getting updated for that new map. This probably makes no sense, so i'll edit in what I wrote on the other thread where I was getting help.

Okay guys, let me explain again what is occuring. Basically using SPS does not work with using multiple maps. It tries to calc my player position based on the currently loaded map, in the example below you'll see that my playerpos at the end is 150,327. It then loads a NEW map and the starting position on the new map (which is directly on top of the ending position on the map) is picking my playerpos but it's detecting that the coordinates for that map are 193,153 not 150,327 even though its the same spot (I understand it's slightly different but not THAT different). That being said if you don't understand I encourage you to test it for yourself, you simply need to create your own map and copy the array path.

Notice the area is almost identical (center is close to identical as well obviously) note the positions in red though!
[ATTACH=CONFIG]25264[/ATTACH]

procedure Taverly2;
var
WTL2: TPointArray;
Taverly2: TSPSArea;
begin;
Taverly2.setup('WTL2',RUNESCAPE_OTHER,3,150,0.65); //WTL2 map
WTL2 := [Point(200, 133), Point(202, 166), Point(196, 217), Point(196, 262), Point(176, 287), Point(172, 298), Point(151, 316), Point(150, 327)];
if Taverly2.walkPath(WTL2) then
begin
wait (random(300,600));
minimap.waitPlayerMoving();
wait (random(300,600));
end
else
writeLn ('Failed to walk');
end;

procedure ActivateTaverly;
var
x, y, i: integer;
begin
if not isLoggedIn() then
exit
else
mainscreen.findObject(x, y, 5660509, 1, colorSetting(2, 1.86, 0.98), mainscreen.playerPoint, 20, 20, 1, ['averly', 'lodes'], MOUSE_LEFT);
wait(randomRange(7000, 10000));
mouse(point(288,211),MOUSE_LEFT);
end;

procedure Falador;
var
WTFalador: TPointArray;
Falador: TSPSArea;
begin;
Falador.setup('WTFalador',RUNESCAPE_OTHER,3,150,0.65);
WTFalador := [Point(193, 153), Point(214, 198), Point(215, 244), Point(238, 255), Point(270, 265), Point(295, 248), Point(332, 227), Point(353, 212), Point(361, 177)];
if Falador.walkPath(WTFalador) then
begin
wait (random(300,600));
minimap.waitPlayerMoving();
wait (random(300,600));
end
else
writeLn ('Failed to walk');
end;
Begin;
clearDebug();
smartEnableDrawing := true;
setupSRL();
if isloggedin() then
begin;
//lodestoneSetup;
//Taverly1;
Taverly2;
//ActivateTaverly;
Falador;
end
else
begin
createPlayer;
SkipTutorial;
interfaceSetup;
lodestoneSetup;
Taverly1;
Taverly2;
ActivateTaverly;
Falador;

end;
end.

Edit 3: As a workaround I suppose I could make my maps extremely small and have a single map for each point to point interaction, albeit that's going to be 600 maps (probably not close but you get the point) and alot of effort. Any other ideas/workarounds? I think I could do as @Incurable; did and use a single huge map (he did it or I read a thread/post on it) and just have 2 second wait times which if that's the best route to take then so be it.

Edit 4: I have a crazy idea (currently testing failed miserably) but due to the way that it is interacting I could in theory have it go from top to bottom of the map I load, then rotate my next map so that my beginning position starts at my last ending position (for the way SPS sees it (ex. Top of Map A. ends at the bottom, Map B. Begins at the bottom and the path goes to the TOP)) although assuming this works it'll be a bit annoying but sounds like my best option unless one of you have a better idea or I am completely not understanding what is going on.

Edit 5: giving up for the night, that being said getplayerpos… does that come from the sps map? If so is there a way to force change it to detect your at location x,y and then start next map coords within that area? (edit this is haunting me can't even sleep back at it again trying to figure it out..)

cosmasjdz

2015-03-11 05:44:05

From: OzoneClutch
– WARNING: .getPlayerPos(): Didn't find enough matches accurately calc your postion
– .getPlayerPos(): result = {X = -1, Y = -1}, took 421 ms

I am getting the above error. Basically I've spent 2 days getting ideas from others and doing research yet still am unable to get this to work. When I call on a single map it loads and works perfectly. When I try doing a 2nd or even 3rd map is when I start having issues. It's not updating the playerPos. It's comparing my old maps last point ex. 322,400 to my next maps first point 322,400. In this scenario it will run although 90% of the time it runs incorrectly or I just got lucky with the way it had been setup. Normally though my first point is something like 70,150, now it's the same location on the minimap BUT the player position isn't getting updated for that new map. This probably makes no sense, so i'll edit in what I wrote on the other thread where I was getting help.

Okay guys, let me explain again what is occuring. Basically using SPS does not work with using multiple maps. It tries to calc my player position based on the currently loaded map, in the example below you'll see that my playerpos at the end is 150,327. It then loads a NEW map and the starting position on the new map (which is directly on top of the ending position on the map) is picking my playerpos but it's detecting that the coordinates for that map are 193,153 not 150,327 even though its the same spot (I understand it's slightly different but not THAT different). That being said if you don't understand I encourage you to test it for yourself, you simply need to create your own map and copy the array path.

Notice the area is almost identical (center is close to identical as well obviously) note the positions in red though!
[ATTACH=CONFIG]25264[/ATTACH]

procedure Taverly2;
var
WTL2: TPointArray;
Taverly2: TSPSArea;
begin;
Taverly2.setup('WTL2',RUNESCAPE_OTHER,3,150,0.65); //WTL2 map
WTL2 := [Point(200, 133), Point(202, 166), Point(196, 217), Point(196, 262), Point(176, 287), Point(172, 298), Point(151, 316), Point(150, 327)];
if Taverly2.walkPath(WTL2) then
begin
wait (random(300,600));
minimap.waitPlayerMoving();
wait (random(300,600));
end
else
writeLn ('Failed to walk');
end;

procedure ActivateTaverly;
var
x, y, i: integer;
begin
if not isLoggedIn() then
exit
else
mainscreen.findObject(x, y, 5660509, 1, colorSetting(2, 1.86, 0.98), mainscreen.playerPoint, 20, 20, 1, ['averly', 'lodes'], MOUSE_LEFT);
wait(randomRange(7000, 10000));
mouse(point(288,211),MOUSE_LEFT);
end;

procedure Falador;
var
WTFalador: TPointArray;
Falador: TSPSArea;
begin;
Falador.setup('WTFalador',RUNESCAPE_OTHER,3,150,0.65);
WTFalador := [Point(193, 153), Point(214, 198), Point(215, 244), Point(238, 255), Point(270, 265), Point(295, 248), Point(332, 227), Point(353, 212), Point(361, 177)];
if Falador.walkPath(WTFalador) then
begin
wait (random(300,600));
minimap.waitPlayerMoving();
wait (random(300,600));
end
else
writeLn ('Failed to walk');
end;
Begin;
clearDebug();
smartEnableDrawing := true;
setupSRL();
if isloggedin() then
begin;
//lodestoneSetup;
//Taverly1;
Taverly2;
//ActivateTaverly;
Falador;
end
else
begin
createPlayer;
SkipTutorial;
interfaceSetup;
lodestoneSetup;
Taverly1;
Taverly2;
ActivateTaverly;
Falador;

end;
end.

Edit 3: As a workaround I suppose I could make my maps extremely small and have a single map for each point to point interaction, albeit that's going to be 600 maps (probably not close but you get the point) and alot of effort. Any other ideas/workarounds? I think I could do as @Incurable; did and use a single huge map (he did it or I read a thread/post on it) and just have 2 second wait times which if that's the best route to take then so be it.

Edit 4: I have a crazy idea (currently testing failed miserably) but due to the way that it is interacting I could in theory have it go from top to bottom of the map I load, then rotate my next map so that my beginning position starts at my last ending position (for the way SPS sees it (ex. Top of Map A. ends at the bottom, Map B. Begins at the bottom and the path goes to the TOP)) although assuming this works it'll be a bit annoying but sounds like my best option unless one of you have a better idea or I am completely not understanding what is going on.

Edit 5: giving up for the night, that being said getplayerpos… does that come from the sps map? If so is there a way to force change it to detect your at location x,y and then start next map coords within that area? (edit this is haunting me can't even sleep back at it again trying to figure it out..)



At start declare for example global variable:

var 
sps1,sps2 :tspsarea;

Then for each map setup:

sps1.setup(whateverHereGoes);
sps2.setup(Whateverheregoes);

To walk,define paths, get poss call those maps like this: call:

sps1.walkpath([ToHell]);
sps2.blindwak([ToHole]);
sps2.getplayerpos();

etc etc. for me it works

Also setup maps GLOBALLY unless you use like 100+ of them. Because if you for example load sps2 map and after that next map you load is also sps2 it unloads it and you get no map.:D probably here is your problem. Cant load same map twice in a row if using 2 or more.

For determining if you can load another map do something like :

if pointinbox(sps1.getplayerpos(),inttobox(whatever box your player you want to be there in the sps1 map )) then
sps2.walkpath(blahblahblah);

Clutch

2015-03-11 09:55:12

From: cosmasjdz
At start declare for example global variable:

var 
sps1,sps2 :tspsarea;

Then for each map setup:

sps1.setup(whateverHereGoes);
sps2.setup(Whateverheregoes);

To walk,define paths, get poss call those maps like this: call:

sps1.walkpath([ToHell]);
sps2.blindwak([ToHole]);
sps2.getplayerpos();

etc etc. for me it works

Also setup maps GLOBALLY unless you use like 100+ of them. Because if you for example load sps2 map and after that next map you load is also sps2 it unloads it and you get no map.:D probably here is your problem. Cant load same map twice in a row if using 2 or more.

For determining if you can load another map do something like :

if pointinbox(sps1.getplayerpos(),inttobox(whatever box your player you want to be there in the sps1 map )) then
sps2.walkpath(blahblahblah);



sps1.walkpath([ToHell]);
sps2.blindwak([ToHole]);
sps2.getplayerpos();
sps3.randomwalk(GoHome);
sps3.getplayerpos();
See above, would I just continue it like that? It looks like that is making it update so it gets the playerpos for that map/area.

"Because if you for example load sps2 map and after that next map you load is also sps2 it unloads it and you get no map. probably here is your problem. Cant load same map twice in a row if using 2 or more." Could you clarify on this. Did you mean to say SPS1 map and after that the next map I load would be SPS2 (different names) or did you mean them having the same name?

3Garrett3

2015-03-11 11:13:29

I won't lie, I'm extremely confused with what you're doing. I'm going to lay this out in a "how I would do it" way and hope that you can follow and make comments on where it breaks.

1) Have a map for each area (ie a big map for Taverly/Burthorpe, a big map for Fally, a big map for Varrock, or whatever)
2) Load whatever map you want. "taverlyMap.setup(stuff)"
3) Walk a path on that map. "taverlyMap.walkPath()"
4) Load the next map.
5) Repeat.

You seem to be getting really confused over "SPS.GetPlayerPos" so I'll try to shed some light here. The position is not a global RS map position. It is a "on the current loaded map, what coordinates are you" position. So when you load one map and get your position, then load another map and get your position, it IS NOT supposed to be the same position, unless you have identical maps.

Again, make sure you have BIG maps because SPS does not work well around the edges of a map. Have at least a full minimap distance from the edges of any points you want to walk or it will mess up.

Turpinator

2015-03-11 11:17:08

That block of text… Im not reading it, but anyway.

sps.debuyPlayerPos() opens a nice debug window so you can first test out your map to ensure it is correctly determining your position

Clutch

2015-03-11 11:59:05

From: 3Garrett3
I won't lie, I'm extremely confused with what you're doing. I'm going to lay this out in a "how I would do it" way and hope that you can follow and make comments on where it breaks.

1) Have a map for each area (ie a big map for Taverly/Burthorpe, a big map for Fally, a big map for Varrock, or whatever)
2) Load whatever map you want. "taverlyMap.setup(stuff)"
3) Walk a path on that map. "taverlyMap.walkPath()"
4) Load the next map.
5) Repeat.

You seem to be getting really confused over "SPS.GetPlayerPos" so I'll try to shed some light here. The position is not a global RS map position. It is a "on the current loaded map, what coordinates are you" position. So when you load one map and get your position, then load another map and get your position, it IS NOT supposed to be the same position, unless you have identical maps.

Again, make sure you have BIG maps because SPS does not work well around the edges of a map. Have at least a full minimap distance from the edges of any points you want to walk or it will mess up.


It's not updating my playerpos it eventually runs out and thinks my position is -1,-1. I'll try all the suggestions when I get home. Thanks!
Edit: SPS is working great individually, but when I go from map 1 which walks from burth to tav, and then load map to tav to falador it says it loads the map, but my playerpos doesn't update and therefore it thinks it can't find the next point.

Edit: @3Garrett3 to make a big map do I need to piece together multiple minimap screenshots, Screenshot from the world map or is there a better way of doing this?

Citrus

2015-03-11 15:58:59

I made a quick little test that uses 2 different maps and 3 different paths to walk from the Taverly bank to loadstone, then to the gate between Taverly and Falador. Test this out and see if it clears things up for you.
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i sps/lib/sps-rs3.simba}

var
tav1, tav2: TSPSArea;

procedure walkPlaces();
var
path1, path2, path3: TPointArray;
begin
path1 := [Point(161, 218), Point(192, 217), Point(218, 201), Point(223, 153), Point(227, 105), Point(214, 80)];
path2 := [Point(213, 79), Point(225, 106), Point(227, 136), Point(223, 175), Point(247, 196), Point(288, 199)];
path3 := [Point(107, 225), Point(132, 217), Point(172, 190), Point(192, 146), Point(219, 129), Point(252, 128)];

tav1.walkPath(path1); //uses the FIRST map to walk to the loadstone

wait(randomRange(333, 444)); //
minimap.waitPlayerMoving(); //waiting
wait(randomRange(333, 444)); //

//click the loadstone

tav1.walkPath(path2); //uses the FIRST map to walk from the loadstone to the bridge

wait(randomRange(333, 444)); //
minimap.waitPlayerMoving(); //waiting
wait(randomRange(333, 444)); //

tav2.walkPath(path3); //uses the SECOND map to walk from the bridge to the gate

wait(randomRange(333, 444)); //
minimap.waitPlayerMoving(); //waiting
wait(randomRange(333, 444)); //;

end;

begin
clearDebug();
smartShowConsole := false;
setupSRL();
tav1.setup('TAVLOAD1', RUNESCAPE_SURFACE);
tav2.setup('TAVLOAD2', RUNESCAPE_SURFACE);

walkPlaces();

end.
You'll have to log in and set the camera manually, then start the script.
The maps go in the surface folder.
[ATTACH]25279[/ATTACH]
[ATTACH=CONFIG]25280[/ATTACH]
[ATTACH=CONFIG]25281[/ATTACH]

Clutch

2015-03-11 16:17:19

From: evilcitrus
I made a quick little test that uses 2 different maps and 3 different paths to walk from the Taverly bank to loadstone, then to the gate between Taverly and Falador. Test this out and see if it clears things up for you.
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i sps/lib/sps-rs3.simba}

var
tav1, tav2: TSPSArea;

procedure walkPlaces();
var
path1, path2, path3: TPointArray;
begin
path1 := [Point(161, 218), Point(192, 217), Point(218, 201), Point(223, 153), Point(227, 105), Point(214, 80)];
path2 := [Point(213, 79), Point(225, 106), Point(227, 136), Point(223, 175), Point(247, 196), Point(288, 199)];
path3 := [Point(107, 225), Point(132, 217), Point(172, 190), Point(192, 146), Point(219, 129), Point(252, 128)];

tav1.walkPath(path1); //uses the FIRST map to walk to the loadstone

wait(randomRange(333, 444)); //
minimap.waitPlayerMoving(); //waiting
wait(randomRange(333, 444)); //

//click the loadstone

tav1.walkPath(path2); //uses the FIRST map to walk from the loadstone to the bridge

wait(randomRange(333, 444)); //
minimap.waitPlayerMoving(); //waiting
wait(randomRange(333, 444)); //

tav2.walkPath(path3); //uses the SECOND map to walk from the bridge to the gate

wait(randomRange(333, 444)); //
minimap.waitPlayerMoving(); //waiting
wait(randomRange(333, 444)); //;

end;

begin
clearDebug();
smartShowConsole := false;
setupSRL();
tav1.setup('TAVLOAD1', RUNESCAPE_SURFACE);
tav2.setup('TAVLOAD2', RUNESCAPE_SURFACE);

walkPlaces();

end.
You'll have to log in and set the camera manually, then start the script.
The maps go in the surface folder.
[ATTACH]25279[/ATTACH]
[ATTACH=CONFIG]25280[/ATTACH]
[ATTACH=CONFIG]25281[/ATTACH]


I see your calling on the maps in the main loop which I'm not doing. I'll try altering mine to do that along with the suggestions above and see if that fixes this.

KeepBotting

2015-03-11 16:31:53

From: OzoneClutch
to make a big map do I need to piece together multiple minimap screenshots, Screenshot from the world map or is there a better way of doing this?

Take a look at BMWxi's SPS World Map project: https://villavu.com/forum/showthread.php?t=111234

Clutch

2015-03-11 22:39:54

From: cosmasjdz
At start declare for example global variable:

var 
sps1,sps2 :tspsarea;

Then for each map setup:

sps1.setup(whateverHereGoes);
sps2.setup(Whateverheregoes);

To walk,define paths, get poss call those maps like this: call:

sps1.walkpath([ToHell]);
sps2.blindwak([ToHole]);
sps2.getplayerpos();

etc etc. for me it works

Also setup maps GLOBALLY unless you use like 100+ of them. Because if you for example load sps2 map and after that next map you load is also sps2 it unloads it and you get no map.:D probably here is your problem. Cant load same map twice in a row if using 2 or more.

For determining if you can load another map do something like :

if pointinbox(sps1.getplayerpos(),inttobox(whatever box your player you want to be there in the sps1 map )) then
sps2.walkpath(blahblahblah);


getplaypos() right after I load map did the trick thanks so much! Now I just need to find a way to get some of these points to be a little bit more accurate. Working on @KeepBotting; 's suggestion and gonna try taking maps from that thread. Thanks a lot for the help everyone!