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?
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.