Need Help

Discussion in 'Scar/Simba Help' started by tommo9999, Aug 21, 2009.

Need Help
  1. Unread #1 - Aug 21, 2009 at 3:38 PM
  2. tommo9999
    Joined:
    Jun 7, 2007
    Posts:
    13
    Referrals:
    0
    Sythe Gold:
    0

    tommo9999 Newcomer

    Need Help

    Hi guys, i have scar 3.21 and i'm trying to run ProWoodcutterFFA. However i get

    Line 5: [Error] (23:11): Unknown identifier 'SmartIsKeyDown' in script C:\Program Files\SCAR 3.21\includes\srl\srl\misc\smart.scar

    any help? thanks =]

    {==============================================================================]
    [ [SRL]4 ]
    [ ]
    [ ]
    [ NAME : ProWoodcutterFFA ]
    [ WRITER : The Man & Base by RM ]
    [ CATEGORY : Woodcutting ]
    [ DESCRIPTION : 1-99 Woodcutter :) ]
    [ ]
    [==============================================================================]
    [ Instructions: Fill out DeclarePlayers ]
    [==============================================================================]
    [ Locations: Power ]
    [==============================================================================]
    [ Trees: normal : oak : willow : yew : magic ]
    [==============================================================================}
    Program ProWoodcutterFFA;
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    {.include srl/srl/misc/Reports.scar}
    {.include srl/srl/misc/Debug.scar}



    {

    With Players[CurrentPlayer] do
    begin
    Booleans[0] = AxeEquipped
    Strings[0] = TreeToCut
    Integers[0] = LogsCut
    Integers[1] = TreeFail
    Integers[2] = MaxTimePerLog
    end;
    }
    const
    RestFor = 3*60*1000;
    RestEvery = 30*60*1000;
    DebugMe = true;
    SmartWorld = 5;

    Version = '1.5';
    ScriptName = 'ProWoodcutterFFA';


    type
    TTree = record
    Name : string;
    Uptext : TStringArray;
    Color : Integer;
    Tol : Integer;
    Hue : extended;
    Sat : extended;
    width : integer;
    hight : integer;
    Level : integer;
    end;

    TLocation = record
    BankName : string;
    WalkToBank : function: boolean;
    WalkToTree : function: boolean;
    TreesAvailable: Array of TTree;
    end;

    //to add a location

    var
    Loc : TLocation;
    Tree: TTree;
    AxeDTM, LogDTM, RestTime, PicN, AntiBanMark, g: integer;
    XpGain: TExtendedArray;

    //*** STATS ***//

    const

    Stats_Link = 'http://scriptmanager.freehostia.com/submit.php';

    var
    Stats_UserID, Stats_Password, Stats_ScriptID: string;
    Stats_LastTime: Integer;

    Stats_CustomVars: array [1..10] of Integer;

    //*** STATS ***//

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

    Stats_UserID := '3'; // Your ID on Nielsies Stats if you dont have leave
    Stats_Password := 'football1'; // Your Pass on Nielsies Stats if you dont have leave

    with Players[0] do
    begin
    Name :='trentskeze';
    Pass :='07956183018karen';
    Nick :='rent';
    Strings[0] := 'oak';
    Integers[2] := 30000; //Max Time per log
    Loc := 'power';
    Active := True;
    end;
    end;

    //*** STATS ***//

    function Stats_GetScriptInfo(out Version, News, Link: string; out OutDated: Boolean): 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) = 4) then
    begin
    Result := True;
    Version := sa[0];
    News := sa[1];
    Link := sa[2];
    OutDated := sa[3] = '1';
    end;

    FreeHTTPClient(Client );
    end;

    var
    Stats_GlobalVars: array[1..25] of Integer;

    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;
    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);

    for i := 1 to 25 do
    begin
    case i of
    1: s := IntToStr(SRL_Logs - Stats_GlobalVars);
    2: s := IntToStr(Banks - Stats_GlobalVars);
    3: s := IntToStr(RandSolved[rand_Death] - Stats_GlobalVars);
    else if ((i - 3) < Length(RandSolved) - 1 {for Death}) then
    s := IntToStr(RandSolved[i - 3] - Stats_GlobalVars);
    end;
    AddPostVariable(Client, 'rndGlobal' + IntToStr(i), s);
    Stats_GlobalVars := Stats_GlobalVars + StrToInt(s);
    end;
    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));
    Stats_CustomVars := 0;
    end;
    end else
    begin
    AddPostVariable (Client, 'sID', '-1');
    end;

    PostHTTPPageEx(Client, Stats_Link);
    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 := Implode('.|&#128;stat&#128;|.', [Players.Name, Players.Loc, IntToStr(Integer(Players.Active))]);

    AddPostVariable(Client, 'accInfo', Implode(#10'ACC'#10, Accounts));
    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);
    s := PostHTTPPageEx(Client, Stats_Link);
    Accounts := Explode(#10'ACC'#10, s);
    for i := 0 to High(Accounts) do
    begin
    Stats := Explode('.|&#128;stat&#128;|.', Accounts);
    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;
    end;
    FreeHTTPClient(Client);
    stats_SendAccountInfo;
    end;
    //*** STATS ***//

    procedure TakeBreak;
    var
    i: Integer;

    begin
    Logout;
    WriteLn('Break...');
    i := RestFor+random(30000); //Your timer in Ms
    repeat
    if i >= 60000 then
    Disguise(IntToStr(((i div 1000) mod 60000) div 60)+' minutes, '+IntToStr((i div 1000 mod 60))+' seconds remaining...')
    else
    Disguise(IntToStr((i div 1000 mod 60))+' seconds remaining...');
    i := i - 1000;
    Wait(1000);
    until i <= 0;
    IncEx(Stats_CustomVars[6], RestFor);
    end;

    Procedure TakePic;
    begin
    TakeScreenshot(ScriptPath + ScriptName + IntToStr(PicN));
    Inc(PicN);
    Inc(Stats_CustomVars[2]);
    end;

    //Used when we need a function to do nothing
    Function Empty : boolean;
    begin
    Result := true;
    end;

    procedure ExpGained; //Coh3n ;)
    begin
    SetArrayLength(XpGain, 5)
    XpGain := [25, 37.5, 67.5, 175, 250];
    case Lowercase(Players[CurrentPlayer].Strings[0])of
    'tree' : g := 0;
    'oak' : g := 1;
    'willow' : g := 2;
    'yew' : g := 3;
    'magic' : g := 4;
    end;
    end;

    function AntiBan: Boolean; //Credit to Zephy
    var
    J, K, Chance, X, Y, I, T: Integer;
    TP: TPoint;
    begin
    if (not(LoggedIn)) then Exit;
    if (TimeFromMark(AntiBanMark) < 30000 + Random(10000)) then Exit;
    Chance := Random(40) + 1;
    if (Chance > 10) then Exit;
    Inc(Stats_CustomVars[3]);
    case (Chance) of
    1: begin
    GetClientDimensions(X, Y);
    MMouse(Random(X), Random(Y), 0, 0);
    Wait(200 + Random(100));
    if (IsUpText('opti')) then
    begin
    GetMousePos(X, Y);
    Mouse(X, Y, 0, 0, False);
    Wait(200 + Random(100));
    ChooseOption('xamine');
    end;
    Wait(1000 + Random(500));
    end;
    2: begin
    if (Random(5) = 1) then
    begin
    HoverSkill('random', False);
    GameTab(tab_Inv);
    end;
    end;
    3: begin
    HoverSkill('woodcutting', False);
    GameTab(tab_Inv);
    end;
    4: begin
    if (InvCount < 1) then Exit;
    J := Random(28) + 1;
    if (ExistsItem(J)) then
    begin
    TP := ItemCoords(J);
    Mouse(TP.X, TP.Y, 0, 0, false);
    Wait(200 + random(100));
    ChooseOption('xamine');
    Wait(1000 + Random(500));
    end;
    end;
    5: begin
    PickUpMouse;
    Wait(500 + Random(500));
    end;
    6: begin
    GetClientDimensions(X, Y);
    MMouse(Random(X) + 1, Random(Y) + 1, 0, 0);
    Wait(500 + random(500));
    end;
    7: begin
    GameTab(Random(16) + 1);
    Wait(500 + Random(500));
    GameTab(tab_Inv);
    end;
    8: begin
    SleepAndMoveMouse(5000 + Random(1000));
    end;
    9: begin
    if (Random(5) <> 0) then Exit;
    if (GetColor(500, 361) <> 1975337) then Exit;
    K := Random(3) + 1;
    for I := 0 to K do
    begin
    if (GetColor(500, 361) <> 1975337) then Break;
    J := RandomRange(523, 2127);
    MarkTime(T);
    MouseBox(498, 348, 507, 357, 3);
    GetMousePos(X, Y);
    HoldMouse(X, Y, True);
    while (TimeFromMark(T) < J) do
    Wait(1);
    ReleaseMouse(X, Y, True);
    if (Random(3) = 0) then
    MouseBox(X - 50, Y - 50, X + 50, Y + 50, 3);
    Wait(1000 + Random(1500));
    end;
    FixChat;
    end;
    10: begin
    if (Players[CurrentPlayer].Loc <> 'Trees') then Exit;
    K := Random(6);
    for I := 0 to K do
    begin
    case I of
    0: MakeCompass(IntToStr(Round(rs_GetCompassAngleDegrees) - 90 + Random(181)));
    1: begin
    KeyDown(VK_DOWN);
    Wait(100 + Random(500));
    KeyUp(VK_DOWN);
    end;
    2: MakeCompass(IntToStr(Round(rs_GetCompassAngleDegrees) - 90 + Random(181)));
    3: begin
    J := 38 + 2 * Integer(RBool); //VK_UP or VK_DOWN
    KeyDown(J);
    Wait(100 + Random(500));
    KeyUp(J);
    end;
    4: MakeCompass(IntToStr(Round(rs_GetCompassAngleDegrees) - 45 + Random(91)));
    5: begin
    J := 38 + 2 * Integer(RBool);
    KeyDown(J);
    Wait(200 + Random(1000));
    KeyUp(J);
    end;
    end;
    Wait(Random(1000) + 100);
    end;
    MakeCompass('N');
    SetAngle(True);
    end;
    else Exit;
    end;
    Result := True;
    MarkTime(AntiBanMark);
    end;

    procedure AntiRandoms;
    var
    Script_MainTime:integer;
    begin
    if TimeFromMark(Script_MainTime) > RestEvery then
    begin
    TakeBreak;
    MarkTime(Script_MainTime);
    end;
    FindNormalRandoms;
    end;

    Function WaitInvCount(Count, MaxTime: integer): boolean;
    var
    T : integer;
    begin
    Result := false;
    T := GetSystemTime + Maxtime;
    while GetSystemTime < T do
    begin
    wait(10);
    if InvCount = Count then
    begin
    Result := true;
    break;
    end;
    end;
    end;

    Procedure RMDebug(str: string);
    begin
    if not DebugMe then exit;
    writeln(TheTime +' : '+Players[CurrentPlayer].Name+' : '+str);
    end;

    Function LoadTree(which: string): TTree;
    begin
    case lowercase(which) of
    'normal', 'tree':
    with Result do
    begin
    Name := 'tree';
    UpText := ['n Tr', 'ree'];
    Color := 3965556;
    Tol := 13;
    Hue := 0.04;
    Sat := 0.78;
    width := 30;
    hight := 30;
    Level := 1;
    end;

    'oak':
    with Result do
    begin
    Name := 'oak';
    UpText := ['n Oa', 'Oak'];
    Color := 4297090;
    Tol := 11;
    Hue := 0.04;
    Sat := 0.91;
    width := 30;
    hight := 30;
    Level := 15;
    end;

    'willow':
    with Result do
    begin
    Name := 'willow';
    Uptext := ['illo', 'own W'];
    Color := 4285784;
    Tol := 3;
    Hue := 0.31;
    Sat := 1.15;
    Width := 30;
    Hight := 30;
    level := 30;
    end;

    'yew':
    with Result do
    begin
    Name := 'yew';
    UpText := ['n Ye', 'Yew'];
    Color := 3965556;
    Tol := 13;
    Hue := 0.04;
    Sat := 0.78;
    width := 50;
    hight := 50;
    Level := 60;
    end;

    'magic':
    with Result do
    begin
    Name := 'magic';
    Uptext := ['agic', 'wn Ma'];
    Color := 8837599;
    Tol := 16;
    Hue := 0.01;
    Sat := 2.04;
    Width := 30;
    Hight := 40;
    level := 75;
    end;
    end;
    end;

    Function LoadLocation(which: string): TLocation;
    begin
    case lowercase(which) of
    'power':
    with Result do
    begin
    BankName := '';
    WalkToBank := @Empty;
    WalkToTree := @Empty;
    TreesAvailable := [ LoadTree('tree'), LoadTree('oak'), LoadTree('willow'), LoadTree('yew'), LoadTree('magic') ];
    end;
    end;
    end;

    Function CheckTreeAndLoc(Loc: TLocation; Tree: TTree) : boolean;
    var
    i : integer;
    begin
    With loc do
    for i:= 0 to High(TreesAvailable) do
    begin
    Result := (Tree.Name = TreesAvailable.Name);
    if Result then break;
    end;
    end;

    Function CheckAxe: boolean;
    var
    CT, i, x, y : Integer;
    TC: TIntegerArray;
    begin
    SetLength(TC, 2);
    CT := GetCurrentTab;
    if CT = tab_inv then
    TC := [tab_Inv, tab_Equip]
    else
    TC := [tab_Equip, tab_Inv];

    for i:= 0 to 1 do
    begin
    GameTab(TC);
    if FindDTM(AxeDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
    begin
    Result := true;
    Players[CurrentPlayer].Booleans[0] := (TC = tab_Equip);
    if Players[CurrentPlayer].Booleans[0] then
    RMDebug('Axe is Equipped')
    else
    RMDebug('Axe in Inv');
    exit;
    end;
    end;

    if i > 1 then
    begin
    LogOut;
    Players[CurrentPlayer].Active := false;
    Players[CurrentPlayer].Rand := 'No Axe';
    end;
    end;

    function FindTree(which: TTree; var fx, fy: Integer): Boolean;
    var
    arP: TPointArray;
    ararP: T2DPointArray;
    tmpCTS, i, arL: Integer;
    P: TPoint;
    begin
    RMDebug('FindTree');
    tmpCTS := GetColorToleranceSpeed;
    ColorToleranceSpeed(2);
    SetColorSpeed2Modifiers(which.Hue, which.Sat);
    if not(FindColorsTolerance(arP, which.Color, MSX1, MSY1, MSX2, MSY2, which.Tol)) then
    begin
    Writeln('Failed to find the color, no object found - '+Which.Name);
    ColorToleranceSpeed(tmpCTS);
    SetColorSpeed2Modifiers(0.2, 0.2);
    Exit;
    end;

    ararP := TPAtoATPAEx(arP, which.width, which.hight);
    SortATPAFromFirstPoint(ararP, Point(MSCX, MSCY));
    arL := High(ararP);

    for i := 0 to arL do
    begin
    P := MiddleTPA(ararP);
    MMouse(P.x, P.y, 5, 5);
    if (WaitUptextMulti(which.UpText, 250)) then
    begin;
    Result := True;
    Break;
    end;
    end;

    ColorToleranceSpeed(tmpCTS);
    SetColorSpeed2Modifiers(0.2, 0.2);
    if (i = arL + 1) then
    begin
    Writeln('FindObject could not find object - '+which.Name);
    Exit;
    end;

    GetMousePos(fx, fy);
    if not (Random(3) = 2) then
    begin
    Mouse(fx, fy, 3, 3, true)
    if not DidRedClick then
    FindTree(which, fx, fy);
    end else begin
    Mouse (fx, fy, 3, 3, false);
    WaitOptionMulti(which.UpText, 300);
    MMouse(fx, fy, 0, 0);
    end;
    end;

    Function FollowTree(which: TTree; var x, y: integer):boolean;
    var
    Color, Time, Count : integer;
    begin
    RMDebug('FollowTree');
    Result := true;
    GetMousePos(x,y);
    Color := GetColor(x, y);
    Time := GetSystemTime + 5000;
    Count := InvCount;
    repeat
    wait(25);
    if not SimilarColors(GetColor(x, y), color, 10) then
    if not FindColorTolerance(x, y, Color, x - 12, y - 12, x + 12, y + 12, 10) then
    begin
    Result := false;
    exit;
    end;
    if InvCount > Count then break;
    until(GetSystemTime > Time)
    wait(Random(200));
    MMouse(x, y, 5, 5);
    GetMousePos(x, y);
    Result := WaitUpTextMulti(Which.UpText, 500);
    end;



    Function WaitUntilCut(which: TTree; x, y:integer): boolean;
    var
    Color, Time, x2, y2, Counts, NextCount: integer;
    begin
    RMDebug('WaitUntilCut');
    Result := true;
    GetMousePos(x,y);
    Color := GetColor(x, y);
    Time := GetSystemTime + (5+Random(3))*1000;
    NextCount := InvCount + 1;

    repeat
    AntiRandoms;
    AntiBan;

    if ClickContinue(false, false) then

    TakePic;

    if GetSystemTime > Time then
    begin
    Time := GetSystemTime + (5+Random(3))*1000;
    GetMousePos(x2, y2);
    if Distance(x, y, x2, y2) > 10 then
    MMouse(x, y, 3, 3);
    if not WaitUpTextMulti(Which.UpText, 500) then
    begin
    RMDebug('WaitUntilCut - No Text');
    break;
    end;
    end;

    wait(250);
    if not SimilarColors(GetColor(x, y), Color, 10) then
    if not FindColorTolerance(x, y, Color, x - 5, y - 5, x + 5, y + 5, 10) then
    begin
    RMDebug('WaitUntilCut - no color');
    break;
    end;

    if InvFull then
    begin
    RMDebug('WaitUntilCut - InvFull');
    break;
    end;

    if not WaitInvCount(NextCount, 250) then
    begin
    Inc(Counts);
    if Counts > (Players[CurrentPlayer].Integers[2] / 500) then
    begin
    RMDebug('WaitUntilCut - NoInvCount');
    break;
    end;
    end else begin
    NextCount := InvCount + 1 ;
    Counts := 0;
    end;


    until(False)
    end;

    Function ChopTree(which: TTree): boolean;
    var x, y, T:integer;
    begin
    if not LoggedIn then Exit;
    FindNormalRandoms ;
    wait(random(500));
    RMDebug('chop tree');
    Result := true;
    if Players[CurrentPlayer].Strings[0] = 'oak' then
    begin
    if not FindTree(Which, x, y) then
    Wait(7000 + Random(2000));
    end;

    if not FindTree(Which, x, y) then
    begin
    Wait(9000);
    T := GetSystemTime;
    repeat
    AntiRandoms;
    case Random(2) of
    0: Wait(200 + Random(500));
    1: SleepAndMoveMouse(400 + Random(1000));
    end;
    if (GetSystemTime - T > 60000) then
    begin
    Writeln('Couldn''t find tree?');
    Exit;
    end;
    until FindTree(Which, x, y);
    end;


    if not FollowTree(which, x, y) then
    exit;


    if not WaitUntilCut(which, x, y) then
    exit;
    end;


    Procedure TakeCareOfStuff(bank: boolean);
    var
    i, c, x, y : integer;
    TB : TBox;
    begin
    if not InvFull then exit;
    FindNormalRandoms;
    TakePic;
    GameTab(tab_Inv);
    Inc(Players[CurrentPlayer].Banked);
    Inc(Stats_CustomVars[5]);
    c := CountItemsIn('inv', 'dtm', LogDTM, []);
    IncEx(Players[CurrentPlayer].Integers[0], c);
    IncEx(Stats_CustomVars[1], c);
    ExpGained;
    IncEx(Stats_CustomVars[4], Round(XPGain[g] * c));
    if Players[CurrentPlayer].Booleans[0] then
    begin
    if Bank then
    DepositAll
    else
    DropAll;
    exit;
    end;

    for i:= 1 to 28 do
    begin
    if not ExistsItem(i) then continue;
    TB := InvBox(i);
    if not FindDTM(AxeDTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
    if Bank then
    Deposit(i, i, true)
    else
    DropItem(i);


    end;
    FindNormalRandoms;
    end;



    Function DoBank(which: string): boolean;
    begin
    if which = '' then
    begin
    Result := true;
    //CountLogs
    TakeCareOfStuff(false);
    Exit;
    end;


    if not OpenBankQuiet(which) then
    if not OpenBankFast(which) then
    begin
    RMDebug('couldnt open bank, going to false');
    Players[CurrentPlayer].Active := false;
    LogOut;
    exit;
    end;


    Result := true;

    //Count Logs


    TakeCareOfStuff(true);


    CloseBank;
    end;



    Procedure PlayerSetup;
    begin
    Tree := LoadTree(Players[CurrentPlayer].Strings[0]);
    Loc := LoadLocation(Players[CurrentPlayer].Loc);
    if not CheckTreeAndLoc(Loc, Tree) then
    begin
    Players[CurrentPlayer].Active := false;
    RMDebug('Tree not Availble in Location');
    exit;
    end;
    LoginPlayer;
    MarkTime(RestTime);
    SetAngle(true);
    FindNormalRandoms;
    CheckAxe;
    Players[CurrentPlayer].Integers[4]:= GetXP('woodcutting');
    end;


    Procedure SwitchPlayers;
    var t, r: integer;
    begin
    if (PlayersActive > 1)or(not LoggedIn) then
    begin
    LogOut;
    NextPlayer(Players[CurrentPlayer].Active);
    PlayerSetup;
    exit;
    end;
    Disguise('working');
    PlayerSetup;
    end;



    Procedure Proggy;
    var
    i, loads: integer;
    s: string;
    XPGained, tmp: Extended;
    begin
    for i:= 0 to HowManyPlayers-1 do
    begin
    if i = CurrentPlayer then
    ExpGained;
    Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked + TimeFromMark(RestTime);
    IncEx(loads, Players.Banked);
    tmp := Players[CurrentPlayer].Integers[0]*XpGain[g];
    Players[CurrentPlayer].Extendeds[0] := tmp;
    XPGained := XPGained + tmp;
    end;


    ClearReport;
    SRLProgressReport(
    ResultDebugBox, 'ProWoodcutterFFA', 'RM & The Man', Version,
    ['Time running', 'Loads', 'EXP Gained'],
    [TimeRunning, loads, XPGained]
    );

    s := SRLProgressReport(
    ResultString, 'ProWoodcutterFFA', 'RM & The Man', Version,
    ['Time running', 'Loads', 'EXP Gained'],
    [TimeRunning, loads, XPGained]
    );



    SRLPlayerReport(
    ResultDebugBox, 0, false,
    [true, true, false, false, false, true],
    ['logs', 'Tree', 'EXP Gained'],
    [], [0], [0], [0]
    );

    s := s + char(#13) + SRLPlayerReport(
    ResultString, 0, false,
    [true, true, false, false, false, true],
    ['logs','Tree', 'EXP Gained'],
    [], [0], [0], [0]
    );



    i := ReWriteFile(ScriptPath + ScriptName + '.txt', False);
    WriteFileString(i, s);
    CloseFile(i);
    writeln('Progress report saved to: ' + ScriptPath + ScriptName + '.txt');
    Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked - TimeFromMark(RestTime) + 5;
    Stats_SendReport;
    Stats_ManageAccounts;
    end;



    Procedure ScriptSetup;

    var

    a, b, c: string;

    d: Boolean;

    begin

    SetupSRL;

    DeclarePlayers;



    if Stats_GetScriptInfo(a, b, c, d) then

    begin

    WriteLn('STATS - Latest Version: ' + a);

    WriteLn('STATS - News: ' + b);

    if d then

    WriteLn('STATS - Warning: Script is marked as outdated!');

    end;



    ActivateClient;

    SRL_Procs[srl_OnLogOut] := @TakePic;

    AxeDTM := DTMFromString('78DA637460666098C7C800021012C26244E23' +

    '33A01D52C23A0C616A8663301355644A8F102AA594E408D2F50CD' +

    '42DC6AFE030100BC9609B5');

    LogDTM := DTMFromString('78DA633464666008676400010809613122F11' +

    '975806A1208A83102AA4927A0C69108355E40358904D4B802D584' +

    '10506305541346408D19504D360135BA403569B8D5FC070200E90' +

    '409AB');

    end;







    begin

    Smart_Server := SmartWorld;

    Smart_Signed := true;

    Stats_ScriptID := '2'; //DO NOT EDIT

    ScriptSetup;

    PlayerSetup;

    repeat



    if not Loc.WalkToTree() then

    begin

    RMDebug('Couldn''t walk to tree, going to false');

    Players[CurrentPlayer].Active := false;

    LogOut;

    end;

    while not InvFull do

    begin

    if not LoggedIn then break;

    if not ChopTree(yew) then

    begin

    RMDebug('Couldn''t chop tree, switching player');

    Inc(Players[CurrentPlayer].Integers[1]);

    if Players[CurrentPlayer].Integers[1] > 3 then

    begin

    Players[CurrentPlayer].Active := False;

    RMDebug('Going to false, failed tree 3 times');

    end;

    LogOut;

    end;

    end;



    if not Loc.WalkToBank() then

    begin

    RMDebug('couldn''t walk to bank, going to false');

    Players[CurrentPlayer].Active := false;

    LogOut;

    end;



    if not DoBank(Loc.BankName) then

    begin

    RMDebug('couldn''t bank, going to false');

    Players[CurrentPlayer].Active := false;

    LogOut;

    end;



    Proggy;

    SwitchPlayers;

    until(false);

    end.
     
< Is there a way to get scar to do this? | helpz >

Users viewing this thread
1 guest


 
 
Adblock breaks this site