SRL Archive - Jr. Member RS3 Scripts

JRPestControl


J_R

2015-05-19 15:50:13

JRPestControl

Just thought I'd release my pretty messy, but still gets the job done barebones pest control script, seeing as how people might want it for the new thaler system (and I didn't really see any other PC scripts here). I've been able to run this in the past pretty easily, and it still works ok. It might be bot-like but meh, I've ran this for many hours and havent been banned so it's probably safe.

Setup instructions:
1. probably starting in the boat is best (or in a pc game, that works too)
2. if you're going for trim comp or void, either way this script is not stable enough, especially with the lag from 400 people on pc boat, to run unattended, I highly suggest babysitting this; having it open in another window and checking that it doesn't get stuck. The most common part it gets stuck on is that the lag causes it to click the gangplank and barely miss; however, it lags enough to that the text that shows up on the side when you're in the boat isn't there so the script thinks you're in game when you clearly aren't/
3. Highly suggest world 53
4. You want to use mage or ranged for a better chance (it's already pretty good) of getting the 5k damage. Also set ricochet/chain to slot 1, and maybe dragonbreath to 2 if you're doing mage (keep revolution on). I'd highly suggest the t95 prayer + soulsplit on quickprayers
5. start with camera facing north and all the way up
6. fill in your account information in declarePlayers (or remove the procedure + comment it out of the bottom block)


I am NOT going to update this, so if people have problems they can put them here and I can provide suggestions, but I'm not looking to touch this script again as I got sup elite void on this a long while back and don't consider it worth the time when someone will probably release a much better PC script eventually (prob sooner than later)
That being said,

What it does it pretty simple:
1. finds the gangplank by screen coordinates
2. waits in the boat until the game starts
3. runs to the bottom of the map by clicking the minimap twice
4. activates quick prayers and attacks random monsters if the colors match (no guarantees on 5k damage a game though it tends to get it)

What it relies on:
1. probably want to start it in the boat, it'll run well from there (if you uncomment and/or fix the gangplankDTM this probably isn't necessary)
2. other people playing the game properly, not trolling you by shutting the gate; however you still get thaler for doing nothing so if you already have sup elite void you probably don't care about this
3. Just a word of caution, if a ton of people use this in the same PC game, it might look suspicious as a lot of people will be running to the same-ish location, but so many people are at PC now that maybe it won't matter; likewise, if everyone's using this noone will be killing the portals :P

What it doesn't have (and you could probably add):
1. antiban / more consistency checks
2. better walking/any gate interaction
3. portal detection/walking/killing (if someone adds this, I can update this with appropriate credit given)
4. walking back after dying
5. minigame boots claiming/anything, for some reason I never get them


program JRPestControl;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}

var
{gangplankDTM, }colortextDTM, x, y, defilerbuttcolor, greyVeteranColor, torcherwingcolor : integer;
smallbox: TBox;
quickprayericon: TPoint;

//Game needs to max zoom out, facing north.

procedure declarePlayers(); //declare players first and never touch this area again
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'xxxx';
password := 'xxxx';
isActive := true;
isMember := true;
world := 53;
end
currentPlayer := 0;
end;

procedure setup(); //setup my stuff
begin
//gangplankDTM := DTMFromString('mbQAAAHicY2VgYHjPwsDwDIgfAvFNIL4MxPGMDAyxQJwAxIlQui3ZlGFqiS+YnlHmx9CeYsqADTBiwWAAAJoRDHE=');
colortextDTM := DTMFromString('mWAAAAHicY2FgYOAHYmEoLQDE/kBsD8S6QCwPxDP//2e4dzmLIfKSIQMIcKFhRjQMAgByQwda');
greyVeteranColor := 986896;
torcherwingcolor := 1454994;
defilerbuttcolor := 12043973;
smallbox.x1 := 0;
smallbox.x2 := 50;
smallbox.y1 := 0;
smallbox.y2 := 100;
end

