SRL Archive - RS3 Help

SPS mapping problem


Neva Banned

2014-03-11 14:31:37

No matter what I do I keep having problems. I have taken multiple screenshots of the minimap and keep making new paths. Running from west varrock bank to west varrock mine it gets lost on the way there, yet everytime it has no problem making it from the mine to the bank.

Any help?

Clarity

2014-03-11 15:05:47

SPS isn't flawless, but it might be map rotation or something. Post the map so we can see what's wrong with it, if anything?

Ashaman88

2014-03-11 15:18:59

Psh SPS should work amazing in RS3 (unless new symbols did something crazy to it)

Show that map! My guess is that you don't have enough extra area on your map

Brotein

2014-03-11 15:43:04

Give us the paths too so we can test it.

Neva Banned

2014-03-11 16:15:41

http://puu.sh/7rGRg.png

path to mine

[Point(191, 43), Point(193, 43), Point(204, 54), Point(206, 69), Point(185, 74), Point(159, 80), Point(149, 92), Point(146, 116), Point(144, 135), Point(146, 149), Point(148, 170), Point(143, 193), Point(143, 216), Point(156, 233), Point(163, 251), Point(173, 267), Point(196, 282), Point(196, 296), Point(192, 307)]


path to bank

[Point(191, 310), Point(192, 310), Point(196, 279), Point(174, 255), Point(162, 214), Point(147, 171), Point(145, 136), Point(145, 103), Point(165, 74), Point(202, 69), Point(202, 52), Point(191, 43)]

Ashaman88

2014-03-11 16:49:38

make yo map bigger (i.e. grab more of the minimap).. anything that could possibly be showing on the MM when you walk should be included (esp. looks like bank is cut-off).

Neva Banned

2014-03-11 17:09:45

Thanks for the help, that fixed my problem now to the last part of the script, banking. Ofc I will then have to implement fail safes.

shockage

2014-03-15 15:30:48

From: Ashaman88
Psh SPS should work amazing in RS3 (unless new symbols did something crazy to it)

Show that map! My guess is that you don't have enough extra area on your map


Hey, so SPS hates MM_BANK. Is that to be expected? I got around it by just doing my own colour finding.

A common trick I started to use for EVERYTHING, is to populate a list of points using the findSpiralColors. Split them into a 2d Array. For each average point of the 2d Array I then try to find a different colour that is a few pixels nearby.

Finally validate with moving the mouse and reading the tool tip text. The reason I do the extra colour finding for each point from the tPointArray is to prevent hovering my mouse on everything that happens to have a similar colour–players clothings…

Ashaman88

2014-03-15 16:28:33

From: shockage
Hey, so SPS hates MM_BANK. Is that to be expected? I got around it by just doing my own colour finding.

A common trick I started to use for EVERYTHING, is to populate a list of points using the findSpiralColors. Split them into a 2d Array. For each average point of the 2d Array I then try to find a different colour that is a few pixels nearby.

Finally validate with moving the mouse and reading the tool tip text. The reason I do the extra colour finding for each point from the tPointArray is to prevent hovering my mouse on everything that happens to have a similar colour–players clothings…


What do you mean SPS hates MM_BANK? I wasn't aware that sps used the bank symbol specifically? My maps are all still working fine for me… Unless you are talking about minimap.findsymbol? If so, yeah the symbols in the include haven't been updated with the new symbols yet

shockage

2014-03-15 19:12:07

From: Ashaman88
Unless you are talking about minimap.findsymbol? If so, yeah the symbols in the include haven't been updated with the new symbols yet


Exactly. Sorry for the confusion. I need to learn how to create bmp strings for SCAR.

For now I do the following code, when finishing a SPS path.

// returns true if bank was opened and verified with bankscreen.isOpen()
// returns false after timeout -- Bank can be either opened or closed because
// bankscreen.isOpen() does not always work.
// Make sure to try to catch the likely event that this function returns false.
// As of March 15, 2014, this function has never failed to open the bankbooth but
// it is possible.
function tryToOpenBank() : boolean;
var
x, y, i, t: integer;
tb: TBox;
tp: TPoint;
tpa: TPointArray;
atpa: T2DPointArray;

// Opens West Varrock Bank by searching first for the red velvet ropes
// then by the darker wood trim, and finally the lighter wood inserts.
begin
result := false;
// This function should be fast. With a time of 5 seconds this function will
// click around three times. Otherwise if we can't find the bank booth, the
// calling function should reposition us and recall this function.
t := getSystemTime() + RandomRange(4000, 6000);
repeat
// Search the whole screen for the red velvet rope
if findColorsSpiralTolerance(0, 0, tpa, 1121451, mainScreen.getBounds(), 8, colorSetting(2, 0.02, 0.90)) then

