SRL Archive - SRL Positioning System

sps_getMyPos fix [resolves spam clickNorth]


DaWu

2011-11-30 14:07:31

From: Coh3n
rs_GetCompassAngleDegrees works fine. Click here for my explanation. Changing line 227 in Simba/Includes/SPS/SPS.simba to this should resolve the issue.

if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then


The final solution ^^




———————————————————————————————————–




Fix I posted earlier had a flaw, a huge flaw, in it and it took some measures that weren't really needed.

This one appears to work just fine for me. Please test and report back if you find it to not work as supposed.

It uses the blue and red colors on the compass to tell if its north.


 
function SPS_GetMyPos: TPoint;
var
Minimap: T3DIntegerArray;
t, map: integer;
begin
Result := Point(-1, -1);

if not LoggedIn then
Exit;

if not SPS_Loaded then
SPS_Load;

// we should just rotate the minimap according to the minimap angle.
if not(GetColor(544, 17)= 7699891) and not (GetColor(543, 29)= 3227717) then
ClickNorth(True);

t := getSystemTime;
Minimap := SPS_GatherMinimap;
if (High(Minimap) < 0) then
begin
if (SPS_Debug) then
WriteLn('[SPS] Did not gather Minimap.');

Exit;
end;

try
map := SPS_FindMapInMapEx(
Result.X, Result.Y, SPS_Worldmap, Minimap, SPS_Surface.Tolerance
);

if ((Result.X > 0) and (Result.Y > 0)) then
begin
Result := SPS_LocalToGlobal(SPS_Areas[map], Result.X, Result.Y);
end;

if (SPS_Debug) then
writeln(format('[SPS] GetMyPos: Finished in %d ms. Location = %s',
[getSystemTime - t, toStr(result)]));

except
Writeln('[SPS] ERROR in SPS_GetMyPos: ' + ExceptionToString(ExceptionType, ExceptionParam));
SPS_WarnUser('SPS_GetMyPos', ExceptionToString(ExceptionType, ExceptionParam));
end;
end;

Edit: Navigate to Includes/SPS/ and open sps.simba, find function called sps_getMyPos, replace it with ^^ and save it to apply this fix.

kingarabian

2011-11-30 14:32:26

Looking good. But we need a fix for the ChooseOption…

Sir R. M8gic1an

2011-11-30 15:30:53


if not(GetColor(544, 17)= 7699891) and not (GetColor(543, 29)= 3227717) then

Should it not be or? I guess and might work too..

-RM

DaWu

2011-11-30 15:34:02

If those aren't there, the compass "Pointer" isnt in correct direction, aka red pointer up and blue blob bottom end down
thats why I used and instead of or, so it checks both of those points, up and down to avoid false activations. I think it should be more reliable this way.
But yeah you most likely could just use OR there.


Either way I've been having no problems with this one for now in my test runs, worked like a charm.

Tyrosus

2011-11-30 19:13:50

This may sound like a stupid question, but where can I plug this into Simba? Appreciate the quick ghetto fix, btw! I love this community. Keep the pressure on Jagex :D

DaWu

2011-11-30 19:33:37

From: Tyrosus
This may sound like a stupid question, but where can I plug this into Simba? Appreciate the quick ghetto fix, btw! I love this community. Keep the pressure on Jagex :D


Navigate to Includes/SPS/ and open sps.simba, find function called sps_getMyPos, replace and save it.

Tyrosus

2011-11-30 20:31:24

From: DaWu
Navigate to Includes/SPS/ and open sps.simba, find function called sps_getMyPos, replace and save it.


You rule, thank you for the speedy response. Still trying to learn how to script myself so I can contribute as well :) I'd love to join the fight for the bots, lol.

YoHoJo

2011-11-30 21:31:25

Anyone test and confirm this to work well?
Should it be committed?

mormonman

2011-11-30 21:36:43

From: YoHoJo
Anyone test and confirm this to work well?
Should it be committed?


No, rs_GetCompassAngleDegrees should be fixed instead. This is just a quickfix.

DaWu

2011-11-30 21:43:42

From: mormonman
No, rs_GetCompassAngleDegrees should be fixed instead. This is just a quickfix.


Tho, sps_getMyPos only needs north for now.

YoHoJo

2011-11-30 21:44:16

From: mormonman
No, rs_GetCompassAngleDegrees should be fixed instead. This is just a quickfix.


Ah yes okay. Someone should start tweaking that then, thanks.

DaWu

2011-11-30 21:54:27

Im curious if anyone else even is having the same problem I made this fix for, hah.

piper101

2011-11-30 22:06:54

yeah, im cutting yews and its right clicking compass set to north like crazy, ill add this in a bit. thanks.

Edit: Just to clarify, do we add yours, DaWu, and his (Coh3n)? Bit nooby still.

YoHoJo

2011-11-30 22:07:56

Yea lots of people are DaWu, I was using Lumby West Miner/Banker and it was clicknorthing like crazy.

Coh3n

2011-11-30 22:15:25

rs_GetCompassAngleDegrees works fine. Click here for my explanation. Changing line 227 in Simba/Includes/SPS/SPS.simba to this should resolve the issue.

if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then

DaWu

2011-11-30 22:30:11

^Appears to work just fine too, so I guess this was purely SPS targetted miniupdate by jagex, as it only started to happen to me today.

YoHoJo

2011-11-30 22:35:17

Thanks Cohen! Will give that a whirl!

snowneo

2011-12-01 01:43:36

From: Coh3n
rs_GetCompassAngleDegrees works fine. Click here for my explanation. Changing line 227 in Simba/Includes/SPS/SPS.simba to this should resolve the issue.

if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then


Thank you, that worked like a charm :). It's amazing how such a small change in numbers can have a huge impact on scripts.

iamorange12

2011-12-01 03:45:54

From: Coh3n
rs_GetCompassAngleDegrees works fine. Click here for my explanation. Changing line 227 in Simba/Includes/SPS/SPS.simba to this should resolve the issue.

if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then


Thanks, it worked, I shoulda :google:

YoHoJo

2011-12-01 03:46:44

Cohen's fix works just fine!

truxo

2011-12-01 08:24:50

Works Flawless with Thanks!

Coh3n

2011-12-01 13:32:12

SPS has been updated, so everything should be working when your SPS updates (if you haven't updated manually already).

kingarabian

2011-12-02 01:52:55

Still spamming it.It's still clicking it at random pointless times. It sometimes clicks north 3 times in a row.

I used Coh3n's fix.


Sorry I forgot to change the 5 to 10.

icez123

2011-12-03 19:51:27

thanks alot

YoHoJo

2011-12-03 20:08:56

Mine is still clicking compass pretty often.
How would I need to edit the angles to make the range even more 'extreme' so it's clicked less?

if (inRange(ang, 10, 350)) then


Because before it was 5, 355
The first one was increased to 10, yet second decreased to 350, I dun get it.
If I set it to like 5, 355 would it be a super bigger range and thus click less often?

YoHoJo

2011-12-04 05:24:07

bumb, answer please ^!

legoace

2011-12-04 18:38:05

If the angle is between 5 degrees and 355 degrees, it will think that the compass is not north enough. Therefore it will click the compass. Narrowing this range to 10 < angle < 350 means that it is more likely SRL will see the compass as being acceptably North.

Gurkis

2011-12-25 15:39:25

My B. Wrong thread <,>