SRL Archive - First Scripts

Noobish Willow Chopper


CowFish

2009-04-30 04:28:55

Willow Chopper


Features:
  • Chops Willows
  • Banks Willows
  • Half Decent Antiban

Updates:
  • Added SMART
  • Dark Arcana fixed my standards
  • Camo Kyle fixed WalkToTrees procedure
  • R1ch helped with AntiRandoms
  • All That Is Man helped with Tree Cutting procedure

All that is man

2009-04-30 06:58:39

Good start mate but you should use some more failsafes

I would change:
procedure KillaWilla;
begin
if not LoggedIn then Exit;
repeat
if FindObj(x, y,'illow',WillowColor, 10) then
begin
Mouse(x, y, 2, 3, True);
Wait(2000 + Random(800));
end;
until(InChat('full to'));
end;
to

procedure KillaWilla;
begin
if not LoggedIn then Exit;
repeat
if FindObj(x, y,'illow',WillowColor, 10) then
begin
Mouse(x, y, 2, 3, True);
Wait(2000 + Random(800));
end;
until(InvFull) <----Changed this line
end;
just incase someone says something it might not catch it, also in the procedure above its going to keep on clicking on the same tree over and over. So you might want to change that.

Kyle Undefined

2009-04-30 07:08:31

First of all, not a bad script. Simple and decent for a first one. Here are some things to help :

1) Your walk to willows procedure looks for the bank symbol. You need to change it to tree.
Change :
procedure WalkToWillows;
begin
if not LoggedIn then Exit;
symbolAccuracy := 0.5;
if FindSymbol(x, y, 'bank') then
Mouse(x-33, y+33, 6, 6, True);
end;
To :
procedure WalkToWillows;
begin
if(not LoggedIn)then
Exit;
symbolAccuracy := 0.5;
if FindSymbol(x, y, 'tree') then
Mouse(x-33, y+33, 6, 6, True);
end;

2) Why would you log out if the player is logged in?

3) You kinda have a multiplayer going, but you only have one set in the Declare Players.

4) Work on standards.

Overall, not a bad script. You're getting it. Here is the changed version :)

program WillaKilla;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\WoodCutting.scar}

const
WillowColor = 330249;//Color of Willow; Change this if it won't work.
LoadsPerPlayer = 5;//Loads Per Player(Self-Explanatory) :)

var
x, y, CurrentLoads: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';//Name of Player
Players[0].Pass := '';//Password of Player
Players[0].Nick := '';//3-4 letters from Player's name
Players[0].Active := True;
end;

procedure AntiBan;
begin
if(not LoggedIn)then
Exit;
case Random(36) of
0..5 : RandomRClick;
6..12 : HoverSkill('woodcutting', False);
13..17: BoredHuman;
18..24: PickUpMouse;
25..31: RandomMovement;
32..36: Wait(1750 + Random(500));
end;
end;

procedure ProgressReport;
begin
WriteLn('********************************');
WriteLn('');
WriteLn('Tree Chopper! :)');
WriteLn('');
WriteLn('Worked for ' + TimeRunning);
WriteLn('********************************');
end;

procedure KillaWilla;
begin
if(not LoggedIn)then
Exit;
repeat
if FindObj(x, y, 'illow', WillowColor, 10) then
begin
Mouse(x, y, 2, 3, True);
Wait(2000 + Random(800));
end;
until(InChat('full to'));
end;

procedure WalkToBank;
begin
if(not LoggedIn)then
Exit;
SetRun(True);
symbolAccuracy := 0.5;
if FindSymbol(x, y, 'bank') then
Mouse(x, y, 4, 4, True);
end;

procedure BankWillows;
begin
if(not LoggedIn)then
Exit;
OpenBankQuiet('db');
DepositAll;
CloseBank;
Inc(CurrentLoads);
end;

procedure WalkToWillows;
begin
if(not LoggedIn)then
Exit;
symbolAccuracy := 0.5;
if FindSymbol(x, y, 'tree') then
Mouse(x-33, y+33, 6, 6, True);
end;

begin
SetUpSRL;
DeclarePlayers;
LoginPlayer;
repeat
WalkToWillows;
KillaWilla;
WalkToBank;
BankWillows;
AntiBan;
Wait(3000);
ProgressReport;
if CurrentLoads = LoadsPerPlayer then
NextPlayer(true);
if(not LoggedIn)then
NextPlayer(false);
until IsFKeyDown(12);
end.

