SRL Archive - News and General

SRL Scripting = Hard? Indeed.


Torrent of Flame

2008-12-18 16:16:45

I never realised how hard scripting was.. This is my last script I can find and I dont understand a thing. It doesn't work either, which is lame :o

{//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\///
|Title: The Anywhere Power Cutter |
|By: Torrent of Flame |
|Scar/Revision: Scar 3.14 SRL 4.0 Rev 14 |
|Version: Version 1.1 |
|Description: The Anywhere Power Cutter will cut any tree from the following |
| and will drop them: |
| - Normal |
| - Oak |
| - Willow |
| - Maple |
| - Yew |
| - Magic |
| - Random (Chops all of the trees) |
| |
|Setup: Enter your SRL ID and Password at lines 26 and 27, and choose an empty |
| world for SMART to run on. Then Declare your players at lines 45 - 57 |
| (More players can be added if necissary)Make sure you enter your tree |
| type all LOWER CASE. Make sure your character is logged out and in a |
| place near to where your trees are. There are several areas good for |
| trees: |
| 'Normal' - South of Seers Village Bank, past the Maple Trees(P2P) |
| Lumbridge Swamp(F2P) |
| 'Oak' - Not quite sure of a good Oak area |
| 'Willows' - Draynor or Port Sarim (Recommend Draynor - More Trees) |
| 'Maples' - The Sinclar Mansion, or behind Seers Bank. (P2P) |
| 'All' - Somewhere near loads of trees, basically. |
| |
| //You probably wont set it to run and drop Yews or Magics, but...\\ |
| 'Yews' - North of Varrock Castle (F2P) |
| Catherby Trees (West of Candle Salesman)(P2P) |
| 'Magic' - South-West of Seers Village (P2P) |
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
|Version 1.1 Updates: |
| - Cutting TPA's |
| - Better Tree Finding |
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\}

Program AnyWherePowerChopper;
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}

