Code:
program Kaede666_Cutter;
{.include SRL/SRL/misc/SMART.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}
var
x, y, i, TreeWait, LogDTM, TinderDTM: integer;
TreeTxT: array of string;
TreeColors: array [0..3] of integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active:= True;
Players[0].Strings[0] := ''; // normal, oak, willow, maple or yew
end;
procedure SetupVars;
begin
TinderDTM := DTMFromString('78DA63B4626060F8C48002DC6C39C0342394C' +
'F6809249E33A0014654354E40E22D01358E40E20F01350640E217' +
'01353A40E23D7E3500C7D1079A');
LogDTM := DTMFromString('78DA634C656060F8C880025AD3EDC1342394C' +
'F980B249E33A0014654359140E23701354540E2070135D140E215' +
'0135D984ED0200C28E0950');
case lowercase(Players[CurrentPlayer].Strings[0]) of
'normal' : begin
writeln('selected');
TreeColors[0] := 462348;
TreeColors[1] := 798246;
TreeColors[2] := 1125158;
TreeColors[3] := 3036236;
TreeTxT := ['Tree', 'Tre', 'ree'];
TreeWait := 1000;
end;
'oak' : begin
TreeColors[0] := 2584416;
TreeColors[1] := 3305828;
TreeColors[2] := 4162678;
TreeColors[3] := 5544845;
TreeTxT := ['Oak', 'Oa', 'ak'];
TreeWait := 2000;
end;
'willow' : begin
TreeColors[0] := 2181686;
TreeColors[1] := 6193521;
TreeColors[2] := 3755332;
TreeColors[3] := 3234376;
TreeTxT := ['Willow', 'Will', 'illo', 'llow'];
TreeWait := 3000;
end;
'maple' : begin
TreeColors[0] := 1319487;
TreeColors[1] := 725796;
TreeColors[2] := 2177124;
TreeColors[3] := 1385537;
TreeTxT := ['Maple', 'Map', 'apl', 'ple'];
TreeWait := 3500;
end;
'yew' : begin
TreeColors[0] := 3241318;
TreeColors[1] := 2119755;
TreeColors[2] := 2645844;
TreeColors[3] := 3240035;
TreeTxT := ['Yew', 'Ye', 'ew'];
TreeWait := 4500;
end;
end;
end;
procedure Lightcheck;
var Z: integer;
begin
MarkTime(Z);
Repeat
wait(10);
Until (TimeFromMark(Z) > 3000); //Can't Figure out what the best way to know when it is lit
end;
procedure Burn;
var tx, ty, lx, ly : integer;
begin; // Thanks to 99_
if(FindDTM(TinderDTM, tx, ty, MIX1, MIY1, MIX2, MIY2) and
FindDTM(LogDTM, lx, ly, MIX1, MIY1, MIX2, MIY2))then
repeat
Mouse(tx, ty, 2, 2, True);
Wait(RandomRange(250, 500));
Mouse(lx, ly, 2, 2, True);
Wait(RandomRange(1000, 3000));//I've been trying to think of a better way to do this with color.. I'll get back to you on it ;)
until(not(FindDTM(LogDTM, lx, ly, MIX1, MIY1, MIX2, MIY2)));
end; // End of Thanks =P
Procedure Antiban;
begin
if not LoggedIn then Exit;
case Random(22) of
0:RandomRClick;
1:HoverSkill('woodcutting',False);
2:BoredHuman;
3:RandomMovement;
4:PickUpMouse;
6:HoverSkill('firemaking', false);
end;
end;
procedure TreeTime;
var Failed: integer;
begin
if (not LoggedIn) then Exit;
for i := 0 to 3 do
begin
if FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT) then
repeat
FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)
Wait(100 + Random(300));
MMouse(x, y, 2, 2);
begin
Wait(200 + Random(400));
case Random(2) of
0: begin
Mouse(x, y, 4, 4, False);
Wait(250 + Random(200));
ChooseOption('hop');
end;
1: begin
Mouse(x, y, 4, 4, True);
end;
end;
Wait(TreeWait + Random(200));
FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)
MMouse(x, y, 2, 2);
AntiBan;
if not (LoggedIn) then
NextPlayer(False);
LoginPlayer;
end;
until Invfull or not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT);
while (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)) do
repeat
MakeCompass('N');
Wait(300 + Random(300));
if (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)) then
MakeCompass('E');
Wait(300 + Random(300));
MakeCompass('S');
Wait(300 + Random(300));
MakeCompass('W');
Wait(300 + Random(300));
Inc(Failed);
until FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT) or (Failed = 5);
if (Failed = 5) then
begin
WriteLn('Tree Finding Failed :(');
NextPlayer(False);
end;
end;
end;
end;
begin
SetUpSRL;
SMARTSetUpEX(1, False, True, False);
SetTargetDC(SMARTGetDC);
ActivateClient;
ClearDebug;
setupvars;
declareplayers;
loginplayer;
Wait(500 + Random(300));
if(not(loggedin)) then
repeat
loginplayer;
wait(random(600));
until(loggedin);
MakeCompass('S');
SetAngle(True);
repeat;
TreeTime;
case Random(5) of
2:Antiban;
end;
if (invfull) then Burn;
Wait(100 + Random(300));
until(false);
end.