if (Length(tpa) < 1) then begin
exit(false);
end;
atpa := tpa.toATPA(16, 16);
SetLength(tpa, 0);
// Sort the array from player
atpa.sortFromMidPoint(mainscreen.playerPoint);
for i := 0 to High(atpa) do
begin
tp := middleTPA(atpa[i]);
tb.setBounds(tp.x - 16, tp.y - 16, tp.x + 16, tp.y + 16);
writeln('-- Bank Booth Colour Pick 1: ', tp.x, ', ', tp.y);
// Dark brown wood of bank booth
if (findColorSpiralTolerance(x, y, 1723246, tb, 8, colorSetting(2, 0.14, 0.76))) then
begin
writeln('-- Bank Booth Colour Pick 2: ', x, ', ', y);
tb.setBounds(x - 16, y - 16, x + 16, y + 16);
// Light brown wood of bank booth
if (findColorSpiralTolerance(x, y, 2579060, tb, 8, colorSetting(2, 0.16, 0.66))) then
begin
writeln('-- Bank Booth Colour Pick 3: ', x, ', ', y);
// This randomness can lead to a failure to bank...
Mouse(point(x, y).rand(4), MOUSE_MOVE, MOUSE_HUMAN);
if isMouseOverText(['ank'], 200) then
begin
GetMousePos(x, y);
wait(randomRange(100, 500));
Mouse(point(x, y).rand(1), MOUSE_LEFT, MOUSE_HUMAN);
result := bankscreen.isOpen(2000);
exit(result);
end;
end;
end;
end;
until (result or getSystemTime() > t);
exit(false);
end;
Ugly, heh?

Ashaman88

2014-03-15 19:34:53

From: shockage
Exactly. Sorry for the confusion. I need to learn how to create bmp strings for SCAR.

For now I do the following code, when finishing a SPS path.

// returns true if bank was opened and verified with bankscreen.isOpen()
// returns false after timeout -- Bank can be either opened or closed because
// bankscreen.isOpen() does not always work.
// Make sure to try to catch the likely event that this function returns false.
// As of March 15, 2014, this function has never failed to open the bankbooth but
// it is possible.
function tryToOpenBank() : boolean;
var
x, y, i, t: integer;
tb: TBox;
tp: TPoint;
tpa: TPointArray;
atpa: T2DPointArray;

// Opens West Varrock Bank by searching first for the red velvet ropes
// then by the darker wood trim, and finally the lighter wood inserts.
begin
result := false;
// This function should be fast. With a time of 5 seconds this function will
// click around three times. Otherwise if we can't find the bank booth, the
// calling function should reposition us and recall this function.
t := getSystemTime() + RandomRange(4000, 6000);
repeat
// Search the whole screen for the red velvet rope
if findColorsSpiralTolerance(0, 0, tpa, 1121451, mainScreen.getBounds(), 8, colorSetting(2, 0.02, 0.90)) then

if (Length(tpa) < 1) then begin
exit(false);
end;
atpa := tpa.toATPA(16, 16);
SetLength(tpa, 0);
// Sort the array from player
atpa.sortFromMidPoint(mainscreen.playerPoint);
for i := 0 to High(atpa) do
begin
tp := middleTPA(atpa[i]);
tb.setBounds(tp.x - 16, tp.y - 16, tp.x + 16, tp.y + 16);
writeln('-- Bank Booth Colour Pick 1: ', tp.x, ', ', tp.y);
// Dark brown wood of bank booth
if (findColorSpiralTolerance(x, y, 1723246, tb, 8, colorSetting(2, 0.14, 0.76))) then
begin
writeln('-- Bank Booth Colour Pick 2: ', x, ', ', y);
tb.setBounds(x - 16, y - 16, x + 16, y + 16);
// Light brown wood of bank booth
if (findColorSpiralTolerance(x, y, 2579060, tb, 8, colorSetting(2, 0.16, 0.66))) then
begin
writeln('-- Bank Booth Colour Pick 3: ', x, ', ', y);
// This randomness can lead to a failure to bank...
Mouse(point(x, y).rand(4), MOUSE_MOVE, MOUSE_HUMAN);
if isMouseOverText(['ank'], 200) then
begin
GetMousePos(x, y);
wait(randomRange(100, 500));
Mouse(point(x, y).rand(1), MOUSE_LEFT, MOUSE_HUMAN);
result := bankscreen.isOpen(2000);
exit(result);
end;
end;
end;
end;
until (result or getSystemTime() > t);
exit(false);
end;
Ugly, heh?


why not just use bankscreen.open(BANK_NPC_BLUE); ?

shockage

2014-03-15 20:08:53

From: Ashaman88
why not just use bankscreen.open(BANK_NPC_BLUE); ?

Because it did not work. And I think it was failing on SRL's internal __getColour? But I don't remember. I can double check if you would like me to.

As a systems programmer, I have to make my life miserable–thug life.

More probably than not, my settings may be weird, but I swear they are exactly as told. I even watched your Youtube video on setting up Simba! Heck, even your PowerMiner just didn't want any of my colours.

Ashaman88

2014-03-16 09:52:50

If you have an updated srl and have camera mode set to classic, and zoomed out all the way it should work. There was a few days where the colors weren't updated for an rs update, but it should work fine now