const{//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\/}
{//---------------------------//---> SRL ID <---\\---------------------------\\}
YourSRLId = '';
YourSRLPassword ='';
{''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''}
{//-----------------------------//SMART World\\------------------------------\\}
{//------------------------\\} SMARTWorld = 152; {//-------------------------\\}
{''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''}

{------------------------------------------------------------------------------}
{--------------------------------// Player Setup \\----------------------------}
{------------------------------------------------------------------------------}

procedure DeclarePlayers;
begin

HowManyPlayers := 1; //How many Players
NumberOfPlayers(HowManyPlayers);
CurrentPlayer :=0; //Starting Player

Players[0].Name := 'h';
Players[0].Pass := 'e';
Players[0].Nick := 'l';
Players[0].Active := True;
Players[0].Integers[0]:= 10; //Loads to Do;
Players[0].Strings[1] := 'p';

{ Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := False;
Players[1].Integers[0]:= 10; //Loads to Do;
Players[1].Strings[1] := 'oak'; }

{ Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
Players[2].Integers[0]:= 10; //Loads to Do;
Players[2].Strings[1] := 'willow';

Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := True;
Players[3].Integers[0]:= 10; //Loads to Do;
Players[3].Strings[1] := 'maple';

Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Active := True;
Players[4].Integers[0]:= 10; //Loads to Do;
Players[4].Strings[1] := 'yew';

Players[5].Name := '';
Players[5].Pass := '';
Players[5].Nick := '';
Players[5].Active := True;
Players[5].Integers[0]:= 10; //Loads to Do;
Players[5].Strings[1] := 'magic';

Players[5].Name := '';
Players[5].Pass := '';
Players[5].Nick := '';
Players[5].Active := True;
Players[5].Integers[0]:= 10; //Loads to Do;
Players[5].Strings[1] := 'any'; }

end;

{/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}
{----------------------------Do Not Edit Below This----------------------------}
{/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}

var x, y, i, LoadsNum2, BrokenAxe, BrokenAxes, CuttingTime, Tries, MagicLoads, YewLoads, MapleLoads: integer;
NormalLoads, OakLoads, WillowLoads, Anything, WillowLog, NormalLog, MagicLog, YewLog, OakLog, MapleLog : integer;

//Load DTM's\\

procedure LoadDTMs;
begin
BrokenAxe := DTMFromString('78DA636C616260E0636440061D697C601A26C' +
'AD80354C38FAA06260B57D30754C34D404D2F508D080135CD4035' +
'5C04D4D400D5A8E05703008C0604B4');

WillowLog:= DTMFromString('78DA6314626060E06540010E56A20CFF81342' +
'310FF07024616204300554D7AAC19986684F219398184180135A2' +
'404218558DAF8B24AA1A5920C18FE91E1435E2408209558DAD991' +
'0AA1A4120C182AAC6D516CD1C3620C18DDFCD00DCA30BC3');

MagicLog := DTMFromString('78DA6314646060106040015141BA609A11CA6' +
'71407121CA86A0A32DC50D54802097E5435EE0ECAA86A64818428' +
'AA9ADC345754357C40420A554D668219AA1A4E20218EAA466EE12' +
'454354C404204554DB0A702AA1A664C35B7EFDF435503F2372FAA' +
'1A99E99DA86A4061C885AAA6AAD017558D28A65D3F7E2C4451030' +
'05EBD0FE1');

YewLog := DTMFromString('78DA63E4656060E0614001899E9C609A11CA6' +
'7940412CC0C688011530D9A3931AE68E6C80009215435CE860CA8' +
'6AF880842801F7B00309115435ED79F6A86A9831ED6AC9B1C554C' +
'387AAA6ABD001550D2B90E0226017C83DEC04EC1200126CF8C307' +
'00F93B0A62');


OakLog := DTMFromString('78DA6314626060E06740013DB94E609A11CA6' +
'7640312ECA86A56742660AAE14555D3986C83AA86054808A2AA59' +
'D81C83AA860B4888A19993A08FAA8609D3CDEBFB9251D5C800092' +
'15435A9BE7AA86A8431D54C2A744555230524B851D5D4255AA1AA' +
'110512ACA86ADA33EC51D5F061866157B6038A1A00D39F0F05');


NormalLog := DTMFromString('78DA63E4636060E0614001D9C186609A11CA6' +
'764C15453136F85AA06640E1BAA9A96345B5435A240820355CDA4' +
'4257543532404210554D5D229A5DE240420855CDD4123473B8818' +
'41801356C98E6A479ABA2AA1101124CA86A12BDF550D54800092E' +
'543579A1C6286A008EA30C05');

MapleLog := DTMFromString('78DA6314606060E061400111369C609A11CA6' +
'71403124CA86A129DD0D4C80009215435BEA6686AC481041BAA9A' +
'3457343520338451D514FAF2A1AAE1061222A86ACA02D1D480EC1' +
'140B3CB5B15550D27A69BBBD30D51D580FCCD8BAA6642B629A65D' +
'ACA86AAAA37450D580CC604155E36988EA77005BE80A0C');

end;

//Signature\\

procedure Signature;
begin
ClearDebug;
wait(250 + random(30));
writeln('-------Torrents AnyWhere Power Chopper-------');
wait(250 + random(30));
writeln(' ______ __ ');
wait(250 + random(30));
writeln(' /_ __/__ ___________ ___ / /_ ');
wait(250 + random(30));
writeln(' / / / _ \/ __/ __/ -_) _ \/ __/ ');
wait(250 + random(30));
writeln(' /_/ \___/_/ /_/ \__/_//_/\__/ ');
wait(250 + random(30));
writeln(' ');
writeln('---------------------------------------------');
wait(500 + random(30));
end;

//Torrent Proggy\\

procedure ToFProggy;
begin
ClearDebug;
Writeln(',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,');
Writeln('/\Please Post Progress Reports & Any problems /\ ');
Writeln('/\ From Wherever you got the script /\ ');
Writeln('//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ ');
Writeln('//\\Worked For: ' + TimeRunning + ' //\\');
Writeln('//\\Cut: ' + IntToStr(WillowLoads)+ ' Willow Trees //\\');
Writeln('//\\Cut: ' + IntToStr(OakLoads)+ ' Oak Trees //\\');
Writeln('//\\Cut: ' + IntToStr(NormalLoads)+ ' Normal Trees //\\');
Writeln('//\\Cut: ' + IntToStr(YewLoads)+ ' Yew Trees //\\');
Writeln('//\\Cut: ' + IntToStr(MagicLoads)+ ' Magic Trees //\\');
Writeln('//\\Cut: ' + IntToStr(MapleLoads)+ ' Maple Trees //\\');
Writeln('//\\Cut: ' + IntToStr(Anything)+ ' Random Trees //\\');
Writeln('//\\Broke: ' + IntToStr(BrokenAxes)+ ' Axes //\\');
Writeln('//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ ');
Writeln('//\\ Thanks for Using my Script :D //\\ ');
Writeln('```````````````````````````````````````````````');
end;

//--------------------------------Anti-Ban!!------------------------------------\\
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: PickUpMouse;
6: AlmostLogout;
7: DoEmote(400 +Random(90));
8: begin
GameTab(1 +Random(12));
wait(2000 +Random(1000));
GameTab(4);
end;
end;
end;

//------------------------------Anti-Randoms!!------------------------------\\

procedure FindRandoms;
begin
FindTalk;
FindNormalRandoms;
FindLamp('Woodcutting');
SolvePinball;
FindEnt(x, y, true);
end;


//Ent Finder\\

function EntFinder: Boolean; //By p1nky
var
Counter : Integer;
begin
if Not(LoggedIn) then Exit;
Counter := 0;
While Counter < 8 do
begin
i := GetColor(86 + Counter, 17);
Counter := Counter + 1;
if SimilarColors(i,119764,60) then
begin
Result := True;
Writeln('We found an ent!! Trying to avoid now..');
RunTo('W',True);
Mouse(648, 84, 3, 3, true);
Flag;
FTWait(60 + Random(5));
begin
Writeln('Whew! We avoided the ent.. Carrying on with chopping');
Exit;
end;
end;
Result := False;
end;
end;

//---------------------------------IsAxeBroken?--------------------------------\\

Procedure IsAxeBroke;
begin
if FindDTM(BrokenAxe, x, y, 547, 206, 734, 464) then
begin
if FindDTM(BrokenAxe, x, y, 547, 206, 734, 464) then
begin
BrokenAxes := BrokenAxes +1;
ReportVars[0] := ReportVars[0] + 1;
LogOut;
NextPlayer(False);
LoadsNum2 := 0;
Writeln('Players Switched successfully')
end;
end;
end;

//--------------------------------- Find A Tree ------------------------------\\

function FindATree: boolean;
begin
if (Players[CurrentPlayer].Strings[1] = 'willow') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 3760987, 15, -1, 5, 5, 14, ['Willow'])then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 3760987, 15, -1, 5, 5, 14, ['Willow']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
WillowLoads := WillowLoads + 28;
ReportVars[1] := ReportVars[1] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'oak') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 1381047, 15, -1, 5, 5, 14, ['Oak']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 1381047, 15, -1, 5, 5, 14, ['Oak']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Oak Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
OakLoads := OakLoads + 28;
ReportVars[2] := ReportVars[1] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'normal') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 2122071, 15, -1, 5, 5, 14, ['Tree']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 2122071, 15, -1, 5, 5, 14, ['Tree']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Normal Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
NormalLoads := NormalLoads + 28;
ReportVars[3] := ReportVars[3] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'yew') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 3230274, 15, -1, 5, 5, 14, ['Yew']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 3230274, 15, -1, 5, 5, 14, ['Yew']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Yew Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
YewLoads := YewLoads + 28;
ReportVars[4] := ReportVars[4] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'magics') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 11919079, 15, -1, 5, 5, 14, ['Magic'])then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 11919079, 15, -1, 5, 5, 14, ['Magic']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Yew Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
MagicLoads := MagicLoads + 28;
ReportVars[5] := ReportVars[5] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'maple') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 24459, 15, -1, 5, 5, 14, ['Maple']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 24459, 15, -1, 5, 5, 14, ['Maple']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
MapleLoads := MapleLoads + 28;
ReportVars[6] := ReportVars[6] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'all') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 11919079, 15, -1, 5, 5, 14, ['Magic']) or
FindObjTPA(x, y, 2122071, 15, -1, 5, 5, 14, ['Tree']) or
FindObjTPA(x, y, 11919079, 15, -1, 5, 5, 14, ['Oak']) or
FindObjTPA(x, y, 3760987, 15, -1, 5, 5, 14, ['Willow']) or
FindObjTPA(x, y, 24459, 15, -1, 5, 5, 14, ['Maple']) or
FindObjTPA(x, y, 3230274, 15, -1, 5, 5, 14, ['Yew']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
Anything := Anything + 28;
ReportVars[7] := ReportVars[7] + 1;
end;
end;

//PowerDrop\\

procedure PowerDrop;
var i: integer;
begin
if not (LoggedIn) then Exit;
for i := 2 to 28 do
begin
if FindDTM(NormalLog, x, y, 547, 206, 734, 464) or
FindDTM(OakLog, x, y, 547, 206, 734, 464) or
FindDTM(WillowLog, x, y, 547, 206, 734, 464) or
FindDTM(MapleLog, x, y, 547, 206, 734, 464) or
FindDTM(YewLog, x, y, 547, 206, 734, 464) then
begin
DropItem(i);
end;
end;
end;

//Setup Script\\

procedure DoOnce;
begin
SmartSetupEx(SMARTWorld, false, true);
SetTargetDC(SmartGetDC);
while not SmartReady do Wait(2000);
SRLId := YourSRLId;
SRLPassword:= YourSRLPassword;
SetupSRL;
ScriptID:= '755';
Signature;
DeclarePlayers;
LoadDTMs;
LoginPlayer;
end;

//Cutting and Dropping Loop\\

procedure RepeatThis;
begin
ChopTheTrees;
PowerDrop;
end;

//Final Loop\\

procedure FinalLoop;
begin
DoOnce;
RepeatThis;
end;

//The Execution\\

begin
FinalLoop;
end.


If someone could fix it or something and then annotate the fixings so I can see what the heck they did. I wouldn't mind getting back into scripting to be honest, but I think SRL was at like 14 when I left and Reflection has come out since then and I dont know about that either..


~ ToF

NiCbaZ

2008-12-18 16:33:25

imho - to understand scripting all you need to know is basical algebra..


var
x: Integer;

begin
X:= 6 + 10 / 3;


And the basical syantax of the Delphi/SCAR script as in begins ends, looping etc…

like


Repeat
This
until False;


for i:= 1 to 30 do
Inc(x);

Like that will repeat that 30 times..

Im sure you know all this but imo all you need to do is understand the syntax…

Some people say you can script if you can do RRW… man if you understand the syntax of SCAR ofc you could do RRW its just a few values of angles inside some parameters…


But scar is a fairly hard language, compering it to delphi, i think its much harder…

Torrent of Flame

2008-12-18 16:47:12

Lol. You lost me there NiCbaZ.

Dervish

2008-12-18 16:49:50

Torrent not much has changed to be honest, just check through the SRL Includes folder.

You still know the basic stuff ?

DTMs, BMPs, RW RRW, Looping, Failsafes….

I never even knew you were gone… Anyways, you just need to lurk around in Tut island section.

NiCbaZ

2008-12-18 17:09:24

{//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\///
|Title: The Anywhere Power Cutter |
|By: Torrent of Flame |
|Scar/Revision: Scar 3.14 SRL 4.0 Rev 14 |
|Version: Version 1.1 |
|Description: The Anywhere Power Cutter will cut any tree from the following |
| and will drop them: |
| - Normal |
| - Oak |
| - Willow |
| - Maple |
| - Yew |
| - Magic |
| - Random (Chops all of the trees) |
| |
|Setup: Enter your SRL ID and Password at lines 26 and 27, and choose an empty |
| world for SMART to run on. Then Declare your players at lines 45 - 57 |
| (More players can be added if necissary)Make sure you enter your tree |
| type all LOWER CASE. Make sure your character is logged out and in a |
| place near to where your trees are. There are several areas good for |
| trees: |
| 'Normal' - South of Seers Village Bank, past the Maple Trees(P2P) |
| Lumbridge Swamp(F2P) |
| 'Oak' - Not quite sure of a good Oak area |
| 'Willows' - Draynor or Port Sarim (Recommend Draynor - More Trees) |
| 'Maples' - The Sinclar Mansion, or behind Seers Bank. (P2P) |
| 'All' - Somewhere near loads of trees, basically. |
| |
| //You probably wont set it to run and drop Yews or Magics, but...\\ |
| 'Yews' - North of Varrock Castle (F2P) |
| Catherby Trees (West of Candle Salesman)(P2P) |
| 'Magic' - South-West of Seers Village (P2P) |
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
|Version 1.1 Updates: |
| - Cutting TPA's |
| - Better Tree Finding |
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\}

Program AnyWherePowerChopper;
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}

