SRL Archive - RS3 Outdated / Broken Scripts

Bad Processor's Lumberjack


Bad Processor

2009-09-09 21:53:24

Hey everyone, long time since my last script, this one is a powercutter. I'm still testing it but I have a noob autoing army and they keep getting kelled by dark wizards, and I'd like to hear everyone's say.
Features:
-Big AntiBan
-Big AntiRandoms
-Needs SRL Opendev
-Multiplayer
-Nest finder
-Specify tree type (boring I know, but meh :P)
-Uses DTMs and ATPAs (the latter: not directly but using FindObjTPA, that counts I hope)
-Carries on autoing until user stops or all players are inactive.
-Status reports while cutting
-Progress report, please post!

Enjoy!
[ATTACH]8325[/ATTACH] - 1.01 - Added nest finder, better progress report, added status report while cutting. (GET THIS ONE)
[ATTACH]8321[/ATTACH] - 1.00b - Fixed runaway bug. Thanks, bobzilla69.
[ATTACH]8320[/ATTACH] - 1.00 - First release.

–BP

Bobzilla69

2009-09-09 23:21:23

left username and password in script, changed and pmed you new password

Edit:
Had a look at script and it needs some work.

there is code that can be removed and streamlined a bit more so just keep at it.

try looking at some tutorials

this is a bit more cleaned up for you but can still be improved, good luck

{.Script Info:
# ScriptName = Lumberjack
# Author = Bad Processor
# Description = Cuts down trees of a specified type.
# Version = 1.00
# Date = 9/9/09
# Comments = I'd recommend a combat level of at least 15 if cutting near draynor, the dark wizard gets really annoying.
/Script Info}
program Lumberjack;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/WoodCutting.scar}

// Remember to fill in your players!!!

const
TreeType = 'Oak'; // Types: Tree, Oak, Willow, etc. Capitals please.

//Don't touch below unless you know what you're doing!
var
DLg, Cycles, Randoms, Loads, dvC: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers:= 1; // FILL IN! IMPORTANT
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Integers[0] := 5; // Loads to cut per login cycle.
Players[0].Active := True;

{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[0].Integers[0] := 5; // Loads to cut per login cycle.
Players[1].Active := True;}

WriteLn('Using '+IntToStr(HowManyPlayers) + ' players in script.');
end;

procedure AntiBanRandoms;
var
e:integer;
begin
e:= random(6); //i am sure there is a better antiban you can use
case Random(6) of //simply doing random(num) will do for the case
0..3: SendArrowWait(e, random(3000));
4: PickUpMouse;
5: RandomRClick;
end;
if(FindNormalRandoms) then Randoms := randoms +1;
if(FindFight) then RunAway('W', true, 1, 10000);
if(FindDead) then
begin
WriteLn(Players[CurrentPlayer].Name + ' found dead, switching player...');
NextPlayer(false);
end;
end;

procedure LoadDTMs;
begin
DLg := DTMFromString('78DA63CC646260B8C3800618E1E47F2060CC0' +
'0AAF9805B0D98AE06AA794E404D2C50CD4B026A92806ADE125093' +
'4E847B8A816A6E1250938CDFEF60BA14A8E6350135D94035EFF1A' +
'B010036CF115F'); // All types of logs
end;

procedure CutTrees;
var tx, ty, ocount :Integer;
begin
if(not LoggedIn) then LoginPlayer;
FindObjTPA(tx, ty, 1659461, 25, 25, 50, 50, 10, ['down '+TreeType, TreeType]);
OCount := InvCount;
Mouse(tx, ty, 3, 3, True);
AntiBanRandoms;
repeat
Wait(random(100)); //dont understand this bit, why are you running away?
RunAway('W', true, 1, 10000);
until(ocount <> InvCount); //will only do this once?
end;

procedure CutAllTreesAndDrop;
begin
repeat
CutTrees;
until(InvFull);
ClickAllItems('dtm', DLg, 'Drop', Random(250), []);
Loads := loads + 1;
end;

procedure ProgressReport;
var
h, m, s :Integer;
begin
ClearDebug;
WriteLn('Lumberjack by Bad Processor');
ConvertTime(GetTimeRunning, h, m, s);
WriteLn('Time running: '+inttostr(h)+' hours, '+inttostr(m)+' minutes, '+ inttostr(s)+' seconds.');
WriteLn('Randoms encountered: '+inttostr(Randoms));
WriteLn('Number of total players: '+inttostr(HowManyPlayers));
WriteLn('Total loads completed: '+inttostr(Loads));
WriteLn('Total logins done: '+inttostr(dvC));
WriteLn('Please post this progress report, thanks!');
end;

