PDA

View Full Version : A Guide to Chopping & Banking



Torrent of Flame
03-03-2008, 07:46 PM
A woodcutting script should obviousley cut wood, but if you want to make it more productive, you want to make it Bank aswell, to earn money or use to fletch.

Thanks Hermpie for making my ChopTree not just close haha.

If you like this tutorial please Rep++

I thought it would be a nice idea to make a tutorial on Banking&Chopping that is up to date, as alot of the chopping tutorials are out of date.


Im taking apart some of my Crusher&Banker Script to show you the basics of making a cutting&banking script.

It wont include walking, etc. This is because this is a Chopping&Banking guide.

Start the script with your program's name.

Program MyWillowBanker

Declare what you wish for the script to include...

{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}

WoodCutting because it is a woodcutting script, but SRL will be explained later on.

Then Declare your x, y co-ordinates.

var x, y: integer;

And declare your Constants(Explained later on)

const

YourPin:='0000'


The procedure for ChopTree is as follows;

Procedure ChopTree;
begin
MakeCompass('S');
repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin
Mouse(x,y,0,0,false);
repeat
Wait(100 + (random(150)));
ChooseOption('hop')
until(InvFull)
end;
until(InvFull)
end;

This requires some explanation, so lets break it down bit by bit.

I named the procedure ChopTree, as this is what it does.

Now it says "MakeCompass('S')" which means as it says, it will make the compass face south. This works for my script because it starts in the bank and it will find the willows easier if you have it facing south, but this can be changed as required.

repeat - repeats the procedure until the inventory is full.

if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin

This means that it looks for the Object "Willow" with the specified colours with a tolerance of 7, tolerance meaning it searches for anything within 7 of the colours. If it finds the Willow it will begin the next part.

Mouse(x,y,0,0,false);

This means that the mouse will find where the "FindObjCustom" found the willows on the x, y axis, and with a 0 tolerance, will hover over the tree, as it is set to "false" so it wont click.

repeat
Wait(100 + (random(150)));
ChooseOption('hop')
until(InvFull)

This means that it will repeat the next part, which waits 100 + a random 150, and then clicks "Chop", but you leave out the capital to get 'hop'. It will repeat the chop clicking until your inventory is full.

end;
until(InvFull)
end;

The first end ends the "Mouse..." procedure, the repeat will repeat the whole procedure until the inventory is full, and the last end ends the whole procedure.

Next we move on to the Banking Procedure.

function Banking: Boolean;
begin
if (InvFull) then
begin
MakeCompass('N')
Wait (300 + random(160));
OpenBankQuiet('db');
if (PinScreen) then
InPin(YourPin);
if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then
begin
Mouse(x, y, 4, 3, false);
ChooseOption('All');
end;
CloseBank;
Wait(150 + random (278));
MakeCompass('S');
end;
end;

This is a little more complicated then the chopping procedure, but we will break this down aswell.

First, we start out function this time, as it is programed to do a specific funtion.

It begins by saying If(InvFull) so it will only bank if the inventory is full. It will make the compass face north, and wait about 460.

OpenBankQuiet('db');
if (PinScreen) then
InPin(YourPin);

OpenBankQuiet is a little more laggy, but will open the bank more like a human would, and the 'db' stands for "Draynor Bank" so 'veb' would stand for "Varrock East Bank"

if (PinScreen) then - this means that if the script picks up the Pin Screen then it will "InPin(YourPin)" so as enters your pin for you. (YourPin would be the constant we declared earlier.)

if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then

This means that if looks for the colour 4155248(The willow logs) between the coordinates of your inventory which are the 4 numbers after, then means that it should do .... after the colour has been found.

begin
Mouse(x, y, 4, 3, false);
ChooseOption('All');
end;

This means it will begin the following. It looks for the colour, and when found it hovers over the willow log in the inventory, and chooses the option 'All' and then ends the part.

CloseBank;
Wait(150 + random (278));
MakeCompass('S');
end;
end;


This Closes the bank after the logs have been deposited, waits about 400, and then makes the compass south ready for the walk back to the willows in my script. The ends again just end the procedure.

Procedure MainLoop;
SetupSRL;
repeat
ChopTree;
Banking;
until(false)
end.

The main loop is something every script needs. We call the procedure "MainLoop" for obvious reasons. SerupSRL sets up SRL for us, which is why we need {.include SRL/SRL.scar} at the start of the script.

Repeat repeats the "ChopTree" and "Banking" until(false) meaning until the script is stopped manually. The End. finished the script completley.



Put all of this together, and imagine that we have the bank right on top of the willows, and you will get a full script.

Program MyWillowBanker&Cutter;

{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}

var x, y: integer;

const
YourPin:='0000'