const{//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\/}
{//---------------------------//---> SRL ID <---\\---------------------------\\}
YourSRLId = '';
YourSRLPassword ='';
{''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''}
{//-----------------------------//SMART World\\------------------------------\\}
{//------------------------\\} SMARTWorld = 152; {//-------------------------\\}
{''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''}

{------------------------------------------------------------------------------}
{--------------------------------// Player Setup \\----------------------------}
{------------------------------------------------------------------------------}

procedure DeclarePlayers;
begin

HowManyPlayers := 1; //How many Players
NumberOfPlayers(HowManyPlayers);
CurrentPlayer :=0; //Starting Player

Players[0].Name := 'h';
Players[0].Pass := 'e';
Players[0].Nick := 'l';
Players[0].Active := True;
Players[0].Integers[0]:= 10; //Loads to Do;
Players[0].Strings[1] := 'p';

{ Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := False;
Players[1].Integers[0]:= 10; //Loads to Do;
Players[1].Strings[1] := 'oak'; }

{ Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
Players[2].Integers[0]:= 10; //Loads to Do;
Players[2].Strings[1] := 'willow';

Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := True;
Players[3].Integers[0]:= 10; //Loads to Do;
Players[3].Strings[1] := 'maple';

Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Active := True;
Players[4].Integers[0]:= 10; //Loads to Do;
Players[4].Strings[1] := 'yew';

Players[5].Name := '';
Players[5].Pass := '';
Players[5].Nick := '';
Players[5].Active := True;
Players[5].Integers[0]:= 10; //Loads to Do;
Players[5].Strings[1] := 'magic';

Players[5].Name := '';
Players[5].Pass := '';
Players[5].Nick := '';
Players[5].Active := True;
Players[5].Integers[0]:= 10; //Loads to Do;
Players[5].Strings[1] := 'any'; }

end;

{/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}
{----------------------------Do Not Edit Below This----------------------------}
{/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}

var x, y, i, LoadsNum2, BrokenAxe, BrokenAxes, CuttingTime, Tries, MagicLoads, YewLoads, MapleLoads: integer;
NormalLoads, OakLoads, WillowLoads, Anything, WillowLog, NormalLog, MagicLog, YewLog, OakLog, MapleLog : integer;

//Load DTM's\\

procedure LoadDTMs;
begin
BrokenAxe := DTMFromString('78DA636C616260E0636440061D697C601A26C' +
'AD80354C38FAA06260B57D30754C34D404D2F508D080135CD4035' +
'5C04D4D400D5A8E05703008C0604B4');

WillowLog:= DTMFromString('78DA6314626060E06540010E56A20CFF81342' +
'310FF07024616204300554D7AAC19986684F219398184180135A2' +
'404218558DAF8B24AA1A5920C18FE91E1435E2408209558DAD991' +
'0AA1A4120C182AAC6D516CD1C3620C18DDFCD00DCA30BC3');

MagicLog := DTMFromString('78DA6314646060106040015141BA609A11CA6' +
'71407121CA86A0A32DC50D54802097E5435EE0ECAA86A64818428' +
'AA9ADC345754357C40420A554D668219AA1A4E20218EAA466EE12' +
'454354C404204554DB0A702AA1A664C35B7EFDF435503F2372FAA' +
'1A99E99DA86A4061C885AAA6AAD017558D28A65D3F7E2C4451030' +
'05EBD0FE1');

YewLog := DTMFromString('78DA63E4656060E0614001899E9C609A11CA6' +
'7940412CC0C688011530D9A3931AE68E6C80009215435CE860CA8' +
'6AF880842801F7B00309115435ED79F6A86A9831ED6AC9B1C554C' +
'387AAA6ABD001550D2B90E0226017C83DEC04EC1200126CF8C307' +
'00F93B0A62');


OakLog := DTMFromString('78DA6314626060E06740013DB94E609A11CA6' +
'7640312ECA86A56742660AAE14555D3986C83AA86054808A2AA59' +
'D81C83AA860B4888A19993A08FAA8609D3CDEBFB9251D5C800092' +
'15435A9BE7AA86A8431D54C2A744555230524B851D5D4255AA1AA' +
'110512ACA86ADA33EC51D5F061866157B6038A1A00D39F0F05');


NormalLog := DTMFromString('78DA63E4636060E0614001D9C186609A11CA6' +
'764C15453136F85AA06640E1BAA9A96345B5435A240820355CDA4' +
'4257543532404210554D5D229A5DE240420855CDD4123473B8818' +
'41801356C98E6A479ABA2AA1101124CA86A12BDF550D54800092E' +
'543579A1C6286A008EA30C05');

MapleLog := DTMFromString('78DA6314606060E061400111369C609A11CA6' +
'71403124CA86A129DD0D4C80009215435BEA6686AC481041BAA9A' +
'3457343520338451D514FAF2A1AAE1061222A86ACA02D1D480EC1' +
'140B3CB5B15550D27A69BBBD30D51D580FCCD8BAA6642B629A65D' +
'ACA86AAAA37450D580CC604155E36988EA77005BE80A0C');

end;

//Signature\\

procedure Signature;
begin
ClearDebug;
wait(250 + random(30));
writeln('-------Torrents AnyWhere Power Chopper-------');
wait(250 + random(30));
writeln(' ______ __ ');
wait(250 + random(30));
writeln(' /_ __/__ ___________ ___ / /_ ');
wait(250 + random(30));
writeln(' / / / _ \/ __/ __/ -_) _ \/ __/ ');
wait(250 + random(30));
writeln(' /_/ \___/_/ /_/ \__/_//_/\__/ ');
wait(250 + random(30));
writeln(' ');
writeln('---------------------------------------------');
wait(500 + random(30));
end;

//Torrent Proggy\\

procedure ToFProggy;
begin
ClearDebug;
Writeln(',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,');
Writeln('/\Please Post Progress Reports & Any problems /\ ');
Writeln('/\ From Wherever you got the script /\ ');
Writeln('//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ ');
Writeln('//\\Worked For: ' + TimeRunning + ' //\\');
Writeln('//\\Cut: ' + IntToStr(WillowLoads)+ ' Willow Trees //\\');
Writeln('//\\Cut: ' + IntToStr(OakLoads)+ ' Oak Trees //\\');
Writeln('//\\Cut: ' + IntToStr(NormalLoads)+ ' Normal Trees //\\');
Writeln('//\\Cut: ' + IntToStr(YewLoads)+ ' Yew Trees //\\');
Writeln('//\\Cut: ' + IntToStr(MagicLoads)+ ' Magic Trees //\\');
Writeln('//\\Cut: ' + IntToStr(MapleLoads)+ ' Maple Trees //\\');
Writeln('//\\Cut: ' + IntToStr(Anything)+ ' Random Trees //\\');
Writeln('//\\Broke: ' + IntToStr(BrokenAxes)+ ' Axes //\\');
Writeln('//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ ');
Writeln('//\\ Thanks for Using my Script :D //\\ ');
Writeln('```````````````````````````````````````````````');
end;

//--------------------------------Anti-Ban!!------------------------------------\\
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: PickUpMouse;
// 6: AlmostLogout; // This is removd from Includ
7: DoEmote(400 +Random(90));
8: begin
GameTab(1 +Random(12));
wait(2000 +Random(1000));
GameTab(4);
end;
end;
end;

//------------------------------Anti-Randoms!!------------------------------\\

procedure FindRandoms;
begin
FindTalk;
FindNormalRandoms;
FindLamp('Woodcutting');
SolvePinball;
FindEnt(x, y, true);
end;


//Ent Finder\\

function EntFinder: Boolean; //By p1nky
var
Counter : Integer;
begin
if Not(LoggedIn) then Exit;
Counter := 0;
While Counter < 8 do
begin
i := GetColor(86 + Counter, 17);
Counter := Counter + 1;
if SimilarColors(i,119764,60) then
begin
Result := True;
Writeln('We found an ent!! Trying to avoid now..');
RunTo('W',True);
Mouse(648, 84, 3, 3, true);
Flag;
FTWait(60 + Random(5));
begin
Writeln('Whew! We avoided the ent.. Carrying on with chopping');
Exit;
end;
end;
Result := False;
end;
end;

//---------------------------------IsAxeBroken?--------------------------------\\

Procedure IsAxeBroke;
begin
if FindDTM(BrokenAxe, x, y, 547, 206, 734, 464) then
begin
if FindDTM(BrokenAxe, x, y, 547, 206, 734, 464) then
begin
BrokenAxes := BrokenAxes +1;
ReportVars[0] := ReportVars[0] + 1;
LogOut;
NextPlayer(False);
LoadsNum2 := 0;
Writeln('Players Switched successfully')
end;
end;
end;

//--------------------------------- Find A Tree ------------------------------\\

function FindATree: boolean;
begin
if (Players[CurrentPlayer].Strings[1] = 'willow') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 3760987, 15, -1, 5, 5, 14, ['Willow'])then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 3760987, 15, -1, 5, 5, 14, ['Willow']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
WillowLoads := WillowLoads + 28;
ReportVars[1] := ReportVars[1] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'oak') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 1381047, 15, -1, 5, 5, 14, ['Oak']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 1381047, 15, -1, 5, 5, 14, ['Oak']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Oak Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
OakLoads := OakLoads + 28;
ReportVars[2] := ReportVars[1] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'normal') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 2122071, 15, -1, 5, 5, 14, ['Tree']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 2122071, 15, -1, 5, 5, 14, ['Tree']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Normal Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
NormalLoads := NormalLoads + 28;
ReportVars[3] := ReportVars[3] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'yew') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 3230274, 15, -1, 5, 5, 14, ['Yew']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 3230274, 15, -1, 5, 5, 14, ['Yew']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Yew Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
YewLoads := YewLoads + 28;
ReportVars[4] := ReportVars[4] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'magics') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 11919079, 15, -1, 5, 5, 14, ['Magic'])then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 11919079, 15, -1, 5, 5, 14, ['Magic']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Yew Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
MagicLoads := MagicLoads + 28;
ReportVars[5] := ReportVars[5] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'maple') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 24459, 15, -1, 5, 5, 14, ['Maple']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
if (not (FindObjTPA(x, y, 24459, 15, -1, 5, 5, 14, ['Maple']))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
MapleLoads := MapleLoads + 28;
ReportVars[6] := ReportVars[6] + 28;
end;

if (Players[CurrentPlayer].Strings[1] = 'all') then
begin
MarkTime(CuttingTime);
EntFinder;
FindRandoms;
FindEnt(x, y, True);
repeat
if FindObjTPA(x, y, 11919079, 15, -1, 5, 5, 14, ['Magic']) or
FindObjTPA(x, y, 2122071, 15, -1, 5, 5, 14, ['Tree']) or
FindObjTPA(x, y, 11919079, 15, -1, 5, 5, 14, ['Oak']) or
FindObjTPA(x, y, 3760987, 15, -1, 5, 5, 14, ['Willow']) or
FindObjTPA(x, y, 24459, 15, -1, 5, 5, 14, ['Maple']) or
FindObjTPA(x, y, 3230274, 15, -1, 5, 5, 14, ['Yew']) then
begin
case (Random(2)) of
0: Mouse(x, y, 4, 4, True);

1: begin
Mouse(x,y,0,0,false);
ChooseOption('hop');
end;
end;
AntiBan;
if (FindDTM(BrokenAxe, x, y, 547, 206, 734, 464)) then
begin
IsAxeBroke;
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
Anything := Anything + 28;
ReportVars[7] := ReportVars[7] + 1;
end;
end;

//PowerDrop\\

procedure PowerDrop;
var i: integer;
begin
if not (LoggedIn) then Exit;
for i := 2 to 28 do
begin
if FindDTM(NormalLog, x, y, 547, 206, 734, 464) or
FindDTM(OakLog, x, y, 547, 206, 734, 464) or
FindDTM(WillowLog, x, y, 547, 206, 734, 464) or
FindDTM(MapleLog, x, y, 547, 206, 734, 464) or
FindDTM(YewLog, x, y, 547, 206, 734, 464) then
begin
DropItem(i);
end;
end;
end;

//Setup Script\\

procedure DoOnce;
begin
SMARTSetupEx(16, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
SRLId := YourSRLId;
SRLPassword:= YourSRLPassword;
SetupSRL;
ScriptID:= '755';
Signature;
DeclarePlayers;
LoadDTMs;
LoginPlayer;
end;

//Cutting and Dropping Loop\\

procedure RepeatThis;
begin
FindATree;
PowerDrop;
end;

//Final Loop\\

procedure FinalLoop;
begin
DoOnce;
RepeatThis;
end;

//The Execution\\

begin
FinalLoop;
end.

Fixed Remvoed 1 line from AntiBan , because its removed from SRL and put in the new SMART Setup ;)

Torrent of Flame

2008-12-18 17:17:05

Well it needs to get new cutting proc's anyways cause they didnt work so I suppose I'll look into that one.

Thanks for the Cleanup Nicbaz :D

Wizzup?

2008-12-18 17:17:20

What you need to know is the following:
  • Basic Syntax (If, Then, Else, Begin, End, Var, Procedure, Function)
  • Have some sort of logic on how to give your script a good structure, think your script out before you start making it. After you have made a few scripts you can often base new ones on current ones.
  • Know how to use SRL. SRL Scripting is easier than making everything yourself, trust me. SRL is the result of longs hours of hard work by many blessed scripters, and it generally functions quite well.
  • Make sure you enjoy scripting. When you enjoy scripting, you'll get the hang of it quicker.

Torrent of Flame

2008-12-18 17:20:52

Yeah, I know about Var, Const, If, Then etc.

I know how to write a basic proc etc.


Just I been out the game a while and wondered how much scripting was differentiating, and I do enjoy scripting ^.^

legendaryhero90

2008-12-18 17:41:18

yes it is difficult.

i believe it takes more than just basic algebra and syntax.

it really stinks when you get an error and cant find a way to fix it because you forgot something as little as a semicolon or a parentheses.

with that said, i dont think SRL is as difficult as other programming languages but its just as tedious :D

NiCbaZ

2008-12-18 18:02:13

i dont think SRL is as difficult as other programming languages but its just as tedious :D


I disagree on this one ;) i thing delphi and vb are much easyer.