Procedure MainLoop;
Begin
repeat
LoginPlayer;
for cycles := 1 to Players[CurrentPlayer].Integers[0] do
begin
CutAllTreesAndDrop;
AntiBanRandoms;
end;
dvC := dvC + 1;
until(AllPlayersInactive);
end;

begin
SetupSRL;
SetupWoodcutting;
LoadDTMs;
DeclarePlayers;
MainLoop; //Main procedure for doing everything
ProgressReport;
FreeDTM(DLg);
end.

Bad Processor

2009-09-09 23:49:10

Ahrite, see about the testing bit? :P
//will only do this once?
Actually, it will loop until it detects a change in the inventory. This is why this script isn't good for trees you gan get loads of logs out of yet.
//simply doing random(num) will do for the case
Wrong again :P It needs to remember the variable for the SendArrowWait part.
The other bit about the running away, is now fixed. Thanks, i didn't notice that :)

–BP

Bobzilla69

2009-09-10 00:00:06

From: Bad Processor
Ahrite, see about the testing bit? :P
//will only do this once?
Actually, it will loop until it detects a change in the inventory. This is why this script isn't good for trees you gan get loads of logs out of yet.
//simply doing random(num) will do for the case
Wrong again :P It needs to remember the variable for the SendArrowWait part.
The other bit about the running away, is now fixed. Thanks, i didn't notice that :)
–BP


i did notice the SendArrowWait part thats why its still in there, i had the random so that they are diffrent.

also the running away part will simply keep looping wont it, as the inventory wont change, you keep running no? ignore, miss read code

will edit when i looked over script some more

Edit:

Have a look over the changes i made compared to yours noticed how the spacing is? thats the standars needed for scripts

makes the code much easier to read.

you might want to add some ent finding and a birdnest finder but thats up to you




{.Script Info:
# ScriptName = Lumberjack
# Author = Bad Processor
# Description = Cuts down trees of a specified type.
# Version = 1.00
# Date = 9/9/09
# Comments = I'd recommend a combat level of at least 15 if cutting near draynor, the dark wizard gets really annoying.
/Script Info}
program Lumberjack;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/WoodCutting.scar}

// Remember to fill in your players!!!

const
TreeType = 'Oak'; // Types: Tree, Oak, Willow, etc. Capitals please.

//Don't touch below unless you know what you're doing!
var
DLg, Cycles, Randoms, Loads, dvC: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers:= 1; // FILL IN! IMPORTANT
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Integers[0] := 5; // Loads to cut per login cycle.
Players[0].Active := True;

{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[0].Integers[0] := 5; // Loads to cut per login cycle.
Players[1].Active := True;}

WriteLn('Using '+IntToStr(HowManyPlayers) + ' players in script.');
end;

procedure AntiBanRandoms;
begin
case Random(6) of //boredhuman is quite good
0,1,2,3: BoredHuman; //i would use a diffrent anti ban, but that just me
4: PickUpMouse;
5: RandomRClick;
end;
if(FindNormalRandoms) then Randoms := randoms +1;
if(FindFight) then RunAway('W', true, 1, 10000);
if(FindDead) then begin
WriteLn(Players[CurrentPlayer].Name + ' found dead, switching player...');
NextPlayer(false);
end;
end;

procedure LoadDTMs;
begin
DLg := DTMFromString('78DA63CC646260B8C3800618E1E47F2060CC0' +
'0AAF9805B0D98AE06AA794E404D2C50CD4B026A92806ADE125093' +
'4E847B8A816A6E1250938CDFEF60BA14A8E6350135D94035EFF1A' +
'B010036CF115F'); // All types of logs
end;

procedure CutTrees;
var
tx, ty, ocount :Integer;

begin
if(not LoggedIn) then LoginPlayer;
FindObjTPA(tx, ty, 1659461, 25, 25, 50, 50, 10, ['down '+TreeType, TreeType]);
OCount := InvCount;
Mouse(tx, ty, 3, 3, True);
AntiBanRandoms;
repeat
Wait(random(1500)); //change to a higher amount so it doesnt keep looping to much (can keep is low i suppose)
if(FindFight) then RunAway('W', true, 1, 10000);
until(ocount <> InvCount);
end;

procedure CutAllTreesAndDrop;
begin
repeat
CutTrees;
until(InvFull);
ClickAllItems('dtm', DLg, 'Drop', Random(250), []);
Inc(Loads); //adds one onto Loads
end;

procedure ProgressReport;
var
h, m, s :Integer;

begin
ClearDebug;
WriteLn('Lumberjack by Bad Processor');
WriteLn('Time running: '+TimeRunning); //used in my scripts to get running time
WriteLn('Randoms encountered: '+inttostr(Randoms));
WriteLn('Number of total players: '+inttostr(HowManyPlayers));
WriteLn('Total loads completed: '+inttostr(Loads));
WriteLn('Total logins done: '+inttostr(dvC));
WriteLn('Please post this progress report, thanks!');
end;