Procedure ChopTree;
begin
if not LoggedIn then
Exit;
MakeCompass('S');
repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin
Mouse(x,y,0,0,false);
repeat
Wait(100 + (random(150)));
ChooseOption('hop')
until(InvFull)
end;
until(InvFull)
end;

function Banking: Boolean;
begin
if (InvFull) then
begin
MakeCompass('N')
Wait (300 + random(160));
OpenBankQuiet('db');
if (PinScreen) then
InPin(YourPin);
if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then
begin
Mouse(x, y, 4, 3, false);
ChooseOption('All');
end;
CloseBank;
Wait(150 + random (278));
MakeCompass('S');
end;
end;

Procedure MainLoop;
begin
repeat
SetupSRL;
ChopTree;
Banking;
until(false)
end.

Mariuswbz
03-04-2008, 04:48 PM
Really nice. Helped me out a bit :)

- Marius

exppo
03-04-2008, 05:07 PM
No offence Torrent, but on MSN you asked ME how to do some of the stuff you have posted in this thread, I wouldn't have minded if you credited me >.<
Good use of the data :rolleyes:

Exppo..

Torrent of Flame
03-04-2008, 05:11 PM
No I didnt =P

I was asking on FindAxe and BrokenAxe.

And you LEFT and left me with a half modified non compiling script.

Dam you.



EDIT: Give me something that I asked you about from that >.>

ShowerThoughts
03-04-2008, 05:24 PM
one of you is a liar -.-

the bad news:
i will virtual shot you xD


good tut i see some things what you could change:
If not LoggedIn then Exit

this because if you wouldn't do that it will do choptree whil you are not loggedin and that wouldn't be good, or if you sue multiplayer a player yet gained a random and walking to tree then logs out, next play er goes in and starts at ChopTree, okay?

you can quote me ;)

exppo
03-04-2008, 05:27 PM
HermPie wherever I seem to go you are not too far behind

Hmmmm i sense some I.P Stalking ;)
LOL

Torrent, it was either you or someone else, i posted my MSN on someones help needed and got like 500 requests for adding on MSn >.<
Hey im a popular guy :P

Exppo

EDIT: GOOD JOB

Torrent of Flame
03-04-2008, 05:38 PM
Hahaha. No you just spray your MSN anywhere people need help Exppo :D

Thanks hermpie, and im not the liar here!

soul extange
03-06-2008, 10:46 PM
What would be the code for chopping yew's and banking in seer's bank?

Torrent of Flame
03-06-2008, 10:57 PM
I dont know.

I havent coded for up there.

Camaro'
03-07-2008, 10:38 PM
What would be the code for chopping yew's and banking in seer's bank?

Come on, if your going to be a leacher, at least hide it alittle bit.

LOL I mean wtf.

So you want someone to make you a script to cut yews and bank them and then you will post it to get credits..

Torrent of Flame
03-08-2008, 02:10 PM
Thanks cnr.

Codester93
03-09-2008, 03:29 AM
This really helped me, i made a simple oak cutter and banker with this for my friend, although i also had help from a few other tuts, but still u really helped me out with the banking part

Thanx from me and my friend

Torrent of Flame
03-09-2008, 09:43 AM
Glad I could help :]

jiggypwner
03-13-2008, 04:55 PM
Great Tut Helped me with so many other skills ty ty ty

killer_game0
03-14-2008, 01:05 AM
This is a very cool Tut but when I compile it it comes up with a error
this is the error:
Line 12: [Error] (36:1): Identifier expected in script C:\Program Files\SCAR 3.14\includes\SRL/SRL/Core/Globals.scar

I might not have it the same line but I have no clue what this means if some one would tell me I would appreciate it.

Torrent of Flame
03-14-2008, 07:41 AM
Are you on Rev #14?

Did you {.include/SRL/SRL.scar}?

BigTim
03-14-2008, 04:10 PM
Hi

I'm getting the same error as killer_game0 and yes i'm using scar 3.14 and revision 14 and have reloaded all the includes and everything else and the line you said about is included.

Is there anything else you can sugest?

Thanks

Tim

Have had a longer look and have got it to compile now. Using the final putting together of the parts as a starting point.
1. Program name didn't like having a & in it and needs ; at the end
2. In line 9 for the constant declaration the := should be = and needs ; at the end
3. "Procedure MainLoop" should be replaced with "begin"

This still produces a hint saying the variable passed back from Banking isn't used but it now compiles.

Torrent of Flame
03-14-2008, 06:23 PM
The := works for me just fine.


Your right on the Main title, but you dont need to replace procedure, you can just add begin under it.

Edited, thanks.

