SRL Archive - First Scripts

My first powerchopper


Malformed

2007-10-11 03:43:43

This script is meant to chop logs behind lumby castle. I would like
to take the opportunity to credit these people from the SRL forums.
Bebe - (For the " All in one beginner tutorial")
Mat_de_b - (For "Mat's Powercutter tutorial")
The_RS_Monkey - ( For the "Making your first woodcutter tutorial")
BamBam - (For the "SCAR scripting official standards")
Metagen - (For the invaluable help in answering my questions.)
And anyone else who feels that they deserve a mention.

{
This script is meant to chop logs behind lumby castle. I would like
to take the opportunity to credit these people from the SRL forums.
Bebe - (For the " All in one beginner tutorial")
Mat_de_b - (For "Mat's Powercutter tutorial")
The_RS_Monkey - ( For the "Making your first woodcutter tutorial")
BamBam - (For the "SCAR scripting official standards")
Metagen - (For the invaluable help in answering my questions.)
And anyone else who feels that they deserve a mention.
}

program Myfirstpowerchopper;
{.include srl/srl.scar}

Const
treecolour1= 1517602; // Colour of tree leaves
treecolour2= 3628668; // Colour of tree bark

var
x, y, l, MyMark, Donotbanme :integer;

Procedure Startcutting;
begin
if(FindObj(x,y,'ree',TreeColour1,25))then
begin
Mouse(x,y,5,5,True);
ClearDebug;
writeln('Walkingtotree');
Flag; //checks for flag on minimap
writeln('CuttingTree');
L:= InvCount;
repeat
Wait(1000+random(1000)); //waits for up to two seconds.
if not (LoggedIn)then
exit;
Until(InvCount > L);
Writeln('TreeHasBeenCut');
if TimeFromMark(MyMark)> (2* 60* 100)then // if its been more than 2 minutes
begin
Logout;
exit;
end;
end;


Procedure startcutting2; // sort of like a failsafe incase the stupid script can't find leaves.
begin
if (FindObj(x,y,'hop', Treecolour2,25))then
begin
Mouse(x, y, 0, 0, False);
if ChooseOption('hop') then
begin
Writeln('walkingtotree')
Flag;
Writeln('CuttingTree')
end;
L:= InvCount;
repeat
until(InvCount > L);
Writeln('TreeCut');
end;
if TimeFromMark(MyMark)> (2* 60* 100)then // if its been more than 2 minutes
begin
Logout;
exit;
end;
end;

procedure AntiBanActions;
begin
Donotbanme:= Random(2);
case Donotbanme of

0 : HoverSkill('random', false);
1 : RandomRClick;
2 : GameTab(1+ Random(13));
end;
end;


procedure antirandoms;
begin
if FindFight then
begin
RunAwayDirection('W');
Wait(12000+ random(15000)); // amount of time to wait
RunBack;
end;
FindLamp('woodcutting');
end;

procedure invcheck;
begin
if InvFull = true then //please wield your axe!
DropAll;
end;


begin
ClearDebug;
SetupSRL;
ActivateClient; // Changes from SCAR to RS
Disguise('www.runescape.com - Mozilla Firefox'); //turns the name from Scar Divi to ~
MouseSpeed := 10 + Random(10);
SetRun(true);
MakeCompass('N');
repeat
StartCutting;
AntiBanActions;
Antirandoms;
FindNormalRandoms;
invcheck;
until (false)
end.

link555

2007-10-18 18:52:08

hmm i will try it out it looks pretty basic though

freedox

2007-11-29 08:10:01

Gratz,now you have learned the basic of scripting and you can make now harder and longer script's:)
GJ anyway m8;)

ecclesiastes

2007-11-29 08:44:05

First of all, It works! So well done. But adding DeclarePlayers Function would be good! ;)

Its quite basic so you will probably be able to add it with no trouble. But!

You may want to add:
{.include SRL/SRL/Skill/Woodcutting.scar}

For easier woodcutting file reference

Womble

2007-11-29 16:12:28

i tried to run it and it said
Line 46: [Error] (14727:1): Identifier expected in script
and i have the latest SRL and all includes, maybe its just me..

thanks,

womble.:D

maogzart

2009-12-25 13:17:17

i don't no how

Markus

2009-12-27 12:22:12

Massive gravedig, thus, closed.