SRL Archive - General

Marketing & Advertising


Sir R. M8gic1an

2010-04-25 11:05:53

Small quick post.

First of all, those tuts need finishing. :)

Now, as for MSI, we need to grab more member attention; Here is something that has been running through my mind:

Normal Tree WCer. Why would people use such a script? We did it as proof of concept and we expected members to get coding. Yes, sure. It seemed like a good idea, but it didn't happen.

JMs won't have any interest in running MSI just because it is a big project either. What we do have, is one hell of a core. Unfortunately, the core by itself is not a very useful script.

We'll need to move on with work, and we'll need to make sure SRL Members are well aware of it. Yes, we're gonna spam the hell out of them. Not in the conventional way of spamming tho.

Here is my suggestion:
We set ourselves milestones. Each time we reach one, we make a thread in Members.

A few suggestions for milestones:
Proggy
  • 6h
  • 12h
  • 18h
  • 24h
  • 36h
  • 48h

Script
  • completion of one of the modules
    • Mining process
    • Walking process
    • Bank management process

    Any other milestones you can think of are welcome. Discuss as usual :)
    I've also got a few more things in mind for bank management.. but no time to think about them to put it into words n etc.

    ~RM

    Coh3n

    2010-04-25 11:53:48

    You're right, JM's won't have interest in running it, but they will have interest in testing, which to be quite honest, I think we need just as much as people actually writing code. And yeah, no one wants to use a normal tree cutter/banker, but they would use a powerchopper, and MSI has one hell of a powerchopper (thanks to marpis :D).

    I like the milestone idea. If someone has 4 or 5 accounts and a reliable Internet connection, I have no doubt that a 48 hour report could be reached easily.

    I don't know what NCDS/Naum have talked about, but I really think their yew choppers should be added to MSI. Not to be selfish or anything, but I think it would be a huge help.

    NCDS

    2010-04-25 12:20:17

    From: Coh3n

    I don't know what NCDS/Naum have talked about, but I really think their yew choppers should be added to MSI. Not to be selfish or anything, but I think it would be a huge help.


    I'll be home in a few hours and before I left thursday I ran my yew chopper with a single player. Judging from the stats page it ran 4 or 5 hours with just him before something messed it up.

    So, my chopper is near completion and I believe Naum's is right about at the same point. We use 2 different methods fro finding the trees though when one has been cut down.

    I just have it wait Random(30000) while searching for a tree to pop up and if nothing comes up then it runs to the other tree and repeats until the inventory is full. I have been very impressed to be honest with how responsive this method has been.

    Naum's script from what he tells me runs to the middle of both trees and turns the screen so both trees are visible.

    I've also thought about writing an algorithm to move the screen depending on what tree your currently at so both trees are visible.

    I have no problem converting mine to MSI and from what I remember I don't think Naum does either. However, we will need to figure out what way is best for the tree detection that I was talking about above.

    So, idea's/comments on that?


    @RM, as always, I agree 100% with your post.

    Naum

    2010-04-25 12:34:43

    Meh, here's the script:

    program EdgyYewz;
    {$define SMART}
    {.Include SRL/SRL.Scar}
    {.Include SRL/SRL/Misc/Debug.Scar}
    {.Include SRL/SRL/Misc/Users.Scar}

    Const MaxYewCount = 26.4;

    Var
    TX, TY, Loads, LogsCut : Integer;

    procedure DeclarePlayers;
    begin
    HowManyPlayers := 2; // How many players declared?
    CurrentPlayer := 0; // Number of player to start with.
    NumberOfPlayers(HowManyPlayers);

    with Players[0] do
    begin
    Name := ''; // Characters full RS username.
    Pass := 'predr'; // Characters RS password.
    Nick := 'amm'; // 3 non-caps letters of char's RS username.
    Integers[0] := 15; //Loads to do.
    Active := True;
    end;
    { <-- To use more players, uncomment this section and change HowManyPlayers
    to match with the current amount of players declared. }

    with Players[1] do
    begin
    Name := 'nauakhlaq';
    Pass := 'watc99';
    Nick := 'aum';
    Integers[0] := 15; //Loads to do.
    Active := True;
    end;

    {
    with Players[2] do
    begin
    Name := '';
    Pass := '';
    Nick := '';
    Integers[0] := 5; //Loads to do.
    Active := True;
    end;
    }
    {
    with Players[3] do
    begin
    Name := '';
    Pass := '';
    Nick := '';
    Integers[0] := 5; //Loads to do.
    Active := True;
    end;
    }
    end;

    Procedure AntiBan(TState : (Walk, Normal); HowLong : Integer);
    Var
    CurTab, I : Integer;

    Begin
    Case TState Of
    Walk : While FFlag(0) Do
    Begin
    If Random(4) = 0 Then
    SleepAndMoveMouse(900 + Random(300));

    If Random(5) = 0 Then
    Begin
    GameTab(RandomRange(TAB_COMBAT, TAB_LOGOUT));
    Wait(600 + Random(400));
    FindNormalRandoms;
    End;
    End;

    Normal :
    Case HowLong Of
    0..2000 : Case Random(20) Of
    0 : SleepAndMoveMouse(HowLong + Random(HowLong/10));
    1 : Begin
    CurTab := GetCurrentTab;
    GameTab(RandomRange(TAB_Combat, TAB_LogOut));
    Wait(HowLong + Random(HowLong/10));
    GameTab(CurTab);
    End;
    2 : RandomRClick;
    End;

    2001..5000 : Case Random(20) Of
    0 : HoverSkill('random', False);
    1 : PickUpMouse;
    2 : SleepAndMoveMouse(HowLong + Random(HowLong/10));
    3 : If Random(10) Mod 2 = 0 Then
    ExamineInv;
    End;

    5001..10000 : If Random(200) = 1 Then
    RandomMovement
    Else
    If Random(10) = 0 Then
    AntiBan(Normal, Round(HowLong/2) + Random(1000));

    10001..20000 : Case Random(20) Of
    0 : AntiBan(Normal, Round(HowLong/2) + Random(1000));
    1 : BoredHuman;
    2 : RandomAngle(1);
    End;

    20001..999999 : If Random(10) = 5 Then
    AntiBan(Normal, 7000 + Random(200));
    End;
    End;
    End;

    Procedure NDebug(Player, PMessage : String; PLogOut, Active : Boolean);
    Begin
    If Player <> '' Then
    WriteLn('[NDEBUG] - '+Player+': '+Pmessage+'. (>>| '
    +MsToTime(GetSystemTime, Time_Bare)+' |<<)')
    Else
    WriteLn('[NDEBUG] - '+Pmessage+'. (>>| '
    +MsToTime(GetSystemTime, Time_Bare)+' |<<)');

    If PLogOut Then
    NextPlayer(Active);
    End;

    Function BankWalk(OffSet, SortP : TPoint; RandX, RandY : Integer) : Boolean;
    Var
    TPA : TPointArray;
    ATPA : T2DPointArray;
    P : TPoint;
    Begin
    FindNormalRandoms;
    ColorToleranceSpeed(1);
    FindColorsTolerance(TPA, 60909, MMX1, MMY1, MMX2, MMY2, 10);

    ATPA := SplitTPA(TPA, 15);
    SortATPAFromFirstPoint(ATPA, SortP);

    If Length(ATPA[0]) > 0 Then
    P := MiddleTPA(ATPA[Low(ATPA)]);

    Mouse(P.X + OffSet.X, P.Y + OffSet.Y, RandX, RandY, True);
    Wait(800 + Random(200));

    Result := ((FlagPresent) Or (IsMoving));
    FindNormalRandoms;
    End;

    Function WalkToTrees : Boolean;
    Var TPA : TPointArray;
    P : TPoint;
    ATPA : T2DPointArray;
    Begin
    If BankWalk(Point(-14, 50), Point(MMCX, MMCY), 5, 5) Then
    Begin
    NDebug(Players[CurrentPlayer].Name, 'Walking from Bank to Yew Trees', False, True);
    AntiBan(Walk, -1);
    End Else
    NDebug(Players[CurrentPlayer].Name, 'Could NOT Walk from Bank to Yews', True, False);

    While IsMoving Do Wait(100);

    FindColorsTolerance(TPA, 494860, MMX1, MMY1, MMX2, MMY2, 10);
    If Length(TPA) > 1 Then
    Try
    ATPA := SplitTPA(TPA, 6);
    P.X := Trunc(ATPA[0][5].X + ATPA[1][3].X) Shr 1;
    P.Y := Trunc(ATPA[0][4].Y + ATPA[1][2].Y) Shr 1;
    Finally
    P := Point((ATPA[0][0].X + ATPA[1][0].X) Shr 1, (ATPA[0][0].Y + ATPA[1][0].Y) Shr 1);
    Except
    WriteLn('Finding the middle screwed up..');
    End;

    If ((P.X Xor P.Y) = 0) Then
    Begin
    NDebug('', 'Couldn''t Find any Yew Tree MM Points', False, True);
    NDebug('', 'Trying FindBitmaps', False, True);

    LoadSymbolBitmapColor('Tree');

    If FindBitmaps(SymbolBitmap, TPA, MMX1, MMY1, MMX2, MMY2) Then
    P := Point((TPA[0].X + TPA[1].X) Shr 1, (TPA[0].Y + TPA[1].Y) Shr 1);

    FreeBitmap(SymbolBitmap);
    End;

    If (P.X = 0) And (P.Y = 0) Then
    NDebug(Players[CurrentPlayer].Name, 'Could NOT get to Yews', True, False)
    Else
    Begin
    Mouse(P.X + 2, P.Y + 3, 2, 2, True);
    AntiBan(Walk, -1);
    Result := True;
    NDebug(Players[CurrentPlayer].Name, 'Is at Yews', False, True)
    FindNormalRandoms;
    End;
    Wait(1);
    End;

    Function FindYew(Var X, Y : Integer) : Boolean;
    Var
    I : Integer;
    TPA : TPointArray;
    ATPA : T2DPointArray;

    Begin
    ColorToleranceSpeed(2);
    SetColorSpeed2Modifiers(0.05, 1.03);

    FindNormalRandoms;

    FindColorsTolerance(TPA, 2385753, MSX1, MSY1, MSX2, MSY2, 5);
    SortTPAFrom(TPA, Point(MSCX, MSCY));
    ATPA := SplitTPAEx(TPA, 3, 4);
    SortATPAFromSize(ATPA, 3*7*3, True);

    If (Length(ATPA) < 3) Then
    Begin
    Result := False;
    Exit;
    End;
    //DebugATPABounds(ATPA, '');

    For I := 0 To High(ATPA) Do
    If MiddleTPAEx(ATPA[I], X, Y) Then
    If Not PointInBox(Point(X, Y), IntToBox(0, 0, 514, 111)) Then
    Begin
    MMouse(X, Y, 4, 2);
    If WaitUpTextMulti(['Yew', 'hop'], SRL_MaxWaitTime) Then
    Begin
    Result := True;
    GetMousePos(X, Y);
    NDebug(Players[CurrentPlayer].Name, 'Found Yew Tree At ('+IntToStr(X)+
    ', '+IntToStr(Y)+')', False, True);
    Exit;
    End Else
    Continue;
    End;
    End;

    Function IsYewThere : Boolean;
    Begin
    ColorToleranceSpeed(2);
    SetColorSpeed2Modifiers(0.05, 1.03);

    Result := (CountColorTolerance(2385753, MSCX - 80,
    MSCY - 80, MSCX + 80, MSCY + 80, 5) >= Trunc(MaxYewCount))
    FindNormalRandoms;
    End;

    Function GetYewLoc : String;
    Begin
    If Distance(TX, TY, MSCX - 190, MSCY) < Distance(TX, TY, MSCX + 190, MSCY) Then
    Result := 'South'
    Else
    Result := 'North';
    End;

    Procedure ChopTree;
    Var Mark : Integer;
    TPA : TPointArray;
    ATPA : T2DPointArray;
    P : TPoint;
    TmpStr : String;
    Begin
    Repeat
    MarkTime(Mark);
    If FindYew(TX, TY) Then
    Begin
    Case Random(3) Of
    0 : Mouse(TX, TY, 0, 0, True);
    1 : Begin
    Mouse(TX, TY, 0, 0, False);
    WaitOption('hop', SRL_MaxWaitTime);
    End;
    2 : Begin
    Wait(600 + Random(200));
    Mouse(TX, TY, 10, 10, True);
    End;
    End;
    FFlag(0);
    While IsMoving Do Wait(100);

    TmpStr := GetYewLoc;
    NDebug(Players[CurrentPlayer].Name, 'Clicked on the '+TmpStr+' Yew', False, True);

    While IsYewThere Do
    Begin
    FindNormalRandoms;
    Wait(1000 + Random(1000));
    AntiBan(Normal, 3500);

    If Random(13) = 0 Then
    If FindYew(TX, TY) Then
    Mouse(TX, TY, 0, 0, True);

    If Random(2) = 0 Then
    SleepAndMoveMouse(200 + Random(800));
    If InvFull Then Break;
    End;
    End Else
    AntiBan(Normal, 5002);

    If (Not (IsYewThere)) Or (InvFull) Then
    Begin
    If Not (Pos('iddle', GetDebugLine(GetDebugLineCount-1)) > 0) Then
    NDebug(Players[CurrentPlayer].Name, 'Chopped the Yew down, Going to Middle', False, True);
    ColorToleranceSpeed(1);
    FindColorsTolerance(TPA, 494860, MMX1, MMY1, MMX2, MMY2, 10);
    FilterPointsPie(TPA, 0.0, 359.9, 1.20, 75.00, MMCX, MMCY);

    FindNormalRandoms;

    If Length(TPA) > 1 Then
    Try
    ATPA := SplitTPA(TPA, 6);
    P.X := Trunc(ATPA[0][0].X + ATPA[1][0].X) Shr 1;
    P.Y := Trunc(ATPA[0][0].Y + ATPA[1][0].Y) Shr 1;
    Finally
    P := Point((ATPA[0][0].X + ATPA[1][0].X) Shr 1, (ATPA[0][0].Y + ATPA[1][0].Y) Shr 1);
    Except
    WriteLn('Finding the middle screwed up..');
    End;
    If Not PointInBox(Point(MMCX, MMCY),
    IntToBox(P.X - 9, P.Y - 9, P.X + 9, P.Y + 9)) Then
    Begin
    MouseFlag(P.X - (Integer(GetYewLoc = 'North')*8),
    P.Y, 0, 3, 0);
    While IsMoving Do Wait(100);
    FindNormalRandoms;
    End Else
    Begin
    FindNormalRandoms;
    If Random(10) = 1 Then
    AntiBan(Normal, 5003);
    End;
    End;
    Until(InvFull) Or (Not LoggedIn);
    If InvFull Then
    Begin
    NDebug(Players[CurrentPlayer].Name, 'Inventory is full of logs',
    False, True);
    IncEx(LogsCut, 27);
    FindNormalRandoms
    End Else
    NDebug(Players[CurrentPlayer].Name, 'Logged Out?', True, False);
    End;

    Procedure BankYews;
    Var TPA : TPointArray;
    Begin
    ColorToleranceSpeed(1);
    FindColorsTolerance(TPA, 1787389, 543, 87, MMX2, MMY2, 15);
    Mouse(TPA[0].X + 55, TPA[0].Y, 5, 5, True);

    AntiBan(Walk, -1);
    While IsMoving Do Wait(100);

    FindNormalRandoms;

    If FindSymbol(TX, TY, 'Bank') Then
    Begin
    If Not FlagPresent Then
    MouseFlag(TX, TY, 4, 4, 0);
    End Else
    If Not BankWalk(Point(-9, -7), Point(MMCX + 30, MMCY), 3, 3) Then
    NDebug(Players[CurrentPlayer].Name, 'Could NOT get to Bank', True, False);

    AntiBan(Walk, -1);
    While IsMoving Do Wait(100);

    If (Not OpenBankNPC) Or (Not OpenBankFast(Bank_EV)) Then
    NDebug(Players[CurrentPlayer].Name, 'Could NOT get to Bank', True, False)
    Else
    If BankScreen Xor PinScreen Then
    Begin
    If PinScreen Then InPin(Players[CurrentPlayer].PIN);
    Deposit(2, 28, True);
    Wait(700 + Random(800));
    CloseBank;
    Inc(Loads);
    FindNormalRandoms;
    End;
    End;


    Procedure Proggie;
    Begin
    WriteLn('');
    WriteLn('[~]>>---------- Yew Tree Chopper V0.1 ----------<<[~]');
    WriteLn('>>> Runtime: '+TimeRunning);
    WriteLn('>>> Logs Chopped: '+IntToStr(LogsCut));
    WriteLn('>>> Loads Cut: '+IntToStr(Loads));
    WriteLn('>>> Experience Gained: '+IntToStr(175 * LogsCut));
    WriteLn('{--------------------------------------------------}');
    WriteLn('>>> Current Player = '+IntToStr(CurrentPlayer));
    WriteLn('>>> Using '+IntToStr(HowManyPlayers)+' Player[s]');
    WriteLn('{---------- By Naum (Thanks for Using)! -----------}');
    WriteLn('');
    End;

    Begin
    {$IFDEF SMART}
    Smart_Server := 80;
    Smart_Members := False;
    Smart_Signed := True;
    Smart_SuperDetail := False;
    {$ENDIF}
    SetupSRL;
    DeclarePlayers;
    ActivateClient;

    Proggie;
    Repeat
    If Not LoggedIn Then LoginPlayer;

    ClickNorth(True);
    SetRun(True);
    Repeat
    MakeCompass('N');
    WalkToTrees;
    MakeCompass('W');
    Wait(200 + Random(200));
    ChopTree;
    BankYews;
    Proggie;
    Until(Loads >= Players[CurrentPlayer].Integers[0]) Or (Not LoggedIn);

    Loads := 0;
    LogsCut := 0;

    If Not LoggedIn Then
    NextPlayer(False)
    Else
    Begin
    WriteLn('Loads Done!');
    WriteLn('Switching Player!!!!');
    Proggie;
    NextPlayer(True);
    End;
    Until(AllPlayersInactive);
    Proggie;
    End.

    [~]>>---------- Yew Tree Chopper V0.1 ----------<<[~]
    >>> Runtime: 1 Hours, 38 Minutes and 25 Seconds
    >>> Logs Chopped: 189
    >>> Loads Cut: 8
    >>> Experience Gained: 33075
    {--------------------------------------------------}
    >>> Current Player = 0
    >>> Using 1 Player[s]
    {---------- By Naum (Thanks for Using)! -----------}

    Blumblebee

    2010-04-25 14:33:05

    I could attempt to add my Kharid Cooker to MSI. Aswell as I have been dabbling with the Karijama (can't spell it) Lobster fisher and general store seller.

    Funnily enough i have 10+ scripts that are…80% done, missing some core things (sorry the pun was there).

    Why don't we all post up some unfinished things/finishing things and work towards a conversion?

    edit: my list includes

    - edgeville yew chopper (ironically enough)
    - edgeville fisher (I finished it but not really)
    - fletcher/stringer
    - kharid cooker
    - autofighter
    - powerskills
    - varrock east miner
    - varrock west miner

    all of those are ranging from 30-90% completed.

    Coh3n

    2010-04-25 17:26:43

    From: Blumblebee
    I could attempt to add my Kharid Cooker to MSI. Aswell as I have been dabbling with the Karijama (can't spell it) Lobster fisher and general store seller.

    Funnily enough i have 10+ scripts that are…80% done, missing some core things (sorry the pun was there).

    Why don't we all post up some unfinished things/finishing things and work towards a conversion?

    edit: my list includes

    - edgeville yew chopper (ironically enough)
    - edgeville fisher (I finished it but not really)
    - fletcher/stringer
    - kharid cooker
    - autofighter
    - powerskills
    - varrock east miner
    - varrock west miner

    all of those are ranging from 30-90% completed.

    The thing is, I don't want to get too much going at once so that everything gets messed up. I think we should just incorporate a couple things for now. The Yew cutter can be added easily (just add walk points, basically).

    @NCDS: We could have a case in MSI_ChopInvFull so if the player is cutting at Edge yews, it calls a "NextTree" procedure or something like that. That seems like a pretty simple way of going about it, that I can think of anyway.

    NCDS

    2010-04-25 17:33:50

    From: Coh3n

    @NCDS: We could have a case in MSI_ChopInvFull so if the player is cutting at Edge yews, it calls a "NextTree" procedure or something like that. That seems like a pretty simple way of going about it, that I can think of anyway.

    Think you misunderstood my question.

    How do you guy's want to go about getting to the next tree is my question. Do you want to go to the middle how Naum does it, just wait Random(30000) how I do it currently, or write an algorithm to be able to tell which tree you are at and move the screen accordingly to be able to see both tree's?

    The last one might throw off the tree detection though if not done properly.

    Blumblebee

    2010-04-25 17:38:32

    From: NCDS
    Think you misunderstood my question.

    How do you guy's want to go about getting to the next tree is my question. Do you want to go to the middle how Naum does it, just wait Random(30000) how I do it currently, or write an algorithm to be able to tell which tree you are at and move the screen accordingly to be able to see both tree's?

    The last one might throw off the tree detection though if not done properly.


    I has algorithm.

    Coh3n

    2010-04-25 17:39:45

    From: NCDS
    Think you misunderstood my question.

    How do you guy's want to go about getting to the next tree is my question. Do you want to go to the middle how Naum does it, just wait Random(30000) how I do it currently, or write an algorithm to be able to tell which tree you are at and move the screen accordingly to be able to see both tree's?

    The last one might throw off the tree detection though if not done properly.

    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.

    NCDS

    2010-04-25 17:46:32

    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('.|&#8364;stat&#8364;|.', [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('.|&#8364;stat&#8364;|.', 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.

    Coh3n

    2010-04-25 17:48:34

    From: NCDS
    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.

    I like that, but I'd rather it wait for a full 30 seconds for the tree. Otherwise it could run to the tree, wait 1ms then go back. :p

    Blumblebee

    2010-04-25 17:50:55

    keep in mind this is 3+months old. January specifically I think.
    (*
    __ ) | | | | &#8482;
    __ \ | | | __ `__ \ __ \ | _ \ __ \ _ \ _ \
    | | | | | | | | | | | __/ | | __/ __/
    ___/ _|\__,_|_| _| _|_.__/ _|\___|_.__/ \___|\___| EdgeChop © 2010
    *)
    {.include SRL/SRL/misc/SMART.scar}
    {.include SRL/SRL.scar}

    Function CalcTreeRespawn(PlayerNo: Integer): Integer;
    begin
    Result := (Ceil(120 - 0.03 * PlayerNo) * 1000);
    end;

    type Dir = (Yew, Bank);
    Loc = (Top, Bottom);

    Function AdjustPosition: Loc; forward;

    const
    Area = 0;
    Movement = 1;

    WC_loop = 1;
    Bank_loop = 2;
    Failsafe = 3;
    Alert = 4;
    LoadPerPlayer = 5;
    Timer = 6;

    var aTbox: array [0..1] of TBox;

    procedure DeclarePlayers;
    begin
    HowManyPlayers := 1;
    CurrentPlayer := 0;
    NumberOfPlayers(HowManyPlayers);

    Players[0].Name := '';
    Players[0].Pass := '';
    Players[0].Integers[LoadPerPlayer] := 5;
    Players[0].Active := True;
    end;

    Function GetMMPoints(x, y, color, width, height, tolerance: Integer): TpointArray;
    var tpa: TpointArray; atpa: T2DpointArray; l, i, p: Integer;
    begin
    FindColorsSpiralTolerance(x, y, tpa, color, MMx1, MMy1, MMx2, MMy2, tolerance);
    Atpa := TPAtoATPAEx(Tpa, width, height);
    for i := 0 to High(atpa) do
    begin
    if Length(atpa) > 5 then
    begin
    l := getarraylength(Result);
    SetArrayLength(Result, l+1);
    Result[l] := MiddleTpa(atpa[i]);
    end;
    end;
    if Length(result) = 0 then Exit;
    for i := 0 to High(Result) do
    if rs_OnMiniMap(result[i].x, result[i].y) then Inc(p);
    if p = 0 then SetArrayLength(Result, 0);
    end;

    Function GetSymbolArea(Color: Integer; Hue, Sat: Extended; Tol: Integer): TPointArray;
    var TPA: TPointArray; ATPA: T2DPointArray; P: TPoint; l, i: integer;
    begin
    ColorToleranceSpeed(2);
    SetColorSpeed2Modifiers(Hue, Sat);
    FindColorsSpiralTolerance(MMcx, MMcy, TPA, Color, MMx1, MMy1, MMx2, MMy2, Tol);
    ColorToleranceSpeed(1);
    SetColorSpeed2Modifiers(0.2, 0.2);
    if Length(TPA) <= 0 then Exit;
    ATPA := SplitTPAEx(TPA, 5, 5);
    for i := 0 to High(ATPA) do
    begin
    P := MiddleTPA(ATPA[i]);
    if rs_OnMiniMap(P.x,P.y) then
    begin
    l := getarraylength(Result);
    SetArrayLength(Result, l+1);
    Result[l] := P;
    end;
    end;
    end;

    Function CreateSymbolBox(TPA: TPointArray; TP: TPoint): TBox;
    var nTPA, oTPA: TPointArray;
    begin
    oTPA := TPA;
    if Length(oTPA) <= 0 then Exit;
    sortTPAFrom(oTPA, Point(TP.x, TP.y));
    FindColorsTolerance(nTPA, 65536, oTPA[0].x-7, oTPA[0].y-7, oTPA[0].x+7, oTPA[0].y+7, 10);
    if Length(nTPA) > 0 then
    Result := GetTPABounds(nTPA);
    end;

    Function FindUniqueColors(Col: Integer; rTPA: TPointArray; Area: TPoint): Integer;
    var SymBox: TBox; TPA: TPointArray; List1, List2, List3 : TIntegerArray; i, ii, Tol, L: integer;
    begin
    SymBox := CreateSymbolBox(rTPA, Area);
    FindColorsTolerance(TPA, 0, SymBox.x1, SymBox.y1, SymBox.x2, SymBox.y2, 225);
    List1 := GetColors(TPA);
    List2 := List1;
    ClearSameIntegers(List1);
    for i := 0 to High(List2) do
    begin
    for ii := 0 to High(List1) do
    begin
    if List1[ii] = List2[i] then
    begin
    L := getarraylength(List3);
    SetArrayLength(List3, L+1);
    List3[L] := List1[ii];
    end;
    end;
    end;
    Tol := 5;
    while Result = 0 do
    begin
    for i := 0 to High(List3) do
    begin
    if SimilarColors(List3[i], Col, Tol) then
    begin
    Result := List3[i];
    WriteLn('Unique Symbol Color = '+IntToStr(Result));
    Exit;
    end;
    end;
    IncEx(Tol, 1);
    end;
    end;

    Function GetUniqueSymbolColor(x, y: Integer; Color: Integer; Hue, Sat: Extended; Tol: Integer): Integer;
    begin
    Result := FindUniqueColors(Color, GetSymbolArea(Color, Hue, Sat, Tol), Point(x, y));
    end;

    Function WalkLocation(Direction: Dir): Boolean;
    var TP: TPoint; TPA: TPointArray; i: Integer; AreaBox: TBox; x, y: Integer; eWait: Boolean;
    label EnterBank;
    begin
    case Direction of
    Yew:
    begin
    RoadColor := GetUniqueSymbolColor(600, 120, 229638, 0.17, 0.45, 15);
    Result := FindColor(TP.x, TP.y, RoadColor, MMx1, MMy1, MMx2, MMy2);
    if Result then
    begin
    Mouse(TP.x, TP.y+RandomRange(9, 14), 5, 5, True);
    Flag;
    Wait(750+random(550));
    Players[CurrentPlayer].Booleans[Area] := True;
    Players[CurrentPlayer].Loc := 'North';
    Exit;
    end;
    end;
    Bank:
    begin
    WriteLn('Bank Walk Initiated');
    case Players[CurrentPlayer].Loc of
    'North':
    begin
    EnterBank:
    TPA := GetMMPoints(MMcx, 35, 1120340, 2, 2, 20);
    if Length(TPA) < 0 then
    begin
    Writeln('Walking Failed');
    nextPlayer(False);
    Exit;
    end;
    for i := 0 to High(TPA) do
    begin
    if not rs_OnMiniMap(TPA[i].x, TPA[i].y) then continue;
    Mouse(TPA[i].x, TPA[i].y, 5, 5, True);
    wait(500+random(100));
    if FlagPresent then
    begin
    Result := True;
    Flag;
    if not eWait then Wait(10500+random(750));
    Exit;
    end;
    end;
    end;
    'South':
    begin
    AreaBox := aTBox[0];
    RoadColor := GetUniqueSymbolColor(600, 120, 229638, 0.17, 0.45, 15);
    if FindColorTolerance(x, y, RoadColor, AreaBox.x1, AreaBox.y1, AreaBox.x2, AreaBox.y2, 5) then
    begin
    Mouse(x+30, y, 5, 5, True);
    wait(150+random(500));
    FFlag(10);
    eWait := True;
    Goto EnterBank;
    end;
    end;
    end;
    end;
    end;
    end;

    Function ExaminePlayerFormation: Boolean;
    var PlayerBox: TBox; TPA: TPointArray; ATPA: T2DPointArray; P: TPoint;
    begin
    PlayerBox.x1 := MMcx-15;
    PlayerBox.y1 := MMcy-15;
    PlayerBox.x2 := MMcx+15;
    PlayerBox.y2 := MMcy+15;
    FindColors(TPA, 16711422, MMx1, MMy1, MMx2, MMy2);
    if Length(TPA) <= 0 then Exit;
    ATPA := TPAtoATPAEx(TPA, 10, 10);
    if length(ATPA) <= 0 then Exit;
    SortATPASize(ATPA, True);
    P := MiddleTPA(ATPA[0]);
    if PointInBox(P, PlayerBox) then
    begin
    Players[CurrentPlayer].Booleans[Movement] := True;
    MarkTime(Players[CurrentPlayer].Integers[Timer]);
    Result := True;
    Exit;
    end;
    end;

    Function AdjustPosition: Loc;
    var AreaBox: TBox; Index, x, y, adjust: Integer;
    begin
    case Players[CurrentPlayer].Booleans[Area] of
    False:
    begin
    Players[CurrentPlayer].Loc := 'North';
    Result := Top;
    Index := 0;
    RoadColor := GetUniqueSymbolColor(625, 45, 229638, 0.17, 0.45, 15);
    adjust := 10;
    end;
    True:
    begin
    Players[CurrentPlayer].Loc := 'South';
    Result := Bottom;
    Index := 1;
    RoadColor := GetUniqueSymbolColor(600, 120, 229638, 0.17, 0.45, 15);
    adjust := -5;
    end;
    end;
    WriteLn('Movement towards '+Players[CurrentPlayer].Loc+' required');
    AreaBox := aTbox[Index];
    if not FindColorTolerance(x, y, RoadColor, AreaBox.x1, AreaBox.y1, AreaBox.x2, AreaBox.y2, 5) then
    begin
    RoadColor := GetUniqueSymbolColor(MMcx, MMcy, 229638, 0.17, 0.45, 15);
    if not FindColorTolerance(x, y, RoadColor, AreaBox.x1, AreaBox.y1, AreaBox.x2, AreaBox.y2, 5) then
    begin
    WriteLn('Could not Locate Tree Symbol');
    NextPlayer(False);
    Exit;
    end;
    end;
    Mouse(x, y+adjust, 3, 3, True);
    Wait(100+random(100));
    Flag;
    Wait(500+random(500));
    end;

    Function FollowPixelBox(Point: TPoint): Boolean;
    var i, col, tempCount, x, y: Integer;
    begin
    Col := GetColor(Point.x, Point.y);
    WriteLn('Yew Color = '+IntToStr(Col));
    i := GetSystemTime;
    tempCount := InvCount;
    while FindColorTolerance(x, y, Col, Point.x-15, Point.y-15, Point.x+15, Point.y+15, 15) do
    begin
    FindNormalRandoms;
    Wait(150+random(100));
    if (GetSystemTime-i > RandomRange(25000, 50000)) then
    Break;
    if InvFull then Break;
    if InvCount <> TempCount then
    begin
    i := Getsystemtime;
    tempCount := InvCount;
    end;
    end;
    Result := True;
    end;

    Function AllocateTreePoints: TPointArray;
    var TPA: TPointArray; ATPA: T2DPointArray; i, L: Integer;
    begin
    ColorToleranceSpeed(2);
    SetColorSpeed2Modifiers(0.12, 2.03);
    FindColorsSpiralTolerance(MScx+5, MScy, TPA, 1594181, MSx1, MSy1, MSx2, MSy2, 3);
    ColorToleranceSpeed(1);
    SetColorSpeed2Modifiers(0.2, 0.2);
    if Length(TPA) <= 0 then Exit;
    ATPA := TPAtoATPAEx(TPA, 5, 5);
    SortATPASize(ATPA, True);
    for i := 0 to High(ATPA) do
    begin
    if Length(ATPA) > 5 then
    begin
    L := getarraylength(Result);
    SetArrayLength(Result, L+1);
    Result[L] := MiddleTpa(atpa[i]);
    end;
    end;
    end;

    Function FindandFollowTree: Boolean;
    var TPA: TPointArray; x, y: Integer; i, index: Integer; Bool: Boolean;
    begin
    TPA := AllocateTreePoints;
    if Length(TPA) < 2 then Exit;
    for i := 0 to 2 do
    begin
    if InRange(TPA[i].x, 0, 210) then continue;
    MMouse(TPA[i].x, TPA[i].y, 5, 5);
    wait(150+random(200));
    if IsUpTextMultiCustom(['ree', 'ew', 'Ye', 'Yew']) then
    begin
    Index := i;
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, True);
    Players[CurrentPlayer].Booleans[movement] := False;
    Players[CurrentPlayer].Integers[Failsafe] := 0;
    Players[CurrentPlayer].Integers[4] := 0;
    Bool := True;
    Break;
    end;
    end;
    if not Bool then Exit;
    Result := FollowPixelBox(Point(TPA[Index].x, TPA[Index].y));
    MarkTime(Players[CurrentPlayer].Integers[Timer]);
    end;

    Function OpenBankCustom: Boolean;
    var TPA: TPointArray; ATPA: T2DPointArray; P: TPoint; i, x, y: Integer;
    begin
    Wait(750+random(500));
    ColorToleranceSpeed(2);
    SetColorSpeed2Modifiers(0.04, 0.90);
    FindColorsTolerance(TPA, 3492438, MSx1, MSy1, MSx2, MSy2, 10);
    ColorToleranceSpeed(1);
    SetColorSpeed2Modifiers(0.2, 0.2);
    if Length(TPA) <= 0 then Exit;
    ATPA := TPAtoATPAEx(TPA, 10, 10);
    SortATPASize(ATPA, True);
    for i := 0 to High(ATPA) do
    begin
    P := MiddleTPA(ATPA[i]);
    MMouse(P.x, P.y, 5, 5);
    wait(150+Random(300));
    if IsUpText('ooth') then
    begin
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, False);
    wait(150+random(300));
    Result := ChooseOption('uickly');
    Exit;
    end;
    end;
    end;

    Function CreateSystemLoop(Index: Integer): Boolean;
    var a: Integer; recent: boolean;
    begin
    case Index of
    WC_loop:
    begin
    while not InvFull do
    begin
    if InvFull then Break;
    if ((Players[CurrentPlayer].Integers[4]) > 3) then
    begin
    WriteLn('Unable to Find Yew Tree in over 3 Area''s');
    NextPlayer(False);
    end;
    if not FindandFollowTree then
    begin
    Inc(Players[CurrentPlayer].Integers[Failsafe]);

    if recent then wait(5500+random(5000));
    if Players[CurrentPlayer].Integers[4] > 2 then
    if ExaminePlayerFormation then
    if Players[CurrentPlayer].Booleans[movement] then
    if (TimeFromMark(Players[CurrentPlayer].Integers[Timer]) < RandomRange(20000, 30000)) then
    Players[CurrentPlayer].Integers[Failsafe] := 0;
    Recent := False;
    end;
    if Players[CurrentPlayer].Integers[Failsafe] > 5 then
    begin
    AdjustPosition;
    recent := True;
    if Players[CurrentPlayer].Booleans[Area] then Players[CurrentPlayer].Booleans[Area] := False else Players[CurrentPlayer].Booleans[Area] := True;
    Players[CurrentPlayer].Integers[Failsafe] := 0;
    Inc(Players[CurrentPlayer].Integers[4]);
    end;
    end;
    Result := InvFull;
    end;
    Bank_Loop:
    begin
    if WalkLocation(Bank) then
    if OpenBankCustom then
    begin
    a := getsystemtime;
    while GetsystemTime-a < 5000 do
    begin
    if BankScreen then break;
    wait(250+random(250));
    FindNonInventoryRandoms;
    end;
    Deposit(RandomRange(5, 10), 28, True);
    end;
    Result := WalkLocation(Yew);
    end;
    end;
    end;

    var i: Integer;

    begin
    SMART_Server := 81;
    SMART_Members := False;
    SMART_Signed := True;
    SMART_SuperDetail := False;
    SetUpSRL;
    DeclarePlayers;

    aTbox[0].x1 := MMx1;
    aTbox[0].y1 := MMy1;
    aTbox[0].x2 := MMx2;
    aTbox[0].y2 := MMcy;

    aTbox[1].x1 := MMx1;
    aTbox[1].y1 := MMcy;
    aTbox[1].x2 := MMx2;
    aTbox[1].y2 := MMy2;

    repeat
    Wait(500+random(500));
    if not LoggedIn then LogInPlayer;
    Wait(750+random(750));
    SetAngle(True);
    SetRun(True);
    while Players[CurrentPlayer].Active do
    begin
    if not WalkLocation(Yew) then NextPlayer(False);
    for i := 0 to Players[CurrentPlayer].Integers[LoadPerPlayer] do
    begin
    if not CreateSystemLoop(WC_Loop) then Break;
    if not CreateSystemLoop(Bank_Loop) then Break;
    end;
    end;
    until AllPlayersInactive;
    end.

    mine.

    take not of…

    Function CalcTreeRespawn(PlayerNo: Integer): Integer;
    begin
    Result := (Ceil(120 - 0.03 * PlayerNo) * 1000);
    end;

    thank Zeph for that.

    PlayerNo = numbers of players in the specific world.

    NCDS

    2010-04-25 17:56:05

    From: Coh3n
    I like that, but I'd rather it wait for a full 30 seconds for the tree. Otherwise it could run to the tree, wait 1ms then go back. :p


    Yeah I thought about doing RandomRange(5000, 30000); but waiting 30 seconds per tree when a lot of the time people are chopping both tree's doesn't seem too efficient.

    Coh3n

    2010-04-25 18:01:41

    From: NCDS
    Yeah I thought about doing RandomRange(5000, 30000); but waiting 30 seconds per tree when a lot of the time people are chopping both tree's doesn't seem too efficient.

    Oh yeah, I didn't think about people chopping both at the same time. :p I just remember when I used to play that usually only one was being chopped at a time… or I could just be going insane lol I don't know. :p