procedure MainLoop; //Seperate procedure for main loop of procedures
begin
repeat
LoginPlayer;
for cycles := 1 to Players[CurrentPlayer].Integers[0] do
begin
CutAllTreesAndDrop;
AntiBanRandoms;
end;
Inc(dvC);
until(AllPlayersInactive);
end;

begin
SetupSRL;
SetupWoodcutting; //what does it actually load??? nothing i think
LoadDTMs;
DeclarePlayers;
MainLoop;
ProgressReport;
FreeDTM(DLg); // you free DTM after use which is good
end.

Tickyy

2009-09-10 00:45:27

Not bad, improve your standards.

Bad Processor

2009-09-10 19:28:27

Standard? I'm sure as hell NOT standard :P
On a more serious note, I read a few standard guides and I thaught that was how it's meant to be. Oh well, I'm sure I've made it a tad better in 1.01, at least I hope so. What was your progress report, btw? I'd be interested to know.

–BP

Bobzilla69

2009-09-10 20:35:47

hi again, script is getting there still ogt some things to do.

i have looked over it and made some cnahges, have alook at the comments and if you dont undertand what i did just ask.

the script i am posting has standards, so try and stick to what i have done.


{.Script Info:
# ScriptName = Lumberjack
# Author = Bad Processor
# Description = Cuts down trees of a specified type.
# Version = 1.00
# Date = 9/9/09
# Comments = I'd recommend a combat level of at least 15 if cutting near draynor, the dark wizard gets really annoying.
/Script Info}
program Lumberjack;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/WoodCutting.scar}

// Remember to fill in your players!!!

const
TreeType = 'Tree'; // Types: Tree, Oak, Willow, etc. Capitals please.
ScriptVer = '1.01'; // Don't change

//Don't touch below unless you know what you're doing!
var
DLg, Cycles, Randoms, Loads, dvC, dvN, dvT: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers:= 1; // FILL IN! IMPORTANT
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Integers[0] := 5; // Loads to cut per login cycle.
Players[0].Active := True;

{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[0].Integers[0] := 5; // Loads to cut per login cycle.
Players[1].Active := True;}

WriteLn('Using '+IntToStr(HowManyPlayers) + ' players in script.');
end;

procedure AntiBanRandoms;
begin
case Random(6) of
0..3: BoredHuman; // the .. means from 0 to 3 so you dont list them all, bored human is better than what you had
4: PickUpMouse;
5: RandomRClick;
end;
if(FindNormalRandoms) then Randoms := randoms +1;
if(FindFight) then RunAway('W', true, 1, 10000);
if(FindDead) then begin
WriteLn(Players[CurrentPlayer].Name + ' found dead, switching player...');
NextPlayer(false);
end;
end;

procedure LoadDTMs;
begin
DLg := DTMFromString('78DA63CC646260B8C3800618E1E47F2060CC0' +
'0AAF9805B0D98AE06AA794E404D2C50CD4B026A92806ADE125093' +
'4E847B8A816A6E1250938CDFEF60BA14A8E6350135D94035EFF1A' +
'B010036CF115F'); // All types of logs
end;

procedure CutTrees;
var
tx, ty, ocount, tstart, tend, FoundFight, FoundNest:Integer;

begin
if(not LoggedIn) then LoginPlayer;
OCount := InvCount; //need to have before cutting starts incase its a quick cut
if FindObjTPA(tx, ty, 1857098, 25, 25, 50, 50, 10, ['down '+TreeType, TreeType]) then
begin //using the if statement it will mean we can controle the script better
MMouse(tx, ty, 3, 3) //move mouse to color found spot
Wait(500+random(500));
GetMousePos(tx, ty); //get the position of mouse for later
if IsUpText(TreeType)then //checks the up text as a fail safe so we dont click for no reason
begin //if up text is there then we continue
Case Random(8) of
0..3: Mouse(tx, ty, 0, 0, true); //normal click mouse
4..7: begin
Mouse(tx, ty, 0, 0, false); //right clicks and then chooses chop down option
ChooseOption('down');
end;
end;
end;
end;
AntiBanRandoms;
tstart := GetTimeRunning;
repeat
Wait(random(100));
if(FindFight) then
begin
RunAway('W', true, 1, 10000);
inc(FoundFight) // allos us to count fights instead of just 0 or 1
end;
until(ocount <> InvCount) or (tstart > 12000); //its is actually an infinite loop, miss click will cause this ,
//the tstart > 12000 will exit is chopping takes longer than 12 seconds, but will simply restart chopping again
tend := GetTimeRunning - tstart;
if FindBirdsNest then inc(FoundNest); //if we find and deal with it then add one to foundnest
ClearDebug;
WriteLn('Lumberjack '+ScriptVer+' by Bad Processor');
WriteLn('Trees cut so far: '+inttostr(dvT));
WriteLn('Found nest in this tree: '+inttostr(FoundNest));
WriteLn('Found fight: '+inttostr(FoundFight));
WriteLn('Time taken to cut tree: '+inttostr(floor(tend / 1000))+' seconds');
end;

