SRL Archive - Jr. Member RS3 Scripts

A simple Prifddinas hide tanner.


adc

2015-06-01 15:39:20

As this is no longer my main moneymaking method, I figured I might as well release my script. This is *very* barebones; it does not support logging in, has no antiban, and runs using TBoxes. That said, I've had no trouble running it for 9k+ hides at a time; occasionally it stops and logs out, so check up on it, but this is very rare and I don't know what causes it.

Features:

Tans 9,000 hides per hour.
Rests at bank if player is below 20% run energy.

Setup:

Start logged in.
Stand one square south of the bank by the hide tanner in Prifddinas.
Face South, camera all the way up, and zoom all the way out, so the tanner is visible in the lower right corner of your main screen. I've attached an image, but it doesn't want to show up here.

program prifHides;

{$DEFINE SMART}
{$I SRL-6/SRL.Simba}

var
hidesDone : integer;

procedure TRSMinimap.rest(); //For resting. Taken from The Mayor on a forum post.
var
p: TPoint;
begin
p := self.button[MM_BUTTON_RUN].center;

if (not self.isResting()) then
begin
mouseCircle(p.x, p.y, self.button[MM_BUTTON_RUN].radius, MOUSE_RIGHT);
chooseOption.select(['Rest']);
print('minimap.rest(): Enabled rest', TDebug.SUB);
end;
end;

function getRunEnergy() : integer;
begin
result := Round((countColorTolerance(931228, minimap.button[MM_BUTTON_RUN].bounds, 50, colorSetting(0)) / 315) * 100);
end;

procedure openBank(); //Opens the bank after tanning hides, withdraws from preset.
begin
if not isLoggedIn then
exit;
MouseBox(intToBox(93, 128, 108, 142), MOUSE_MOVE);
wait(RandomRange(25,75));
if IsMouseOverText(['ank chest', 'chest', 'Use Bank chest'], 500) then
begin
fastClick(MOUSE_LEFT);
if bankScreen.isOpen(6000) then
bankScreen.clickButton(BANK_BUTTON_PRESET_2);
wait(RandomRange(50, 75));
if tabBackpack.isEmpty() then
terminateScript;
if getRunEnergy() <= 20 then
begin
minimap.rest();
wait(RandomRange(75, 150));
while(getRunEnergy() < 95) do
begin
wait(RandomRange(75, 150));
end;
end;
end;
end;

function clickTanner() : boolean; //Clicks the tanner after banking.
begin
if not isLoggedIn then
exit;
result := false;
MouseBox(intToBox(496, 299, 510, 313), MOUSE_MOVE);
if isMouseOverText(['Tanner', 'Ithell'], 1000) then
begin
fastClick(MOUSE_RIGHT);
if chooseOption.select(['an hide', 'Tan hide'], 500) then
result := true;
end;
end;

procedure makeHides(); //Waits until the production screen is open, and then clicks accept.
begin
if not isLoggedIn then
exit;
if productionScreen.isOpen(6000) then
productionScreen.clickStart();
end;

procedure progressReport(); //Prints progress report each load.
begin
clearDebug;
hidesDone := hidesDone + 28;
writeLn('Done: ' + ToStr(hidesDone));
writeLn('Time ran: ' + ToStr(TimeRunning));
end;

procedure doSetup(); //Sets up SRL and opens SMART.
begin
smartShowConsole := false;
disableSRLDebug := true;
setupSRL;
clearDebug;
end;

procedure mainLoop(); //Main loop.
begin
repeat
if clickTanner() then
begin
makeHides();
openBank();
progressReport();
end;
until(not isLoggedIn)
end;

begin
doSetup();
mainLoop();
end.