Clutch
2015-04-09 23:46:27
So, I attempted at a pest control script, but after thinking I had stuff figured out and specific portions running flawlessly, it begins acting up again and completely not working.
You will see that it is still very incomplete but in the right hands it shouldn't require too much more work. I have given up on this, feel free to take it as your own or do as you will.
What it does so far-
1. Locates the plank (I'm pretty sure it's cuz the colors keep changing and I didn't hop worlds to get enough colors for what its looking for you can correct it or rewrite it if this isn't the best option)
2.It'll then wait for the match to start, it draws a Tbox around the squire and hovers until it can't find the squire anymore (this tells it that the round started)
3. It'll run directly to the west portal there's no failsafe if the gate isn't open so this causes issues sometimes.
4. I tried implementing DTMS but ran into the cross plank issue after having it working flawlessly the colors changed, got pissed off and decided to scrap it. Basically the Entire CheckPortals might need to be rewritten. You can keep the spiralcolortolerance to find the portal and attack it still. Technically if you keep that only it'll run a few rounds successfully but requires some babysitting and is very buggy.
P.S. if nobody takes this over I will eventually get back to it, but right now I'm working with @renzanity on perfecting some scripts
You will see that it is still very incomplete but in the right hands it shouldn't require too much more work. I have given up on this, feel free to take it as your own or do as you will.
What it does so far-
1. Locates the plank (I'm pretty sure it's cuz the colors keep changing and I didn't hop worlds to get enough colors for what its looking for you can correct it or rewrite it if this isn't the best option)
2.It'll then wait for the match to start, it draws a Tbox around the squire and hovers until it can't find the squire anymore (this tells it that the round started)
3. It'll run directly to the west portal there's no failsafe if the gate isn't open so this causes issues sometimes.
4. I tried implementing DTMS but ran into the cross plank issue after having it working flawlessly the colors changed, got pissed off and decided to scrap it. Basically the Entire CheckPortals might need to be rewritten. You can keep the spiralcolortolerance to find the portal and attack it still. Technically if you keep that only it'll run a few rounds successfully but requires some babysitting and is very buggy.
P.S. if nobody takes this over I will eventually get back to it, but right now I'm working with @renzanity on perfecting some scripts
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.