procedure CutAllTreesAndDrop;
begin
repeat
CutTrees;
inc(dvT); //adds one to it same as dvT:= + 1; just shorter code
until(InvFull);
ClickAllItems('dtm', DLg, 'Drop', Random(250), []);
inc(Loads);
end;

procedure ProgressReport;
begin
ClearDebug;
WriteLn('Lumberjack '+ScriptVer+' by Bad Processor');
WriteLn('Time running: '+TimeRunning); //time since you started script
WriteLn('Randoms encountered: '+inttostr(Randoms));
WriteLn('Number of total players: '+inttostr(HowManyPlayers));
WriteLn('Total loads completed: '+inttostr(Loads));
WriteLn('Total logins done: '+inttostr(dvC));
WriteLn('Total nests found: '+inttostr(dvN));
WriteLn('Total trees cut: '+inttostr(dvT));
WriteLn('Please post this progress report, thanks!');
end;

procedure MainLoop; //its good to have a seperate procedure for main loop
begin
repeat
LoginPlayer;
SetAngle(True);
Wait(500); //small wait to get screen still
for cycles := 1 to Players[CurrentPlayer].Integers[0] do
begin
CutAllTreesAndDrop;
AntiBanRandoms;
end;
inc(dvC);
until(AllPlayersInactive);
end;

begin
SetupSRL;
SetupWoodcutting;
LoadDTMs;
DeclarePlayers;
MainLoop; //calls main procedure
ProgressReport;
FreeDTM(DLg);
end.

script still has flaws but atleast it gives you some more to think about

Tickyy

2009-09-10 20:59:25

i didn't run it, just took a look on it.

Bad Processor

2009-09-10 21:34:18

BobZilla69, the FindFight and FindNest are local, they indicate if, while cutting that specific tree, they found a fight or a nest, thats why they are booleans.
Wait(500); << Not very random, but I'll add it into it and ok.
The OCount := invcount; is before the Mouse() procedure anyway, so thats okay.
Why lengthen the CutTrees procedure by checking the UpText again? Seems to have no point and it might have changed if the mouse had moved away by then.
Bored Human actually does stuff 10 times. Now people don't random click stuff 10 times while cutting 1 tree I'm sure. In the first versions I used BoredHuman and I found it too non-humanlike.
With the TimeRunning - I'm sure you mean GetTimeRunning, and I'd rather have it kinda show hours, minutes, seconds instead of milliseconds for how long it was running.
So thanks for the help, but no offence you don't seem to be catching the drift of the script. I'll fix a few of of the mistakes you pointed out but a few of them are better left as they are. Sorry for wasting your time.

–BP

Bobzilla69

2009-09-10 21:49:52

From: Bad Processor
BobZilla69, the FindFight and FindNest are local, they indicate if, while cutting that specific tree, they found a fight or a nest, thats why they are booleans.
Wait(500); << Not very random, but I'll add it into it and ok.
The OCount := invcount; is before the Mouse() procedure anyway, so thats okay.
Why lengthen the CutTrees procedure by checking the UpText again? Seems to have no point and it might have changed if the mouse had moved away by then.
Bored Human actually does stuff 10 times. Now people don't random click stuff 10 times while cutting 1 tree I'm sure. In the first versions I used BoredHuman and I found it too non-humanlike.
With the TimeRunning - I'm sure you mean GetTimeRunning, and I'd rather have it kinda show hours, minutes, seconds instead of milliseconds for how long it was running.
So thanks for the help, but no offence you don't seem to be catching the drift of the script. I'll fix a few of of the mistakes you pointed out but a few of them are better left as they are. Sorry for wasting your time.

–BP

The reason i lethining the CutTree Procedure was to add a failsafe for missclicking the tree and getting stuck in a infinateloop you have, its not perfect but lowers the change of it happening.

in the rewriten version i gave you i moved the OCount := invcount; to match the changes i made.

as for the boredhuman, its fair enough, i prefer using it but thats just me.

as for the TimeRunning, it doesnt show it as miliseconds it shows it in your format which saves you doing it (hours, minutes, seconds).

you didnt waste my time, i could have simply not replyed so dont worry about it.