Naike

2008-12-18 18:08:15

I see SRL Scripting as a challange, fun and great way of learning not hard, boring and stupid :D

Wizzup?

2008-12-18 19:12:20

From: NiCbaZ
I disagree on this one ;) i thing delphi and vb are much easyer.


SRL isn't a programming language. It is a large library which basically makes writing scripts for RS easier. SRL Scripting is less hard than writing it all yourself. ('Normal' scripting)

NiCbaZ

2008-12-18 20:22:13

From: Wizzup?
SRL isn't a programming language. It is a large library which basically makes writing scripts for RS easier. SRL Scripting is less hard than writing it all yourself. ('Normal' scripting)


I ment Scar.

noidea

2008-12-18 20:35:05

I view SCAR as a way to beat the opposition and learn how to do it in several ways.

Method

2008-12-18 20:41:15

From: legendaryhero90
i believe it takes more than just basic algebra and syntax.


Apart from having some decent logic skills, you really don't need much more than basic algebra and SRL knowledge. Of course, being familiar with the functions of SRL is a big part of scripting too, but algebra and logic are the foundations of programming.

bullzeye95

2008-12-18 20:43:53

From: NiCbaZ
I ment Scar.


SCAR isn't a programming language either ;)

TViYH

2008-12-18 21:15:51