Cazax
03-29-2008, 05:17 PM
Try using safer banking proc:
Procedure Bank;
begin
if BankScreen then
begin
Deposit(2, 28, 1);
wait(500+random(1000));
CloseBank;
end else
begin
if PinScreen then
begin
InPin('Your pin');
wait(1500+random(1000));
if BankScreen then Deposit(2, 28, 1)// no need to add more failsafes
end else
Writeln('no Bank.');
end;

Things like that.

Torrent of Flame
03-29-2008, 05:25 PM
I suppose I could, but my way got me into SRL Members so :D

But yeah, I could do that.

saosin love
04-01-2008, 01:20 AM
eeek. i think i might be getting in over my head with the bankers
right nowww:eek:

blakeroepke
04-03-2008, 02:28 AM
nice guide, mustve taken a lot of time

Nava2
04-12-2008, 12:57 PM
This guide has helped me a lot; think you could add me on msn? I just need some tips for my fisher, not the same as this but similar.

If you are still kickin could you pm me your msn or vice versa?

Nava2

trav280
04-13-2008, 10:46 PM
Thanks, i made a banker and cutter at fally for oaks. =)

SeanJohn
04-15-2008, 10:36 PM
Nice Script and Tut. Wished it helped explain the walking portion too though. The banking was a nice addition since it was a first time seeing it for me thanks.

Torrent of Flame
04-16-2008, 07:24 PM
I have a full tut out there so.. check it out "UPDATED guide on making a woodcutter :D

jacka scar MASTER
04-24-2008, 03:47 AM
Failed when compiling
Line 7: [Error] (12828:8): is ('=') expected in script
this comes up every time i try to compile can any one help me

spartan6934
04-24-2008, 04:01 AM
sweet

Immaminor
05-17-2008, 03:20 AM
Very nice tut on banking part. Thanks alot man.

Laur€ns
05-18-2008, 07:52 PM
Yay I can bank now :) Thx for taking the time to write this.. Rep+

Griff
07-25-2008, 05:33 PM
Awesome tut, I especially learned a lot about banking, which is basacally why I came here. I will add that to my draynor cutter that I will be releasing soon.

Griff
07-25-2008, 05:36 PM
Jacka Master, That is most likely because when you did the line with the pin in it, you forgot to but the '' around your number.
I'll explain
You most likely have:
YourPin=1234;
You need to have:
YourPin='1234';

Ghostman
07-29-2008, 03:38 AM
good stuff man helped me out

xgrimangel
08-13-2008, 06:32 PM
Nice tut now i know how to bank a little lol btw what would you put if you wanted to go to fally bank like the inititals also if wanted to change willows for trees you would change the color and the willow part right?

bloodyhell321
09-23-2008, 09:38 PM
Thanks alot.

in2it
10-10-2008, 11:05 PM
nice script help me heaps ty

Alligaattor
10-18-2008, 05:32 PM
thx for tut! really good help :D

~BobFm~
10-19-2008, 12:43 AM
helped me a bit I think I will make a varrock cutter. I just need to learn how to walk first and other stuff :)

kylescoulter
04-16-2009, 09:53 AM
ok i copied the whole script to see how it would work so i could try and learn from it. i basically got an error on every line. is this not supposed to work? im really just trying to learn this so i can make my own scripts to do what i need done but all the tutorials i found were outdated.

rya
08-19-2009, 12:39 AM
Thanks this is great help for my first script, why dose making a working one have to be so hard? I'll get the hang of it soon tho i hope

Jewish_Rhapsody
12-29-2009, 06:33 PM
Thanks, but a couple questions! For the find spiral color whatever, how do you know the coordinates. And for the mouse, what des the 2 numbers means? Thanks!

Wanted
12-29-2009, 06:38 PM
Thanks, but a couple questions! For the find spiral color whatever, how do you know the coordinates. And for the mouse, what des the 2 numbers means? Thanks!

You should really start with a beginner tutorial (check sig)

mounty1
01-04-2010, 01:19 AM
hey,
thanks for this really good bit of info here.
im gonna try put it to use and try get a few noob scripts under my belt.
probs start with an oak cutter this week.
nice tut and cheers

null
10-03-2010, 09:22 PM
ok i copied the whole script to see how it would work so i could try and learn from it. i basically got an error on every line. is this not supposed to work? im really just trying to learn this so i can make my own scripts to do what i need done but all the tutorials i found were outdated.


Same deal.

Cstrike
10-06-2010, 02:57 AM
Same deal.

Epic gravedig ;)
Look at the date it was created ;)

SRL is a fast changing community, anything that is older than even 6 months is sometimes out of date. Core knowledge never goes out of date, but certain functions change-- thus most things older than a year may not even compile properly anymore.

If youre stuck on anything, feel free to post in the help threads and myself or others would be glad to assist you :)