This script cuts willows near draynor and banks them at draynor bank. I am hopefully going to submit it for members so give all types of constructive criticism and ideas for it.
Here is the code and there is a .scar file down the bottom:
SCAR Code:
// Thanks to Rubix and TViYHU and OSMM could not be possible without them.
{ }
{ Place character near Willows in Draynor then log out }
{ }
{ }
{ }
program MyFirstWoodCut;
{.include SRL/SRL/misc/SMART.scar}
{.include SRL\SRL.Scar}
{.include SRL/SRL/Skill/WoodCutting.scar}
const
//<><><><><>Loads<><><><><>\\
LoadsPerPlayer = 1; //Loads per player before switching
//<><><><><>SRL Id<><><><><>\\
YourSRLId = '';
YourSRLPass = '';
//<><><><><>Bank Pin<><><><><>\\
YourPin = ''; //Make same for all players if none leave blank
//<><><><><>Lamp Skill<><><><><>\\
{<><><><><><><><><><><><><><><><><><><><>
Player Setup
<><><><><><><><><><><><><><><><><><><><>}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := 'muff';
Players[0].Pin := '';
Players[0].Active := True;
end;
{<><><><><><><><><Do Not Edit Below this Line><><><><><><><><><><><>}
var
x, y, LoadsNum, LoadsNum2: integer;
Banked: boolean;
//<><><><><><><><><><>Anti Randoms<><><><><><><><><><>\\
procedure AntiRandoms;
begin
if (FindFight) then
RunAway('N', True, 1, 1500);
FindNormalRandoms;
FindLamp('');
end;
//<><><><><><><><><><>Anti Ban<><><><><><><><><><>\\
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill(LampSkill, False);
3: RandomMovement;
4: BoredHuman;
5: DoEmote(400 + Random(90));
end;
end;
//<><><><><><><><><><>Chop Tree<><><><><><><><><><>\\
procedure ChopTree;
var CuttingTime: Integer;
Tries: integer;
begin
if (not LoggedIn) then Exit;
MarkTime(CuttingTime);
MakeCompass('S')
repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin
Mouse(x, y, 0, 0, false);
if (IsUpText('Chop')) then
wait(5000 + random(150));
ChooseOption('hop')
wait(10000 + random(3000));
AntiBan;
if (not FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7)) then
Wait(100 + random(100));
Tries := Tries + 1;
if (tries = 50) then
begin
Writeln('Willows dould not be found. Switching Players....');
Logout;
NextPlayer(False);
Exit;
end;
end;
until (invfull) or (TimeFromMark(CuttingTime) > 800000 + random(60000));
end;
//<><><><><><><><><><>Walk To Bank<><><><><><><><><><>\\
procedure WalkToBank;
begin
if (not (LoggedIn)) then
Exit;
SymbolAccuracy := 0.2;
MakeCompass('N');
if (FindSymbol(x, y, 'bank')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Arrived At Bank');
end;
end;
//<><><><><><><><><><>Banking<><><><><><><><><><>\\
procedure Bank;
begin
if not LoggedIn then Exit;
MakeCompass('W')
Wait(300 + random(160));
OpenBankQuiet('db');
if (PinScreen) then
InPin(YourPin);
DepositAll;
Banked := True;
LoadsNum := LoadsNum + 1;
LoadsNum2 := LoadsNum2 + 1;
ReportVars[1] := ReportVars[1] + 1;
SendSRLReport;
CloseBank;
writeln('Load Banked');
Wait(150 + random(278));
MakeCompass('S');
end;
//<><><><><><><><><><>Walk to Willows<><><><><><><><><><>\\
procedure WalkToWillow;
begin
if not LoggedIn then Exit;
if (FindSymbol(x, y, 'fish')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Arrived At Willows');
end;
end;
//<><><><><><><><><><>Check Inventory<><><><><><><><><><>\\
procedure CheckInventory;
begin
if (InvFull) then
begin
WalkToBank;
end else
begin
ChopTree;
end;
end;
//<><><><><><><><><><>Setup Script<><><><><><><><><><>\\
procedure SetupScript;
begin
SRLId := YourSRLId;
SRLPassword := YourSRLPass;
ScriptID := '687';
DeclarePlayers;
if LoggedIn then
exit;
end;
procedure MainProc;
begin
ChopTree;
CheckInventory;
AntiBan;
WalkToBank;
Bank;
WalkToWillow;
AntiBan;
end;
begin
SMARTSetUpEX(55, False, True, False);
SetTargetDC(SMARTGetDC);
SetupSRL;
ActivateClient;
SetupScript;
LoginPlayer;
repeat
MainProc;
AntiBan;
until (LoadsNum = LoadsPerPlayer) or (not LoggedIn);
NextPlayer(true);
end.