
Originally Posted by
John
Note to this, You could just use ObjDTM for area getting, It has proven quite helpful for me .
I would probably use this ^ or SPS.
This is what I've used to check if my player has been kicked out of the GOP minigame. It also double checks it by counting colors.
Simba Code:
function CheckGOPLobby: Boolean;
var
MyPos: TPoint;
GopLobbyBox: TBox;
begin
SMART_DrawDotsEx(False, ActionBoxTPA, RGBtoColor(194, 178, 146));
SMART_DrawText(290, 429, UpChars, 'check if at gop lobby', clWhite);
GopLobbyBox := IntToBox(39803, 3015, 39863, 3079);
SPS_Setup(RUNESCAPE_SURFACE, ['99_7']);
MyPos := SPS_GetMyPos;
WriteLn('My position is x: '+inttostr(MyPos.x)+' y: '+inttostr(MyPos.y));
if MyPos = Point(-1, -1) then
begin
Exit;
end;
if PointInBox(MyPos, GopLobbyBox) then
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.23, 0.88);
WriteLn('Blue colors: '+IntToStr(CountColorTolerance(7301651, MMX1, MMY1, MMX2, MMY2, 10))+'');
if CountColorTolerance(7301651, MMX1, MMY1, MMX2, MMY2, 10) > 2000 then
begin
WriteLn('We are at the Gop lobby');
Result:=True;
end else
begin
WriteLn('We are NOT at the Gop lobby');
Exit;
end;
end else
begin
Exit;
end;
end;
You basicly use this
WriteLn('My position is x: '+inttostr(MyPos.x)+' y: '+inttostr(MyPos.y));
to determine the box co-ords.
Then you make a TBox with all the co-ords of the box stored in it. If your position matches a point in the box, you will be in the desired area so the result is true. You don't even need to add failsafe like I did, but I'm using a total of 7 different SPS maps and some times it will think that it is at the GOP lobby even though it isn't. So I added a countcolor function to make sure the player has indeed been kicked. It's not necessary for your script I think :P
C:\Simba\Includes\SPS\img\runescape_other
zanaris
is in there
Simba Code:
SPS_Setup(RUNESCAPE_OTHER, [zanaris']);
is what you have to use
Simba Code:
function CheckZanaris: Boolean;
var
MyPos: TPoint;
ZanarisBox: TBox;
begin
ZanarisBox := IntToBox(1, 2, 3, 4);
SPS_Setup(RUNESCAPE_OTHER, ['zanaris']);
MyPos := SPS_GetMyPos;
WriteLn('My position is x: '+inttostr(MyPos.x)+' y: '+inttostr(MyPos.y));
if MyPos = Point(-1, -1) then
begin
Exit;
end;
if PointInBox(MyPos, ZanarisBox) then
begin
WriteLn('We are at the correct position');
Result:=True;
end else
begin
WriteLn('We are NOT at the correct position');
Exit;
end;
end;
^ that would work if you get the co-ords
Simba Code:
if CheckZanaris then
begin
*things to do when you are in that box*
end;