function BoxFinder(mouseOverText: array of string; x: integer; y: integer; diff: integer; waitLow: integer = 0; waitHigh: integer = 10): boolean;
begin
if not isLoggedIn then
exit;
//if our mouse is already over the obstacle then just click it (usually works for at least first 3 obstacles)
if isMouseOverText(mouseOverText) then
begin
fastClick(mouse_left);
wait(randomRange(waitLow, waitHigh));
exit(true);
end
if mainscreen.isPlayerAnimating then
begin
wait(randomRange(1000, 1500));
result := BoxFinder(mouseOverText, x, y, waitLow, waitHigh);
exit
end
mouse(x + random(diff), y + random(diff), mouse_move);
if isMouseOverText(mouseOverText) then
begin
fastClick(mouse_left);
wait(randomRange(waitLow, waitHigh));
exit(true);
end
else
exit(false);
end
function ClickObject(color: integer; mouseOverText: array of string; waitLow: integer = 0; waitHigh: integer = 10; pt : TPoint = mainScreen.playerPoint): Boolean
var
x, y, i: integer;
Coords: TBox;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn then
exit;
Coords := mainScreen.getBounds();
Coords.x1 := Coords.x1 + 200;
Coords.y1 := Coords.y1 + 100;
if findColorsSpiralTolerance(x, y, TPA, color, Coords, 20, colorSetting(2, 0.05, 0.52)) then
begin
ATPA := TPA.toATPA(10, 10);
ATPA.sortFromMidPoint(pt); //sorts ATPA from closest to this pt
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(mouseOverText) then
begin
TypeSend('1', false); //specially for this to save runes/arrows!
FastClick(Mouse_Left);
wait(randomRange(1500 + waitLow, 2000 + waitHigh));
Exit(True);
end
if i > 5 then
exit(false);
end
Exit(True);
end
else
begin
Exit(False)
end
end
procedure walkGangPlank();
var
i, x, y: integer;
p: TPoint;
gangbox : TBox;
bankFinding: TTimeMarker;
TPA : TPointArray;
foundGP1, foundGP2 : Boolean;
begin
if not isLoggedIn() then
exit;
if not minimap.findSymbol(p, MM_SYMBOL_MINIGAME, minimap.getBounds()) then begin writeln('didnt find minigame symbol'); exit; end
writeln(findDTM(colortextdtm, x, y, smallbox));
if findDTM(colortextdtm, x, y, smallbox) then begin writeln('we are inside the boat lol'); exit; end
foundGP1 := BoxFinder(['ross', 'ang', 'lan'], 250, 200, 10);
wait(randomrange(800,1200));
foundGP2 := BoxFinder(['ross', 'ang', 'lan'], 250, 200, 10);
//havent found the gangplanks means we should probably fix minimap direction and try it again
if ((not foundGP1) and (not foundGP2)) then begin
minimap.clickCompass;
mainScreen.setAngle(MS_ANGLE_HIGH);
walkGangPlank();
end
end;
//677 173
procedure waitUntilGameStarts();
var
chatbounds : TBox;
begin
if not isLoggedin then exit;
repeat
writeln('waiting for pest control game to start!');
wait(randomrange(800,1100));
until (not findDTM(colortextdtm, x, y, smallbox));

end
//710 170
procedure walkToBottomOfPC();
var
btminipt,p:Tpoint;
TPA: TPointArray;
Coords:TBox;
begin
if not isLoggedin then exit;
if minimap.findSymbol(p, MM_SYMBOL_MINIGAME, minimap.getBounds()) then begin writeln('found minigame symbol in PC'); exit; end
writeln('we are in PC, time to walk to bottom!');
btminipt.x := 680 + random(20);
btminipt.y := 170 + random(12);
Coords := mainscreen.getBounds();
mouse(btminipt, MOUSE_MOVE);
wait(randomRange(500,800));
fastClick(MOUSE_LEFT);
writeln('did first click');
wait(randomRange(1000, 1500));
minimap.waitPlayerMoving();
fastClick(MOUSE_LEFT);
writeln('did 2nd click');
wait(randomRange(1000, 1500));
minimap.waitPlayerMoving();
//turn on quick prayer
quickprayericon.x := 300+random(10);
quickprayericon.y := 395+random(10);
mouse(quickprayericon, MOUSE_MOVE);
fastClick(MOUSE_LEFT);
writeln('turned on quick prayer!');
//wait until new pc game
repeat //in here maybe atk monsters
if not isLoggedin then exit;
wait(randomRange(2000, 6000));
//under 30% is assumed to be 'safely' out of combat
//fight a torcher if available!
if((actionbar.getAdrenalinePercent < 30) and findColorsSpiralTolerance(x, y, TPA, torcherwingcolor, Coords, 20, colorSetting(2, 0.05, 0.52))) then begin
p.x := x;
p.y := y;
writeln('trying to kill a torcher');
clickObject(torcherwingcolor, ['tack']);
end
//fight a defiler if available
if((actionbar.getAdrenalinePercent < 30) and findColorsSpiralTolerance(x, y, TPA, defilerbuttcolor, Coords, 20, colorSetting(2, 0.05, 0.52))) then begin
p.x := x;
p.y := y;
writeln('trying to kill a defiler');
clickObject(defilerbuttcolor, ['tack']);
end
until minimap.findSymbol(p, MM_SYMBOL_MINIGAME, minimap.getBounds());
writeln('PC game ended!');
end

begin
clearDebug(); // Clear the debug box
//smartEnableDrawing := true; // So we can draw on SMART
setupSRL(); // Load the SRL include files
declarePlayers();
setup();

repeat
if not isLoggedIn() then // If player isn't logged in then
begin
players[currentPlayer].login(); // Log them in
exitSquealOfFortune(); // Exit squeal if found
minimap.setAngle(MM_DIRECTION_NORTH); // Make compass north and angle high
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
//writeln(findColorTolerance(x, y, greyVeteranColor, smallbox, 10));

walkGangPlank();
waitUntilGameStarts();
walkToBottomOfPC();
until(false);
end.