From: noidea
a way to beat it in several ways.


That's what she said.


SRL isn't hard if you have a brain. The only way to learn it is through reading tutorials, trial and error, and researching other people's scripts.

Scaper

2008-12-18 22:53:53

WHAT!!!!

scripting is like driving once you know it you will never ever hardly forget

Torrent of Flame

2008-12-19 04:16:03

I forgot like everything. LOL.

Ah well, back to the old drawing board.

NiCbaZ

2008-12-19 06:06:55

From: bullzeye95
SCAR isn't a programming language either ;)


I dont cear what offically is but i treat it like one ;)

Wizzup?

2008-12-19 06:08:31

From: NiCbaZ
I dont cear what offically is but i treat it like one ;)


It is just pascal. (Interpreted by Pascal Script)

NiCbaZ

2008-12-19 06:11:34

From: Wizzup?
It is just pascal. (Interpreted by Pascal Script)


Oh so freddy or kiet didnt write the interpreter? so it uses the componet PascalScript?

Oh well my bad .

Edit Installed PascalScript any idea how to use it :p, i got it working how do i assign it to a Memo?

painless150

2008-12-19 10:05:14

From: legendaryhero90
yes it is difficult.

i believe it takes more than just basic algebra and syntax.

it really stinks when you get an error and cant find a way to fix it because you forgot something as little as a semicolon or a parentheses.

with that said, i dont think SRL is as difficult as other programming languages but its just as tedious :D


Agreed.

Kyle Undefined

2008-12-19 10:20:22

I really don't see it as being difficult, it's just challenging. I think that's what makes it fun in my eyes, you learn alot by doing it. But hey, that's just me.

~Camo

Naum

2008-12-19 18:24:36

Very hard to begin with. Some of those arcSin, Tan - trigonometry, lograthims, hyperbolic functions, in beginning to get my head round. Hell, if you open up the SCAR manual and have a look at the math functions you'll see soo many, it'll make you all queasy ;)

Santa_Clause

2008-12-20 01:09:08

From: NaumanAkhlaQ
Very hard to begin with. Some of those arcSin, Tan - trigonometry, lograthims, hyperbolic functions, in beginning to get my head round. Hell, if you open up the SCAR manual and have a look at the math functions you'll see soo many, it'll make you all queasy ;)


No-one starts off by looking at the maths functions…

Torrent of Flame

2008-12-20 05:17:23

True that Santa.

Naum

2008-12-21 09:03:36

I did :)!