Simba Code:
program Test;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
Const
Area_Air = 'Air';
Area_Earth = 'Earth';
Area_Water = 'Water';
Area_Fire = 'Fire';
Area_Mind = 'Mind';
Area_Body = 'Body';
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
end;
end;
procedure SetupLogin;
begin
ClearDebug;
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
//Wait(1000 + Random(3000));
//ClickNorth(0);
end;
procedure FindTheEarthAltar;
var
EarthAltarDTM, X, Y: Integer;
aFound: Extended;
MyPos, EarthAltarPos: TPoint;
begin
if not(FindColoredAreaTolerance(X, Y, 6249310, MSX1, MSY1, MSX2, MSY2, 1000, 8)) then
begin
EarthAltarDTM := DTMFromString('mVAEAAHicpc+xCwFxGMbxp98VMvkTTCR0V9IJRVw2lzIYxaHLYJQMFv+qRTFQlIlvdzdZ761Pz/OMb0HSKxO74pLkG1ZWysHgwb7hjic++CYaRiqiZOLeh4dessuowIGLDrpowcZ+MdDKr2k7tbWbOVHO/aY2k7qW42rkHLYjp3CkQzDUce3FO3CV54c0LJgU/u8H1cEhEw==');
if not(FindDTMRotated(EarthAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound)) then
begin
SPS_Setup(RUNESCAPE_SURFACE, ['0_8']);
MyPos:=SPS_GetMyPos;
Writeln('My position is x: '+inttostr(MyPos.x)+' y: '+inttostr(MyPos.y));
EarthAltarPos := Point(RandomRange(223, 247), RandomRange(3415, 3431));
SPS_BlindWalk(EarthAltarPos);
FreeDTM(EarthAltarDTM);
end else
begin
WriteLn('We have found the EarthAltarDTM on the minimap');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
Wait(100 + Random(100));
repeat
Wait(50 + Random(50));
until (IsMoving=False);
FreeDTM(EarthAltarDTM);
end;
end else
begin
WriteLn('We can see the earth altar on our main screen!');
end;
end;
procedure FindTheFireAltar;
var
FireAltarDTM, X, Y: Integer;
aFound: Extended;
begin
if not(FindColoredAreaTolerance(X, Y, 6512482, MSX1, MSY1, MSX2, MSY2, 7500, 6)) then
begin
FireAltarDTM := DTMFromString('m6wAAAHic42ZgYGhiYmBoBOIiKD0BiKOBeAkQdwBxNRC3A3ElEFsD1esAsQ0QezFA+JZA7ADETkDsCMQmUBztZ80Q5m7AEO1txJDgZ8oQ5KzLoCvNDcYpQeYMWeHWDGkhFmAsAlTPRSRmIgEjAQCZCRFl');
if not(FindDTMRotated(FireAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound)) then
begin
WriteLn('We haven`t found the DTM, radial walking near the altar');
RadialWalkTolerance(3823718, 0, 359, 75, 5, 5, 5);
if FindDTMRotated(FireAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the FireAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
RadialWalkTolerance(3823718, 0, 359, 25, 5, 5, 5);
if FindDTMRotated(FireAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the FireAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
WriteLn('Something has went wrong, not able to navigate to the Fire Altar');
end;
end;
end else
begin
WriteLn('We have found the FireAltarDTM on the minimap');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end;
FreeDTM(FireAltarDTM);
end else
begin
WriteLn('We can see the fire altar on our main screen!');
end;
end;
procedure FindTheMindAltar;
var
MindAltarDTM, X, Y: Integer;
aFound: Extended;
begin
if not(FindColoredAreaTolerance(X, Y, 6249310, MSX1, MSY1, MSX2, MSY2, 500, 3)) then
begin
MindAltarDTM := DTMFromString('mwQAAAHic42RgYGBmZ2BgB+IvbAwMbEBaFIj/AtnfgVgIyBYEYgkmBgZOIBYHYg0gFgNiLiBWBGIFIOYF4q62FobaqnK8+D/QPlYiMBMBDAcAPz4Slg==');
if not(FindDTMRotated(MindAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound)) then
begin
RadialWalkTolerance(9474711, 0, 359, 75, 5, 5, 5);
if FindDTMRotated(MindAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the MindAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
RadialWalkTolerance(9474711, 0, 359, 25, 5, 5, 5);
if FindDTMRotated(MindAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the MindAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
WriteLn('Something has went wrong, not able to navigate to the Mind Altar');
end;
end;
end else
begin
WriteLn('We have found the MindAltarDTM on the minimap');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end;
FreeDTM(MindAltarDTM);
end else
begin
WriteLn('We can see the mind altar on our main screen!');
end;
end;
procedure FindTheWaterAltar;
var
WaterAltarDTM, X, Y: Integer;
aFound: Extended;
begin
if not(FindColoredAreaTolerance(X, Y, 6380896, MSX1, MSY1, MSX2, MSY2, 400, 4)) then
begin
WaterAltarDTM := DTMFromString('mwQAAAHic42RgYEhiYmBIAeJAIE4A4iIgzgfiUCAugNIGQHWyQKwLxI5ArA/EtkBsA8QqQKwExPUN6gwF2UoMJfkqDPllEJxdBOGXlKqAaRGgOi4CmIkIDAcAEVEPAw==');
if not(FindDTMRotated(WaterAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound)) then
begin
RadialWalkTolerance(2389615, 0, 359, 75, 5, 5, 5);
if FindDTMRotated(WaterAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the WaterAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
RadialWalkTolerance(2389615, 0, 359, 25, 5, 5, 5);
if FindDTMRotated(WaterAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the WaterAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
WriteLn('Something has went wrong, not able to navigate to the Water Altar');
end;
end;
end else
begin
WriteLn('We have found the WaterAltarDTM on the minimap');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end;
FreeDTM(WaterAltarDTM);
end else
begin
WriteLn('We can see the water altar on our main screen!');
end;
end;
procedure FindTheAirAltar;
var
AirAltarDTM, X, Y: Integer;
aFound: Extended;
begin
if not(FindColoredAreaTolerance(X, Y, 5854551, MSX1, MSY1, MSX2, MSY2, 1500, 4)) then
begin
AirAltarDTM := DTMFromString('mwQAAAHic42RgYHjFxsDwGohvQulfQPwPiC8B8VUgZmFnYLBgYmBQA2JzIPYEYksgDgJiJSD2h9IlycoMieGyDOmx8gzJkXJg3Fvpy9Bd7g3GubHWDCJA+7gIYCYiMBwAAPJ8E1k=');
if not(FindDTMRotated(AirAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound)) then
begin
RadialWalkTolerance(2319220, 0, 359, 75, 5, 5, 5);
if FindDTMRotated(AirAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the AirAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
RadialWalkTolerance(2319220, 0, 359, 25, 5, 5, 5);
if FindDTMRotated(AirAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the AirAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
WriteLn('Something has went wrong, not able to navigate to the Air Altar');
end;
end;
end else
begin
WriteLn('We have found the AirAltarDTM on the minimap');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end;
FreeDTM(AirAltarDTM);
end else
begin
WriteLn('We can see the air altar on our main screen!');
end;
end;
procedure FindTheBodyAltar;
var
BodyAltarDTM, X, Y: Integer;
aFound: Extended;
begin
if not(FindColoredAreaTolerance(X, Y, 6578018, MSX1, MSY1, MSX2, MSY2, 500, 4)) then
begin
BodyAltarDTM := DTMFromString('mwQAAAHic42RgYHjBBsHXoPQvKL4IxFehbHsmBgYNILYBYl8orQnE2lC+DxC3FJYw5MbGMZSnZjAUJyUzFCYkMTTlF4JxV1kFQ2lyKgMX0D5CmIkIDAcAfbMWsg==');
if not(FindDTMRotated(BodyAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound)) then
begin
RadialWalkTolerance(8223117, 0, 359, 75, 5, 5, 5);
if FindDTMRotated(BodyAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the BodyAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
RadialWalkTolerance(8223117, 0, 359, 25, 5, 5, 5);
if FindDTMRotated(BodyAltarDTM, X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('We have found the BodyAltarDTM on the minimap this time');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end else
begin
WriteLn('Something has went wrong, not able to navigate to the Body Altar');
end;
end;
end else
begin
WriteLn('We have found the BodyAltarDTM on the minimap');
MMouse(X, Y, 2, 2);
Wait(25 + Random(125));
ClickMouse2(1);
end;
FreeDTM(BodyAltarDTM);
end else
begin
WriteLn('We can see the body altar on our main screen!');
end;
end;
function MaxArray(A : array of Integer; Var Pos : integer) : integer;
var
i : integer;
begin
Result := MaxA(A);
for i := low(A) to high(A) do
if(Result = A[i])then
begin
Pos := i;
break;
end;
end;
function GetAlter: String; //This is the function that actually returns the alter
var
P, i : integer;
AlterColours, Counts : array of integer;
begin
AlterColours := [2450544, 2706787, 2589310, 3688535, 8487814, 7369098]
SetArrayLength(Counts, 6);
for i := low(Counts) to high(Counts) do
Counts[i] := CountColorTolerance(AlterColours[i], MMCX - 30, MMCY - 30, MMCX + 30, MMCY + 30, 15);
MaxArray(Counts, P);
case P of
0 : Result := Area_Air;
1 : Result := Area_Earth;
2 : Result := Area_Water;
3 : Result := Area_Fire;
4 : Result := Area_Mind;
5 : Result := Area_Body;
end;
end;
procedure Test2;
var
PossibleArea: Array [0..5] of String;
i: Integer;
begin
PossibleArea[0]:=Area_Air;
PossibleArea[1]:=Area_Earth;
PossibleArea[2]:=Area_Water;
PossibleArea[3]:=Area_Fire;
PossibleArea[4]:=Area_Mind;
PossibleArea[5]:=Area_Body;
for i:= 0 to 5 do
begin
if GetAlter=PossibleArea[i] then
begin
//WriteLn('Our location is '+PossibleArea[i]+'');
case PossibleArea[i] of
PossibleArea[0]: begin;
WriteLn('We are at the '+PossibleArea[i]+' Altar');
FindTheAirAltar;
end;
PossibleArea[1]: begin;
WriteLn('We are at the '+PossibleArea[i]+' Altar');
FindTheEarthAltar;
end;
PossibleArea[2]: begin;
WriteLn('We are at the '+PossibleArea[i]+' Altar');
FindTheWaterAltar;
end;
PossibleArea[3]: begin;
WriteLn('We are at the '+PossibleArea[i]+' Altar');
FindTheFireAltar;
end;
PossibleArea[4]: begin;
WriteLn('We are at the '+PossibleArea[i]+' Altar');
FindTheMindAltar;
end;
PossibleArea[5]: begin;
WriteLn('We are at the '+PossibleArea[i]+' Altar');
FindTheBodyAltar;
end;
end;
end;
end;
end;
begin
SetUpLogin;
//FindTheAirAltar;
//FindTheMindAltar;
//FindTheWaterAltar;
//FindTheEarthAltar;
//FindTheFireAltar;
//FindTheBodyAltar;
GetAlter;
Test2;
end.