SRL Archive - SRL Positioning System

SPS Broken in the Desert..


Brandon

2011-12-30 15:54:24

[ATTACH]12703[/ATTACH]

Why does SPS report three different results every time.. for my script below.. The areas are definitely right.. but SPS reports three different positions for my static character. AKA non-moving character.

Path creator reports a totally different number, SPS_GetMyPos reports 3 different tiles.. It's so off that My character gets detected InCircleTent 1/3 times even though I'm still in there :S No matter which tent I'm in, it always reports a different position every compilation that's at least 100 off in distance from the previous.

Am I doing something wrong?


program BanditKiller;
{$define SMART}
{$Define CRASHSMART}
{$i srl/srl.scar}
{$i sps/sps.simba}
{$i SRL/SRL/misc/paintsmart.scar}

Procedure Debugs(TPA: TPointArray; Debug: Boolean);
begin
if Debug then
Smart_DrawDotsEx(True, TPA, CLBLUE)
else
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug();
ClearRSCanvas(SMART_Canvas.canvas);
end;
end;

Function InCircleTent(GPS: TPoint): Boolean;
begin
Result:= InCircle(GPS.X, GPS.Y, 4725, 4460, 15);
end;

Function InMiddleTent(GPS: TPoint): Boolean;
var
Tent: TBox;
begin
Tent:= PointToBox(Point(4510, 4765), Point(123131, 313131)); //EDIT!!!!!!!!!!!!!!!!!!!
Result:= PointInBox(GPS, Tent);
end;

Function InTopRightTent(GPS: TPoint): Boolean;
var
Tent: TBox;
begin
Tent:= PointToBox(Point(4565, 4720), Point(4595, 4755));
Result:= PointInBox(GPS, Tent);
end;

Function FindBandit: Boolean;
var
X, Y, CTS: Integer;
TPA: TPointArray;
MMP, MSP:TPoint;
begin
CTS:= GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.19, 0.11);

FindColorsSpiralTolerance(X, Y, TPA, 1845083, MSX1, MSY1, MSX2, MSY2, 12);
Debugs(TPA, True);

if InCircleTent(SPS_GetMyPos) then
begin
MMP:= SPS_PosToMM(Point(4567, 4779));
MSP:= MMToMS(MMP);

if PointInBox(MSP, MSBox) then
FilterPointsPie(TPA, 0.0, 360, 0.0, 15, MSP.X, MSP.Y);
MMouse(MSP.X, MSP.Y, 0, 0);
Debugs(TPA, True);
end;

ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SPS_Setup(RUNESCAPE_SURFACE, ['11_11','11_12']);
setupSRL();

FindBandit;
writeln(InCircleTent(SPS_GetMyPos)); //Writes both true and False at random..
writeln(SPS_GetMyPos);
writeln(SPS_LocalToGlobal('11_11', MSCX, MSCY));
end.

PatDuffy

2011-12-30 15:59:07

SPS is so sketchy right now :p

Can't wait for SPS 2.0, hopefully it will fix things like that. I stopped work on a script in Falador because every time I would create a path it would be off, then I would compensate and it would be off in a different direction.

Mat

2011-12-30 16:03:03

From: PatDuffy
SPS is so sketchy right now :p

Can't wait for SPS 2.0, hopefully it will fix things like that. I stopped work on a script in Falador because every time I would create a path it would be off, then I would compensate and it would be off in a different direction.

I was having Problems with my Farmer getting it to go the Falador patch, it still is a bit sketchy. Hope SPS 2.0 fixes these.:)
Mat

euphemism

2011-12-30 17:25:15

There are other forms of walking, such as: DDTMs, radial walking, TPA walking, walking via symbols, and others. Perhaps you should try them.

legoace

2011-12-30 18:01:31

From: euphemism
TPA walking


This. TPA walking is the bomb, so consistent. The only problem is on the rare occasion it messes up or the client lags there is no way to correct.

Also the Flag is becoming less and less reliable. I think we should fix pixel shift to work for the MMap to detect movement.

Claymore

2011-12-30 18:03:03

From: legoace
This. TPA walking is the bomb, so consistent. The only problem is on the rare occasion it messes up or the client lags there is no way to correct.

Also the Flag is becoming less and less reliable. I think we should fix pixel shift to work for the MMap to detect movement.


That applies to all forms of walking, especially DDTMs ;/ Nothing is really flawless but TPA walking is my personal favorite.

Brandon

2011-12-30 18:38:28

From: Claymore
That applies to all forms of walking, especially DDTMs ;/ Nothing is really flawless but TPA walking is my personal favorite.


Actually never heard of such a thing :S Tutorial?

euphemism

2011-12-30 18:46:28

From: ggzz
Actually never heard of such a thing :S Tutorial?


Original tutorial, but kanah made a modified verison that compensates for compass rotation, and supports CTS2, found here.