Simba Code:
program Klutch_PC;
{$DEFINE SMART} // Always have this to load smart
{$I SRL-6/SRL.simba} // To load the SRL include files
{$I SPS/lib/SPS-RS3.Simba} // To load the SPS include files
var
FailDTM, DestroyedDTM, WestDTM, SWestDTM, SEastDTM, EastDTM, RotateCameraTrys, x, y, u, i: integer;
WaitTimer, AttackTimer: TTimeMarker;
sTPA, bTPA, TPA: TPointArray;
bATPA, ATPA: T2DPointArray;
SquirePoint: TPoint;
box: TBox;
procedure declareplayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := '';
password := '';
isActive := true;
isMember := true;
end;
currentPlayer := 0;
end;
procedure CrossPlank;
begin
if not isLoggedIn() then
exit;
minimap.clickCompass;
mainScreen.setAngle(MS_ANGLE_HIGH);
begin
RotateCameraTrys := 0;
repeat
findColorsSpiralTolerance(x, y, sTPA, 2829103, mainScreen.getBounds(), 1, colorSetting(2, 0.00, 1.06)); //finds squires unique color for filtering.
if (Length(sTPA) <1) then
begin
WriteLn('Failed to find Squire colors');
Exit;
end;
SquirePoint := middleTPA(sTPA); //Find the central point of the squires strange thing on their head?
findColorsSpiralTolerance(x, y, bTPA, 5340061, mainScreen.getBounds(), 3, colorSetting(2, 0.06, 0.12));
if (Length(bTPA) <1) then
begin
WriteLn('Failed to find the board');
Exit;
end;
bTPA.excludePointsDist(0, 250, SquirePoint.x, SquirePoint.y);
bATPA := bTPA.toATPA(30,30);
FilterTPAsBetween(bATPA,1,199);
bATPA.sortFromMidPoint(SquirePoint); // sort the TPAs of frame colors around the SquirePoint
SmartImage.debugATPA(bATPA);
SmartImage.debugTPA(sTPA);
mouse(middleTPA(bTPA),MOUSE_MOVE);
if isMouseOverText(['ross', 'angplank']) then
begin
fastClick(MOUSE_LEFT);
Exit;
end else
begin //mouseover not found
randomCompass(0, 360, false);
smartImage.clear();
end;
RotateCameraTrys := RotateCameraTrys +1;
until RotateCameraTrys >3;
end;
end;
procedure startPC();
var
WP: TPointArray;
PlayPC: TSPSArea;
begin
PlayPC.setup('PC',RUNESCAPE_OTHER);
PlayPC.getPlayerPos();
WP := [Point(195, 127), Point(163, 144), Point(122, 155), Point(99, 158)];
if PlayPC.walkPath(WP) then
begin
wait (random(1300,1600));
minimap.waitPlayerMoving();
wait (random(1300,1600));
end
else
writeLn ('Failed to walk')
end;
procedure WaitGame;
begin
if not isLoggedIn() then
exit;
minimap.clickCompass;
mainScreen.setAngle(MS_ANGLE_HIGH);
begin
smartImage.clear();
end;
begin
minimap.clickCompass;
wait (RandomRange(300,600));
box:= intToBox(402, 105, 419, 75);
mouseBox (box, MOUSE_MOVE);
repeat
if isMouseOverText(['quire']) then
wait (randomRange(500,1500)); until
not isMouseOverText(['quire']);
wait (RandomRange(200,500));
StartPC;
end;
end;
Procedure CheckPortals;
begin
FailDTM := DTMFromString('mbQAAAHicY2VgYJjIyMDQDMRzgLgViOcBcRBQ3A2KE6H4yNYtDIHe3gzZyUlgGoSxAUYsGAwA8OsKlQ==');
WestDTM := DTMFromString('mbQAAAHicY2VgYJjEyMAwEYgbgXgqEC8C4mCgeBIDhHYG4kAg/jjnM0MfTw8KxgYYsWAwAAAt6Quf');
DestroyedDTM := DTMFromString('mbQAAAHicY2VgYDjCyMBwCYgvAPFBKA4FirsDcQIQRwBxIBDfZuBi+M3ACMYgNghjA4xYMBgAAAf8CkQ=');
if findDTM(WestDTM, x, y, mainscreen.getBounds()) then
repeat
findColorsSpiralTolerance(x, y, TPA, 13513855, mainScreen.getBounds(), 6, colorSetting(2, 0.16, 5.41));
if (Length(TPA) < 1) then
exit;
ATPA := TPA.toATPA(20, 20);
ATPA.filterBetween(0, 15);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['ttack'], 500) then
begin
fastClick(MOUSE_RIGHT);
if chooseOption.select(['ttack'], 500) then
begin
writeLn('Attacking portal');
smartImage.clear;
break(2);
end;
end;
end;
until
findDTM(DestroyedDTM, x, y, mainscreen.getBounds());
if findDTM(FailDTM, x, y, mainscreen.getBounds()) then
writeLn('Failed to find DTM');
CrossPlank;
end;
// main loop
begin
clearDebug();
declarePlayers();
smartEnableDrawing := true;
smartShowConsole := false;
setupSRL();
if not isLoggedIn() then
begin
players[currentPlayer].login();
exitTreasure();
minimap.setAngle(MM_DIRECTION_SOUTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
if isLoggedIn() then
CrossPlank;
WaitGame;
StartPC;
CheckPortals;
end.