SRL Archive - First Scripts

GrimTransmutation -


GRIM

2014-12-11 16:38:17

delete

KeepBotting

2014-12-11 16:50:31

Gratz on the release :)

The Mayor

2014-12-11 17:01:44

Nice first script, although, you don't need to close the bank as the preset does it for you :p


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

procedure doBankingStuff();
begin

if bankScreen.open(BANK_CHEST_SHANTAY) then
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
else
writeLn('Are you standing in front of the Shantay Chest?');

end;

procedure craftEnergy();
begin
sendKeys('1', 100, 50); //Lustrous energy better be in actionslot 1
wait(randomRange(1000, 2000));
end;
procedure createYew();
begin
productionscreen.clickStart();
wait(20000);
end;

begin
clearDebug();
setupSRL();

repeat
doBankingStuff(); //opens bank, opens preset 1, waits
craftEnergy(); //opens the Lustrous products
createYew(); //creates yew logs
until false;

end.

rj

2014-12-11 17:36:21

From: The Mayor
Nice first script, although, you don't need to close the bank as the preset does it for you :p


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

procedure doBankingStuff();
begin

if bankScreen.open(BANK_CHEST_SHANTAY) then
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
else
writeLn('Are you standing in front of the Shantay Chest?');

end;

procedure craftEnergy();
begin
sendKeys('1', 100, 50); //Lustrous energy better be in actionslot 1
wait(randomRange(1000, 2000));
end;
procedure createYew();
begin
productionscreen.clickStart();
wait(20000);
end;

begin
clearDebug();
setupSRL();

repeat
doBankingStuff(); //opens bank, opens preset 1, waits
craftEnergy(); //opens the Lustrous products
createYew(); //creates yew logs
until false;

end.


If we really wanted to trim this bad boy down:

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

begin
clearDebug();
setupSRL();
repeat
if bankScreen.open(BANK_CHEST_SHANTAY) then
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
else
writeLn('Are you standing in front of the Shantay Chest?');
sendKeys('1', 100, 50);
wait(randomRange(1000, 2000));
productionscreen.clickStart();
wait(20000);
until false;
end.

GRIM

2014-12-12 21:25:09

@KeepBotting Thanks =)

@The Mayor @Robert
i've updated the script would either of you mind taking a look?

Since 0.1 release
- Added Antiban
- Added FailSafe
- changed up the code a bit

Plans for V1 release
-add to jr+ section
-add gp/hr profit from production loss
-add paint

The Mayor

2014-12-12 21:34:01

Some redundant code in your main loop. I'd do something like this:


program GrimTransmutation; //Version 0.7 Created by GRIM.

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

procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := ''; //Login name here
password := ''; //Password here
isActive := true;
isMember := true;
world := 100; //Logs into world 100.
end
currentPlayer := 0;
end;
// spaces between methods ;)
procedure Antiban();
begin
case random(3) of // 0, 1, 2
0: pickUpMouse();
1: mouseOffClient(OFF_CLIENT_RANDOM);
2: hoverSkill(SKILL_DIVINATION);
end
end;

begin
clearDebug();
setupSRL();
declarePlayers();

repeat

if not isLoggedIn() then // put this block inside repeat loop so you login if lag out
begin
players[currentPlayer].login();
exitTreasure(); // no longer squeal
minimap.setAngle(MM_DIRECTION_EAST);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;

if bankScreen.open(BANK_CHEST_SHANTAY) then
if bankScreen.clickButton(BANK_BUTTON_PRESET_1) then
begin
sendKeys('1', 100, 50);

if productionScreen.isOpen(4000) then
productionscreen.clickStart();

while progressScreen.isOpen(1000) do
begin
antiban();
wait(randomRange(4000, 8000));
end;
end;

until false;
end

GRIM

2014-12-12 23:18:02

MUCH appreciated @The Mayor :D

i was having it wait while the progress screen was open didnt know i didnt need that until you cleaned it up and i realized it was waiting after it finished production

thanks!