Citrus

2015-05-19 15:57:50

Nice release! I already got my silverhawk boots and full void, but I'm sure lots of other people will want to use this.

From: J_R
minigame boots claiming/anything, for some reason I never get them


For a long time I never got these, then I started getting 3-4 per hour. I have like 150 in the bank right now, plus ~20 seals. I have no idea why.

Clarity

2015-05-19 16:24:40

From: evilcitrus
Nice release! I already got my silverhawk boots and full void, but I'm sure lots of other people will want to use this.



For a long time I never got these, then I started getting 3-4 per hour. I have like 150 in the bank right now, plus ~20 seals. I have no idea why.

That's how the reward system works. Once you have won a certain large threshold of games, you are awarded a pair and then the reward rate becomes semi-common and you will never have to play the initial threshold amount again.

Citrus

2015-05-19 16:29:23

From: Clarity
That's how the reward system works. Once you have won a certain large threshold of games, you are awarded a pair and then the reward rate becomes semi-common and you will never have to play the initial threshold amount again.


Makes sense. Kinda wish I would stop getting them though

adc

2015-05-20 22:49:04

Just used this to finish up my 750 thalers, and I have to say - it works surprisingly well. Once I equipped mage gear (hard boat with level 50 attack and 55 strength is no bueno), I easily got my 5k damage just due to auto-retaliation each round. Didn't crash or fail to enter the boat ever unless I interfered with it in some way. It doesn't have a progress report, but I probably used it for a good 10-ish hours, and had no issues.

I was going to work on it and improve it, but I can't really think of anything other than perhaps walking to a random portal. The number of games you don't get attacked by an enemy throughout the entire game is very slim; even if it wouldn't be terribly hard to implement attacking, I don't think - for a point farming script, anyway - it's even really needed.

Buxtons

2015-05-22 08:45:55

I've been using this for the past 30 minutes or so, works fantastically. I'm gonna try add some sort of progress report to it.

Edit: Been using this the whole day, I even maxed out the commendations at 1000. At one point it bugged out and walked down to the middle tier boat, but that was down to lag. Huge thanks to you @J_R this is perfect.

nero_dante

2015-05-22 21:18:48

script works really well. hasn't messed up yet. been running for a few hours. Not sure if its just because I never restart my computer, or whether it because of double points weekend. But the script seems to be using an incredibly large amount of my CPU. Is anyone else realizing this? If not, ill restart my computer haha xD

Buxtons

2015-05-23 07:46:00

From: nero_dante
script works really well. hasn't messed up yet. been running for a few hours. Not sure if its just because I never restart my computer, or whether it because of double points weekend. But the script seems to be using an incredibly large amount of my CPU. Is anyone else realizing this? If not, ill restart my computer haha xD


It's working fine for me.

I made some edits to the script enabling it to select mini game boots as I've got to the stage where I get them every 10-20 games as well as being able to click the plank if the character is not in the correct position, if anyone wants it send me a PM. My edits work but are super crappy, so not going to post it out of pure embarrassment ;)

nero_dante

2015-05-23 16:44:09

never be embarrassed of any scripting you do. The only thing you will gain from posting it is feedback. the whole of SRL is about learning :)

Pompus

2015-05-25 02:50:38

Holy shit this is an amazing script! I really hope it gets slightly maintained afterwards. It ran all night and all day. 2000 points and 80+ thalar.

J_R

2015-05-25 22:07:29

From: Buxtons
I've been using this for the past 30 minutes or so, works fantastically. I'm gonna try add some sort of progress report to it.

Edit: Been using this the whole day, I even maxed out the commendations at 1000. At one point it bugged out and walked down to the middle tier boat, but that was down to lag. Huge thanks to you @J_R this is perfect.

This is the only error I got when I was testing whether this still worked and is why I suggested to babysit it, I'm pretty horrid with getting good DTMs so my attempts to walk on the gangplank with a DTM kinda didn't work well. Someone else could probably easily do it though.

From: nero_dante
script works really well. hasn't messed up yet. been running for a few hours. Not sure if its just because I never restart my computer, or whether it because of double points weekend. But the script seems to be using an incredibly large amount of my CPU. Is anyone else realizing this? If not, ill restart my computer haha xD

I think this is just a thing with RS and maybe Simba in general. I noticed that after running any script for a really long time, teleporting to prif lodestone sometimes causes the screen to black out, most likely due to memory issues in RS, so I'm inclined to believe it's RS.

Although it's possible that the one DTM I use (and just noticed I don't actually free) could be to blame although I doubt it since I don't instantiate it more than once per script run.

From: nero_dante
never be embarrassed of any scripting you do. The only thing you will gain from posting it is feedback. the whole of SRL is about learning :)

This is true. This script is probably one of the most shittily written ones on this forum, I don't think you could do worse even if you tried (assuming it still works of course). There's no reason not to post it right now unless you're doing something which would immediately get your account banned in RS.


Glad all of you found this script useful!