~Camo

Blumblebee

2009-04-30 08:15:45

your walking looks very similiar to that of cycrosism's, you should maybe think of crediting him (if it is similar/his). But thats just me, so if I'm wrong then I apologize.

Dark Arcana

2009-04-30 10:58:46

Try adding this to procedure declareplayers

Players[X].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

That solves the reward box from a random event, and also try to learn how to add anti randoms they are not very hard to add.

BobboHobbo

2009-04-30 14:28:50

From: Dark Arcana
Try adding this to procedure declareplayers

Players[X].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

That solves the reward box from a random event, and also try to learn how to add anti randoms they are not very hard to add.


No need to know that as a beginner. Its not a bad script very simple. Add Antirandoms, and learn more advances techniques of scripting then youll be a good scripter.

Also you could add an axe finder and stuff.

CowFish

2009-05-01 01:04:57

Okay guys thanks for all the advice on it and I will change the walking procedure as well. I would of tried to do Antirandoms but I thought those were broken? Also, is there a way for it to slightly randomize when it clicks the tree so that it doesn't click the same spot over and over?

Oh Camo also there is no Tree symbol at Draynor, but I could make it utilize the fishing symbol instead.

Kyle Undefined

2009-05-01 07:51:39

From: banditmeow
Okay guys thanks for all the advice on it and I will change the walking procedure as well. I would of tried to do Antirandoms but I thought those were broken? Also, is there a way for it to slightly randomize when it clicks the tree so that it doesn't click the same spot over and over?

Oh Camo also there is no Tree symbol at Draynor, but I could make it utilize the fishing symbol instead.


Eh, well I don't play RS. So I tried lol. Good luck bro

~Camo

Rich

2009-05-01 22:36:36

Yes, you could use the Fishing symbol, as that is right near the trees.

Anti-randoms are not broken, just add something like this to your script:
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(150) of
0: RandomRClick;
1: BoredHuman;
2: HoverSkill('Attack', False);
end;
end;

procedure AntiRandoms;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
if FindFight then
RunAway('W', True, 1, 5000 + Random(2500));
AntiBan;
end;

CowFish

2009-05-02 17:26:41

Where in the main loop do antirandoms go?

Dark Arcana

2009-05-03 12:14:54

I fixed your standards.

CowFish

2009-05-03 16:35:57

Yay thanks I sorta understand standards but not completely… never used them in my days of php and html. Anyways thanks again I'll update the one in the first post. Added SMART also cause that stuff is the bomb :)

Floor66

2009-05-03 16:49:19

Try using TPA's for tree finding :D
Atleast that's what I'm doing in my script. I also have an auto axe-detector 'n stuff ;)

CowFish

2009-05-03 16:58:42

I don't know much about TPAs but I was wondering if it would be possible for me to include reflection and use GetAnimation to see when the character is chopping a tree, and at that time, perform AntiBan and AntiRandoms, and when the animation stops, it could find a new tree. But I would make the AntiBan very small so it does not always happen such as:

procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(125) of
1:RandomRClick;
2:BoredHuman;
3:AlmostLogout;
4:HoverSkill(Woodcutting, False);
end;
end;

Floor66

2009-05-03 17:06:30

Using reflection gives you less chance of getting SRL members, but makes the script work better…
IMO reflection isn't needed. My script is 100% colour and just checks the UpText of the tree you're chopping, if the uptext doesn't contain "hop" (from Chop) switch trees.

CowFish

2009-05-03 17:16:37

Good point :) I was more planning on using reflection as a sort of, let's say "safety net" in future scripts where more walking would be involved. I don't wanna overdo it with reflection but I would just like to use it to get the character's location and help get it back on track, or for the purposes of animation. I would probably try to use RadialWalk though I haven't gotten it working yet.

Dark Arcana

2009-05-04 12:50:50

If you are trying to apply for membership with this script try reading this TPA/ATPA tutorial.

CowFish

2009-05-04 23:07:52

Thanks for the tutorial but no I don't think I will try to get membership yet I'm going to work on my scripting skills first :)