From: Coh3n
Why not create two walk idexes/constants. That way it'll set the player location to which tree the player is at. After it moves from one tree to another, it could just wait until the tree appears (with a maximum time of course). But I've never made a script for this location so it may not work as well as I think.
That's basically what I do right now. Once the tree your chopping is gone, it runs to the other one. Waits Random(30000) while looking for a tree to pop up, and if nothing pops up it runs to the other tree again and repeats until full.
Work's quite well I might add ;) but I haven't tested Naum's so I really can't compare the 2.
This might clear some thing's up:
program NCDS_YewChopper;
{.include srl/srl/misc/smart.scar}
{.include SRL/SRL.scar}
type
TLocation = record
Color, Tol, cCount: Integer;
Coords: array [0..3] of Integer;
end;
TTreeInfo = record
Colors: TIntegerArray;
UpText: TStringArray;
end;
TPlayerReport = record
TotalLogsCut, ExpGained, LoadsDone, BExp, EExp: Integer;
BLevel, ELevel, LevelsGained: Integer;
Nick: string;
end;
const
Bank = 0; //DO
NorthTree = 1; //NOT
SouthTree = 2; //EDIT
TreesFromBank = 3; //THESE
TreeToTree = 4; //LINES
TreesToBank = 5; //!!!
MM_BankFloor = 856910;
MM_DirtGround = 3364196;
MM_TreeSymbol = 494860;
MM_SymbolOutline = 65536;
AxeEquipped = 0; //OR
TotalLogs = 0; //THESE
LoadsBeforeSwitch = 1; //ONES
Version = 'Alpha';
Stats_Link = 'http://scriptmanager.freehostia.com/submit.php';
Debug = True; //Set true for extensive debugging.
Your_Stats_UserID = '';
Your_Stats_Password = '';
var
tLoc: array of TLocation; MS_BankColor: array of Integer; TreeInfo: TTreeInfo;
PlayerReport: array of TPlayerReport; M, WTime, i, t, tTimeRunning: Integer;
B, NewPlayer: Boolean; MDAr: array of array of TPoint;
Stats_UserID, Stats_Password, Stats_ScriptID: string; Stats_LastTime: Integer;
Stats_CustomVars: array [1..20] of Integer; Stats_GlobalVars: array[1..24] of Integer;
label AtTrees, ML;
procedure DeclarePlayers;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := ''; // 3-4 LOWERCASE letters from your username.
Active := True; // True = use this player.
Loc := 'Bank';
Integers[TotalLogs] := 1000;
Integers[LoadsBeforeSwitch] := 30;
Booleans[AxeEquipped] := False;
end;
with Players[1] do
begin
Name := '';
Pass := '';
Nick := ''; // 3-4 LOWERCASE letters from your username.
Active := True; // True = use this player.
Loc := 'Bank';
Integers[TotalLogs] := 1000;
Integers[LoadsBeforeSwitch] := 30;
Booleans[AxeEquipped] := False;
end;
SetArrayLength(PlayerReport, HowManyPlayers);
SetPlayerNameTPAs;
end;
{Stats}
procedure Stats_CheckOutput(s: string);
var
i: Integer;
sa: TStringArray;
begin
sa := Explode(#10, s);
for i := 0 to High(sa) do
if (Trim(sa[i]) <> '') then
if StartsWith('ERROR(1)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_UserID := '';
Stats_Password := '';
end
else if StartsWith('ERROR(2)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_ScriptID := '';
end
else
WriteLn('STATS: "' + sa[i] + '"');
end;
function Stats_GetScriptInfo(out Version, News, Link: string; out OutDated: Boolean; out LastUpdate_HoursAgo: Integer): Boolean;
var
Client: Integer;
s: string;
sa: TStringArray;
begin
Result := False;
if (Stats_ScriptID = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'getinfo');
AddPostVariable (Client, 'sID', Stats_ScriptID);
s := PostHTTPPageEx(Client, Stats_Link);
sa := Explode(#10'GLUE'#10, s);
if (Length(sa) = 5) then
begin
Result := True;
Version := sa[0];
News := sa[1];
Link := sa[2];
OutDated := sa[3] = '1';
LastUpdate_HoursAgo := StrToIntDef(sa[4], -1);
end
else
Stats_CheckOutput(s);
FreeHTTPClient(Client );
end;
procedure Stats_SendReport;
var
i, Client, Time: Integer;
s: string;
begin
if (Stats_UserID = '') and (Stats_Password = '') and (Stats_ScriptID = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'submit');
Time := (GetTimeRunning - Stats_LastTime) div 1000 div 60;
if (Time < 5) then
Time := 0
else
Stats_LastTime := GetTimeRunning;
AddPostVariable(Client, 'sTime', IntToStr(Time));
if (Stats_UserID <> '') and (Stats_Password <> '') then
begin
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
end
else
begin
AddPostVariable(Client, 'uID', '-1');
AddPostVariable(Client, 'uPass', '');
end;
if (Stats_ScriptID <> '') then
begin
AddPostVariable (Client, 'sID', Stats_ScriptID);
for i := Low(Stats_CustomVars) to High(Stats_CustomVars) do
begin
AddPostVariable(Client, 'rndCustom' + IntToStr(i), IntToStr(Stats_CustomVars[i]));
Stats_CustomVars[i] := 0;
end;
end
else
begin
AddPostVariable (Client, 'sID', '-1');
end;
for i := Low(Stats_GlobalVars) to High(Stats_GlobalVars) do
begin
case i of
1: s := IntToStr(SRL_Logs - Stats_GlobalVars[i]);
2: s := IntToStr(Banks - Stats_GlobalVars[i]);
3: s := IntToStr(RandSolved[rand_Death] - Stats_GlobalVars[i]);
else if ((i - 3) < Length(RandSolved) - 1 {for Death}) then
s := IntToStr(RandSolved[i - 3] - Stats_GlobalVars[i]);
end;
AddPostVariable(Client, 'rndGlobal' + IntToStr(i), s);
Stats_GlobalVars[i] := Stats_GlobalVars[i] + StrToInt(s);
end;
s := PostHTTPPageEx(Client, Stats_Link);
Stats_CheckOutput(s);
FreeHTTPClient(Client);
if (SRL_Procs[srl_OnSendStats] <> nil) then
SRL_Procs[srl_OnSendStats]();
end;
procedure Stats_SendAccountInfo;
var
i, Client: Integer;
Accounts: TStringArray;
begin
if (Stats_UserID = '') and (Stats_Password = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'setaccounts');
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
if (Stats_ScriptID <> '') then
AddPostVariable (Client, 'sID', Stats_ScriptID)
else
AddPostVariable (Client, 'sID', '-1');
SetLength(Accounts, HowManyPlayers);
for i := 0 to HowManyPlayers - 1 do
Accounts[i] := Implode('.|€stat€|.', [Players[i].Name, Players[i].Loc, IntToStr(Integer(Players[i].Active))]);
AddPostVariable(Client, 'accInfo', Implode(#10'ACC'#10, Accounts));
Stats_CheckOutput(PostHTTPPageEx(Client, Stats_Link));
FreeHTTPClient(Client);
end;
procedure Stats_ManageAccounts;
var
i, ii, Client: Integer;
s: string;
Accounts, Stats: TStringArray;
begin
if (Stats_UserID = '') and (Stats_Password = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'getaccounts');
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
AddPostVariable (Client, 'sID', '-1');
s := PostHTTPPageEx(Client, Stats_Link);
Accounts := Explode(#10'ACC'#10, s);
for i := 0 to High(Accounts) do
begin
Stats := Explode('.|€stat€|.', Accounts[i]);
if (Length(Stats) = 3) then
begin
for ii := 0 to HowManyPlayers - 1 do
if (LowerCase(Players[ii].Name) = LowerCase(Stats[0])) then
begin
Players[ii].Loc := Stats[1];
Players[ii].Active := Stats[2] = '1';
Break;
end;
end
else
begin
Stats_CheckOutput(s);
Break;
end;
end;
FreeHTTPClient(Client);
stats_SendAccountInfo;
end;
{/Stats}
procedure N_Debug(s: string);
begin
if Debug then
Writeln(s);
end;
procedure LocInfo;
begin
SetArrayLength(tLoc, 3);
with tLoc[Bank] do
begin
Color := MM_BankFloor;
Tol := 3;
cCount := 5;
Coords := [MMCx - 7, MMCy - 7, MMCx + 7, MMCy + 7];
end;
with tLoc[NorthTree] do
begin
Color := MM_BankFloor;
Tol := 3;
cCount := 5;
Coords := [633, 28, 660, 55];
end;
with tLoc[SouthTree] do
begin
Color := MM_TreeSymbol;
Tol := 5;
cCount := 1;
Coords := [608, 26, 641, 57];
end;
end;
function AtLoc(Loc: Integer): Boolean;
var
i, x, y: Integer; Arr: array of TPoint;
begin
if not LoggedIn then Exit;
for i := 0 to 2 do
begin
FindColorsSpiralTolerance(x, y, Arr, tLoc[Loc].Color, tLoc[Loc].Coords[0],
tLoc[Loc].Coords[1], tLoc[Loc].Coords[2],
tLoc[Loc].Coords[3], tLoc[Loc].Tol);
Result := (Length(Arr) >= tLoc[Loc].cCount);
if Result then
Exit;
if i = 2 then
begin
srl_Warn('AtLoc', 'Failed to find location', warn_AllVersions);
Exit;
end;
end;
end;
function FindTreeSymbolTPA(x1, y1, x2, y2: Integer): TPointArray;
var
Tol, i: Integer; Arr: array of TPoint; SymBox: TBox;
begin
MakeCompass('n');
Tol := 1;
for i := 0 to 5 do
begin
if i = 5 then
begin
srl_Warn('function FindTreeSymbolTPA(x1, y1, x2, y2: Integer): TPointArray;', 'Failed to find TreeSymbol.', warn_AllVersions);
Exit;
end;
IncEx(Tol, 2);
FindColorsTolerance(Arr, MM_SymbolOutline, x1, y1, x2, y2, Tol);
N_Debug('MM_SymbolOutline returned '+IntToStr(Length(Arr))+' points.');
if Length(Arr) < 4 then
Continue;
SymBox := GetTPABounds(Arr);
FindColorsTolerance(Arr, MM_TreeSymbol, SymBox.x1, SymBox.y1, SymBox.x2, SymBox.y2, Tol);
N_Debug('MM_TreeSymbol returned '+IntToStr(Length(Arr))+' points.');
if Length(Arr) >= 4 then
Break;
end;
Result := Arr;
end;
function CountLogsInInv: Integer;
var
i, n: Integer; Arr: array of TPoint;
begin
if not LoggedIn then Exit;
if Players[CurrentPlayer].Booleans[AxeEquipped] then
n := 1
else
n := 2;
for i := n to 28 do
begin
if not ExistsItem(i) then
Continue;
FindColorsTolerance(Arr, srl_Outline_Black, InvBox(i).x1, InvBox(i).y1,
InvBox(i).x2, InvBox(i).y2, 1);
N_Debug(IntToStr(Length(Arr)));
if Length(Arr) = 82 then
Inc(Result);
end;
end;
function MS_FindObject(var MDAr: array of TPointArray; Color: TIntegerArray; Tol: Integer): Boolean;
var
i: Integer; Arr: array of TPoint; atpa: T2DPointArray;
begin
if not LoggedIn then Exit;
for i := 0 to High(Color) do
begin
FindColorsSpiralTolerance(MSCx, MSCy, Arr, Color[i], MSx1, MSy1,
MSx2, MSy2, Tol);
if Length(Arr) >= 10 then
Break;
if i = High(Color) then
begin
N_Debug('MS_FindObject(); Color returned '+IntToStr(Length(Arr))+' points.');
Exit;
end;
end;
atpa := TPAToATPAEx(Arr, 8, 10);
SortATPAFrom(atpa, Point(MSCx, MSCy));
MDAr := atpa;
Result := True;
end;
function WalkTo(Index: Integer): Boolean;
var
x, y, i, Tol, t: Integer; Arr, tArr: array of TPoint; cArr: array of Integer;
N: Boolean;
label BankClick;
begin
if not LoggedIn then Exit;
case Index of
TreesFromBank :
begin
Disguise('Walking to trees..');
MakeCompass('n');
Tol := 5;
for i := 0 to 4 do
begin
FindColorsTolerance(Arr, MM_DirtGround, 612, 123, 645, 145, Tol);
N_Debug('MM_DirtGround returned '+IntToStr(Length(Arr))+' points.');
if Length(Arr) > 10 then
Break;
IncEx(Tol, 2);
if i = 4 then
begin
srl_Warn('function WalkTo(Index: Integer): Boolean;', 'Failed to find MM_DirtGround color.', warn_AllVersions);
Disguise('');
Exit;
end;
end;
SortTPAFrom(Arr, Point(MMCx, MMCy));
i := (High(Arr) - RandomRange(1, 3));
for t := 0 to 8 do
begin
MMouse(Arr[i].x - 3, Arr[i].y, 2, 1);
GetMousePos(x, y);
if rs_OnMiniMap(x, y) then
Break;
if t = 4 then
begin
srl_Warn('WalkTo', 'Failed to find point on mini map.', warn_AllVersions);
Disguise('');
Exit;
end;
end;
Mouse(x, y, 0, 0, True);
N_Debug('Walking to Point('+IntToStr(x)+', '+IntToStr(y)+');');
FFlag(Random(15));
Arr := FindTreeSymbolTPA(MMx1, MMCy + 5, MMCx, MMy2);
tArr := RemoveDistTPointArray(MMCx, MMCy, 60, Arr, True);
Mouse(MiddleTPA(tArr).x, MiddleTPA(tArr).y - RandomRange(5, 10), 5, 5, True);
N_Debug('Walking to Point('+IntToStr(MiddleTPA(tArr).x)+', '+IntToStr(MiddleTPA(tArr).y)+');');
Flag;
Wait(RandomRange(200, 400));
Result := True;
{Result := AtLoc(SouthTree);
if Result then }
Disguise('Arrived at trees successfully.');
end;
TreeToTree :
Begin
SetArrayLength(cArr, 4);
if Players[CurrentPlayer].Loc = 'NorthTree' then
begin
cArr := [605, 115, 639, 145];
Disguise('Walking to South Tree..');
N := True;
end
else
if Players[CurrentPlayer].Loc = 'SouthTree' then
begin
cArr := [605, 26, 641, 57];
Disguise('Walking to North Tree..');
end;
Arr := FindTreeSymbolTPA(cArr[0], cArr[1], cArr[2], cArr[3]);
if Length(Arr) < 5 then
begin
Disguise('');
Exit;
end;
SortTPAFrom(Arr, Point(MSCx, MSCy));
i := Random(3);
if N then
Mouse(Arr[i].x + 3, Arr[i].y - 5, 2, 2, True)
else
Mouse(Arr[i].x + 2, Arr[i].y + 5, 2, 2, True);
GetMousePos(x, y);
N_Debug('Clicking Point('+IntToStr(x)+', '+IntToStr(y)+');');
FFlag(1);
Wait(RandomRange(150, 300));
Result := True;{
if N then
Result := AtLoc(SouthTree)
else
Result := AtLoc(NorthTree);
if Result then
begin}
if N then
begin
Disguise('Arrived at South Tree successfully.');
Players[CurrentPlayer].Loc := 'SouthTree';
end
else
begin
Players[CurrentPlayer].Loc := 'NorthTree';
Disguise('Arrived at North Tree successfully.');
end;
// end;
end;
TreesToBank :
begin
Disguise('Walking to bank...');
if Players[CurrentPlayer].Loc = 'NorthTree' then
goto BankClick;
Tol := 4;
for i := 0 to 8 do
begin
FindColorsTolerance(Arr, MM_DirtGround, 622, 16, 662, 29, Tol);
if Length(Arr) > 1 then
Break;
IncEx(Tol, 2);
if i = 4 then
begin
srl_Warn('WalkTo', 'MM_DirtGround returned '+IntToStr(Length(Arr))+' results.', warn_AllVersions);
Exit;
end;
end;
SortTPAFrom(Arr, Point(MMCx, MMCy));
i := RandomRange(Length(Arr) / 2, Length(Arr));
for t := 0 to 4 do
begin
MMouse(Arr[i].x, Arr[i].y, 8, 3);
GetMousePos(x, y);
if rs_OnMiniMap(x, y) then
Break;
if t = 4 then
begin
srl_Warn('WalkTo', 'Failed to find point on mini map.', warn_AllVersions);
Disguise('');
Exit;
end;
end;
Mouse(x, y, 0, 0, True);
N_Debug('Walking to Point('+IntToStr(x)+', '+IntToStr(y)+');');
FFlag(Random(5));
BankClick:
Tol := 6;
for i := 0 to 4 do
begin
FindColorsTolerance(Arr, MM_BankFloor, 609, 31, 670, 80, Tol);
if Length(Arr) > 10 then
Break;
IncEx(Tol, 3);
if i = 4 then
begin
srl_Warn('WalkTo', 'MM_BankFloor returned '+IntToStr(Length(Arr))+' results.', warn_AllVersions);
Exit;
end;
end;
SortTPAFrom(Arr, Point(MMCx, MMCy));
i := RandomRange(0, Length(Arr) / 2);
Mouse(Arr[i].x, Arr[i].y, 4, 4, True);
{Proggy}
{ IncEx(PlayerReport[CurrentPlayer].TotalLogsCut, CountLogsInInv);
M := PlayerReport[CurrentPlayer].ExpGained;
PlayerReport[CurrentPlayer].ExpGained := (CountLogsInInv * 175) + M; }
{/Proggy}
Wait(RandomRange(4000, 6000));
Flag;
Wait(RandomRange(500, 1200));
Result := True;{
Result := AtLoc(Bank);
if Result then}
begin
Disguise('Arrived at Bank successfully.');
Players[CurrentPlayer].Loc := 'Bank';
end;
end;
end;
end;
procedure CharReport;
var i: Integer;
begin
for i := 0 to (HowManyPlayers - 1) do
begin
AddToReport('|'+Padr('Nick: '+Players[i].Nick+';', 50)+'|');
AddToReport('|'+Padr('Location: '+Players[i].Loc+';', 50)+'|');
AddToReport('|'+Padr('Total Logs Banked: '+IntToStr(PlayerReport[i].TotalLogsCut)+';', 50)+'|');
AddToReport('|'+Padr('Total Loads Done: '+IntToStr(PlayerReport[i].LoadsDone)+';', 50)+'|');
AddToReport('|'+Padr('Experience Gained: '+IntToStr(PlayerReport[i].ExpGained)+';', 50)+'|');
AddToReport('|'+Padr('Levels Gained: '+IntToStr(PlayerReport[i].LevelsGained)+';', 50)+'|');
AddToReport('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|');
end;
end;
procedure ProgReport;
begin
ClearReport;
AddToReport(' __________________________________________________');
AddToReport('| |');
AddToReport('|'+Padr(' NCDS'#39' Edgville Yew Chopper!', 50)+'|');
AddToReport('|'+Padr(' Version: '+Version+';', 50)+'|');
AddToReport('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|');
CharReport;
AddToReport('| |');
AddToReport('|'+Padr(' Time Running: '+MSToTime(TimeFromMark(tTimeRunning), Time_Abbrev)+'; ', 50)+'|');
AddToReport('|__________________________________________________|');
end;
function N_OpenBank: Boolean;
var
i, x, y, r: Integer; MDAr: array of array of TPoint;
begin
if not LoggedIn then Exit;
if not MS_FindObject(MDAr, MS_BankColor, 1) then
begin
srl_Warn('OpenBank', 'Failed to open bank', warn_AllVersions);
Exit;
end;
SortATPASize(MDAr, True);
for i := 0 to High(MDAr) do
begin
r := RandomRange(0, Length(MDAr[i]));
if Distance(MSCx, MSCy, MDAr[i][r].x, MDAr[i][r].y) > 170 then
Continue;
MMouse(MDAr[i][r].x, MDAr[i][r].y, 4, 4);
Wait(RandomRange(100, 220));
if WaitUpTextMulti(['ooth', 'ank', 'bo', 'oo', 'th', 'a', 'n', 'k'], 3000) then
Break;
if i = High(MDAr) then
begin
srl_Warn('OpenBank', 'Failed to open bank', warn_AllVersions);
NextPlayer(False);
Exit;
end;
end;
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
WaitOptionMulti(['uickly', 'ui', 'ck', 'ly'], 2000);
Result := WaitFunc(@BankScreen, 200, 3000);
end;
function N_Deposit: Boolean;
var
Box: TBox; iC, iiC, i: Integer;
begin
if not LoggedIn then Exit;
if not BankScreen then Exit;
if InvCount = 0 then Exit;
if Players[CurrentPlayer].Booleans[AxeEquipped] then
iC := 0
else
iC := 1;
iiC := iC + 1;
for i := iiC to 28 do
begin
if not ExistsItem(i) then
Continue;
Box := InvBox(i);
Mouse(RandomRange(Box.x1, Box.x2), RandomRange(Box.y1, Box.y2), 0, 0, False);
WaitOption('ll', 3000);
Wait(RandomRange(300, 1100));
end;
Result := (InvCount = iC);
end;
function ChopTree: Boolean;
var
MDAr: array of array of TPoint; i, x, y, P: Integer;
begin
if not LoggedIn then Exit;
if InvFull then Exit;
Wait(RandomRange(350, 2000));
if not MS_FindObject(MDAr, TreeInfo.Colors, 3) then
begin
srl_Warn('ChopTree', 'Failed to find tree.', warn_AllVersions);
Exit;
end;
SortATPASize(MDAr, True);
for i := 0 to High(MDAr) do
begin
SortTPAFrom(MDAr[i], Point(MSCx, MSCy));
P := RandomRange(0, Length(MDAr[i]) / 4);
MMouse(MDAr[i][P].x, MDAr[i][P].y, 1, 1);
if WaitUpTextMulti(['ew', 'e', 'w'], 2000) then
Break;
if i = High(MDAr) then
begin
srl_Warn('ChopTree', 'Failed to find tree.', warn_AllVersions);
Exit;
end;
end;
GetMousePos(x, y);
Mouse(x, y, 1, 1, True);
FFlag(3);
Result := True;
end;
begin
SetUpSRL;
Stats_ScriptID := '42';
Stats_UserID := Your_Stats_UserID;
Stats_Password := Your_Stats_Password;
SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;
ActivateClient;
DeclarePlayers;
MS_BankColor := [4215903, 3820630, 4281697, 3622994, 4347490, 3952473];
with TreeInfo do
begin
Colors := [4557950, 5807503, 802866, 5939860];
UpText := ['ew', 'e', 'w'];
end;
MarkTime(tTimeRunning);
LoginPlayer;
if (SRL_Logs < 1) then
SRL_Logs := 1;
ML:
SetAngle(True);
PlayerReport[CurrentPlayer].BLevel := GetSkillInfo('woodcutting', False);
PlayerReport[CurrentPlayer].BExp := GetXP('woodcutting');
if (not (Players[CurrentPlayer].Loc = 'Bank')) then
B := True;
repeat
PlayerReport[CurrentPlayer].ELevel := GetSkillInfo('woodcutting', False);
if B then
goto AtTrees;
{Banking}
MarkTime(t);
M := CountLogsInInv;
IncEx(PlayerReport[CurrentPlayer].TotalLogsCut, M);
N_Debug('Counted '+IntToStr(M)+' logs in inventory.');
IncEx(Stats_CustomVars[1], M);
if M >= 1 then
repeat
if N_OpenBank then
if N_Deposit then
begin
Writeln('Banking successful.');
Inc(Banks);
PlayerReport[CurrentPlayer].ELevel := GetSkillInfo('woodcutting', False);
PlayerReport[CurrentPlayer].LevelsGained :=
PlayerReport[CurrentPlayer].ELevel
-
PlayerReport[CurrentPlayer].BLevel;
PlayerReport[CurrentPlayer].EExp := GetXP('woodcutting');
PlayerReport[CurrentPlayer].ExpGained :=
PlayerReport[CurrentPlayer].EExp
-
PlayerReport[CurrentPlayer].BExp;
ProgReport;
end;
until(CountLogsInInv = 0) or (TimeFromMark(t) >= 20000);
if TimeFromMark(t) >= 20000 then
begin
Writeln('Banking failed.');
Logout;
NewPlayer := True;
end;
if NewPlayer then
Break;
if not WalkTo(TreesFromBank) then
begin
Players[CurrentPlayer].Loc := 'lost';
Logout;
NewPlayer := True;
end else
Players[CurrentPlayer].Loc := 'SouthTree';
if NewPlayer then
Break;
AtTrees:
B := False;
while not InvFull do
begin
for i := 0 to 1 do
if not ChopTree then
begin
if i = 1 then
Break;
WTime := RandomRange(2000, 30000);
MarkTime(t);
repeat
Status('Waiting '+IntToStr((WTime - TimeFromMark(t)) / 1000)+' seconds for tree..');
if MS_FindObject(MDAr, TreeInfo.Colors, 3) then
Break;
Wait(100);
until(TimeFromMark(t) >= WTime);
Status('');
end else
repeat
Disguise('Cutting tree...');
if ClickContinue(True, False) then
begin
PlayerReport[CurrentPlayer].ELevel := GetSkillInfo('woodcutting', False);
PlayerReport[CurrentPlayer].LevelsGained :=
PlayerReport[CurrentPlayer].ELevel
-
PlayerReport[CurrentPlayer].BLevel;
end;
case Random(2300) of
1, 3, 5:
begin
HoverSkill('woodcutting', False);
PlayerReport[CurrentPlayer].ELevel := GetSkillInfo('woodcutting', False);
PlayerReport[CurrentPlayer].EExp := GetXP('woodcutting');
end;
12:
begin
BoredHuman;
MakeCompass('n');
end;
50, 53:
RandomRClick;
60, 65:
HoverSkill('random', False);
80..82:
begin
WTime := RandomRange(2000, 8000);
MarkTime(t);
repeat
Status('Waiting '+IntToStr((WTime - TimeFromMark(t)) / 1000)+' seconds randomly..');
Wait(1000);
until(TimeFromMark(t) >= WTime);
Status('');
end;
end;
until((not(MS_FindObject(MDAr, TreeInfo.Colors, 3))) or (not(LoggedIn)) or (InvFull));
Disguise('');
if InvFull then
Continue;
if not WalkTo(TreeToTree) then
begin
Players[CurrentPlayer].Loc := 'lost';
Logout;
NewPlayer := True;
Break;
end;
end;
if NewPlayer then
Break;
PlayerReport[CurrentPlayer].ELevel := GetSkillInfo('woodcutting', False);
PlayerReport[CurrentPlayer].LevelsGained :=
PlayerReport[CurrentPlayer].ELevel
-
PlayerReport[CurrentPlayer].BLevel;
PlayerReport[CurrentPlayer].EExp := GetXP('woodcutting');
PlayerReport[CurrentPlayer].ExpGained :=
PlayerReport[CurrentPlayer].EExp
-
PlayerReport[CurrentPlayer].BExp;
ProgReport;
SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;
if not WalkTo(TreesToBank) then
begin
Players[CurrentPlayer].Loc := 'lost';
Logout;
NewPlayer := True;
Break;
end;
if NewPlayer then
Break;
Inc(PlayerReport[CurrentPlayer].LoadsDone);
until(PlayerReport[CurrentPlayer].LoadsDone >= (Players[CurrentPlayer].Integers[LoadsBeforeSwitch] + Random(10)));
if NewPlayer then
begin
PlayerReport[CurrentPlayer].ExpGained :=
PlayerReport[CurrentPlayer].EExp
-
PlayerReport[CurrentPlayer].BExp;
PlayerReport[CurrentPlayer].LevelsGained :=
PlayerReport[CurrentPlayer].ELevel
-
PlayerReport[CurrentPlayer].BLevel;
NextPlayer(False);
if AllPlayersInActive then
begin
Writeln('Thanks for using the script. ');
Writeln('Post the Proggy!');
ProgReport;
TerminateScript;
end;
NewPlayer := False;
goto ML;
end;
end.