Code:
program testCombat;
{$i srl-6/srl.simba}
{$i SPS/lib/sps-rs3.simba}
var
x, y, i: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := '****'; //UserName
password := '****'; //Password
isActive := True; //Leave true
isMember := True; //Is user a Member?
end;
currentPlayer := 0;
end;
procedure loginProcedure();
begin
If Not isLoggedIn Then
begin
players[currentPlayer].login();
exitTreasure();
minimap.clickCompass();
mainScreen.setAngle(MS_ANGLE_HIGH);
resetBreakTimer();
end;
end;
procedure setupShit();
begin
setupSRL();
disableSRLLog := True;
disableSRLDebug := True;
declarePlayers();
play_Time := 60;
break_Time := 10;
SPS.setup('Capture1', RUNESCAPE_SURFACE, 8);
spsAnyAngle := True;
resetBreakTimer();
clearDebug();
end;
procedure randomMouse();
begin
mouseSpeed := gaussRangeInt(30, 50);
case random(3) of
0: mouse(ATPA[i].getBounds().getGaussPoint(), MOUSE_MOVE, MOUSE_HUMAN);
1: mouse(ATPA[i].getBounds().getGaussPoint(), MOUSE_MOVE, MOUSE_ACCURATE);
2: mouse(ATPA[i].getBounds().getGaussPoint(), MOUSE_MOVE, MOUSE_BREAK);
end;
end;
procedure handleClick();
begin
case random(9) of
0..7: fastClick(mouse_left);
8..9:
begin
fastClick(mouse_right);
chooseOption.select(['ttack'], 500);
end;
end;
end;
procedure findNPC();
var
path1, path2: TPointArray;
firstArea, secondArea: TBox;
begin
path1 := [[403, 208]];
path2 := [[415, 263]];
firstArea := intToBox(365, 176, 445, 248);
secondArea := intToBox(371, 248, 449, 300);
if not findColorsSpiralTolerance(x, y, TPA, 10457167, mainScreen.getBounds(), 8, colorSetting(2, 0.44, 0.85)) then
begin
if SPS.isInBox(firstArea) then
SPS.walkPath(path2);
if not findColorsSpiralTolerance(x, y, TPA, 10457167, mainScreen.getBounds(), 8, colorSetting(2, 0.44, 0.85)) then
if SPS.isInBox(secondArea) then
SPS.walkPath(path1);
end;
if findColorsSpiralTolerance(x, y, TPA, 10457167, mainScreen.getBounds(), 8, colorSetting(2, 0.44, 0.85)) then
begin
ATPA := TPA.cluster(30);
ATPA.sortFromMidPoint(mainScreen.playerPoint);
for i := 0 to 0 do
begin
randomMouse();
if not isMouseOverText(['Attack', 'ttack'], 500) then
findNPC();
if isMouseOverText(['Attack', 'ttack'], 500) then
begin
clearDebug;
writeLn('Status: Found NPC, Clicking.');
handleClick();
wait(gaussRangeInt(500, 750));
break;
end;
end;
if not targetInfo.hasTarget(1500) then
findNPC();
repeat
clearDebug;
writeLn('Status: In combat.');
wait(gaussRangeInt(250, 750));
until(not inCombat());
end;
end;
begin
setupShit();
repeat
findNPC();
wait(gaussRangeInt(2000, 3000));
until(false);
end.