Results 1 to 16 of 16

Thread: Script Reflax Help

  1. #1
    Join Date
    Feb 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Script Reflax Help

    Doesn't log in it stops at line 309 when im logging in in the reflax script any one know whats wrong? heres the error:

    [Runtime Error] : Out Of Range in line 309 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/Login.scar

    Code:
    program ReFlax;
    
    {
      ********************************************************************
      ********************____      _____ _*******************************
      *******************|  _ \ ___|  ___| | __ ___  __*******************
      *******************| |_) / _ \ |_  | |/ _` \ \/ /*******************
      *******************|  _ <  __/  _| | | (_| |>  < *******************
      *******************|_| \_\___|_|   |_|\__,_/_/\_\*******************
      ********************************************************************
      *************************  HOW   TO  USE  **************************
      ********************************************************************
      *                                                                  *
      *   -- Declare your player in DeclarePlayers, like normal.         *
      *                                                                  *
      *   -- Fill in how many loads to do (LoadsToDo).                   *
      *                                                                  *
      *   -- Fill in your SRL ID and Pass.                               *
      *                                                                  *
      *   -- Make sure you have flax in your inventory.                  *
      *                                                                  *
      *   -- Make sure you have Flax on your first bank tab.             *
      *                                                                  *                                                                *
      *   -- Start logged out on the top of Lumbridge Castle             *
      *                                                                  *
      *   -- Run the script.                                             *
      *                                                                  *
      ********************************************************************
      }
    
    {.include SRL/SRL.scar}
    
    
    
    Var
    X, Y : integer;
    Spin : integer;
    Loads : integer;
    FlaxBMP : integer;
    
    Const
    LoadsToDo = 100;         // How many loads to do
    SRLStatsID = '7114';       // Your SRL stats ID
    SRLStatsPass = '';    // Your SRL Stats Password
    
    procedure DeclarePlayers;
    begin
     HowManyPlayers :=1; //How many players to use in script
     NumberOfPlayers(1);
     CurrentPlayer :=1;
    
     Players[0] .Name         := 'ninja80p';          // Username
     Players[0] .Pass         := '';                // Pass
     Players[0] .Nick         := 'n80p';           //3/4 of the characters name (bobbey = bob)
     Players[0] .Active       := True;            // True=yes, False=no//
     Players[0] .Booleans[1]  := False;          // False for brightness Check Once. Just leave at false.
     Players[0] .Pin   := '0000';               // Your BANK-Pin - Leave at 0000 if you don't have a pin
    end;
    
    
    
    //////////////////////DO NOT TOUCH BELOW THIS LINE///////////////////////////////////////////
    
    Procedure AntiRandoms;
    begin
      wait(250 + random(100));
      findnormalrandoms;
        if findfight=true then
        begin
          RadialWalk(FindLadderColor,270,110,70,2,2);
          wait(3500 +random(500));
        if FindColorSpiralTolerance(x, y, 8226183, 212, 182, 270, 242, 2) then
          Mouse(X,Y, 2, 2, false);
          ChooseOption('-up');
          wait(3500 + random(500));
          FindObjCustom(x, y, ['case', 'Stair', 'Staircase'],[8226183,8160390,6054499], 3)
          Mouse(X,Y, 1, 1, false);
          ChooseOption('-down');
          wait(2000 + random(500));
      end;
    end;
    
    
    ////////////////////////////////////ANTI BAN/////////////////////////////////////////
    
    Procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      case (Random(100)) of
        1: RandomRClick;
        5: HoverSkill('crafting', False);
        11: RandomMovement;
        15: BoredHuman;
        24: PickUpMouse;
        27: begin
             Gametab(1 + Random(12));
             Wait(3000 + Random(200));
             Gametab(4);
            end;
        30: SleepAndMoveMouse(3600);
      end;
      end;
      
    //////////////////////////////////////////PROGGY//////////////////////////////////////////
    
    Procedure ProgressReport;
    Begin
      ClearDebug;
      SRLRandomsReport
      Writeln('||----------- ProgressReport -----------||');
      Writeln(Padr('||- Flax Spun : '+IntToStr(Spin), 39)+ '-||');
      Writeln(Padr('||- Loads Done: '+IntToStr(Loads), 39)+ '-||');
      Writeln(Padr('||- Ran For: ' + TimeRunning, 39) + '-||');
      Writeln('||--------------------------------------||');
    End;
    
    
      
    ////////////////////////////BANK FLAX FINDER/////////////////////////////////////////////
    
    Procedure FindFlaxBank;
    Begin
    FlaxBMP := BitmapFromString(19, 8, 'beNplkDkOwjAQReOKLM5C4C5UV' +
           'FQ0NEgQkChCQZGCIgUF50IoYhGiRQhxJL79lYEE6xX2j99kPI7Kqs' +
           'vifHMcZeFqhNE2dUdBWHSRLK/3+fGkV3GQRTjiGsCxdpU31riMTbh' +
           'JdJ64Q7+urKAAbNbPd/54tf5IEaDar+hPQ8Ij8vqTLFMZIdvoDDxj' +
           'TTSJyjTe92k1XVOZIkOIQCwj7np/oq1s+5EQLwXoH4MCs0OFEUmrR' +
           'PphzjcCWACzNW5pXPbWcmWAInLIXz7JZT76');
      wait(500 + random(250));
      if FindBitmapToleranceIn(FlaxBMP, x, y, MSX1, MSY1, MSX2, MSY2, 35) then
        begin
        Exit;
        writeln('Flax Found');
        end
        else
        begin
        Progressreport;
        writeln('Flax Not Found');
        TerminateScript;
        end;
    end;
    
    
    /////////////////////////////////////////BANK TO STAIRS///////////////////////////////////
    
    procedure FindBankStairs;
    begin
      RadialWalk(FindLadderColor,250,110,70,2,2);
      wait(3500 +random(500));
      if FindObjCustom(x, y, ['case', 'Stair', 'Staircase'],[8226183,8160390,6054499], 3) then
          begin
          Mouse(X,Y, 1, 1, false);
          ChooseOption('-down');
          wait(2000 + random(500));
          end
          else
          begin
          ProgressReport;
          writeln('Could not find stairs. Terminating script.');
          TerminateScript;
          end;
    end;
    
    /////////////////////////FIND DOOR AFTER SPINNING//////////////////////////////////////////
    
    Procedure FindDoor;
    begin
     if FindObjCustom(x,y, ['Door'], [2568505,3358795,3029572, 6855065], 5) then
       begin
            Mouse(X,Y, 2,2,false);
            wait(250+random(250));
            ChooseOption('pen');
            wait(500+random(500));
       end
    end;
       
    /////////////////////////FIND SPINNING WHEEL, AND SPIN FLAX/////////////////////////////////
    
    procedure FindSpin;
     begin
       SymbolAccuracy := 0.4;
      if FindSymbol(X, y, 'spin') then
         Mouse(X, Y, 2, 2, true);
         wait(3500 + random(543));
      if FindObjCustom(x, y, ['pin', 'Spin', 'wheel'], [4346721, 15198186, 2963522], 5) then
         begin
          wait(100 + random(73));
          Mouse(X, Y, 1,1, true);
          wait(2000+random(1000));
          Mouse(273, 122, 5, 5, False);
          wait(100 +random(100));
          ChooseOption('ll');
          wait(1750 + random(250));
         if FindNormalRandoms then
          begin
           Loads := Loads - 1;
           ReportVars[1] := ReportVars[1] -1;
           exit;
          end;
         wait(10000 + random(1000));
         AntiBan;
        if FindNormalRandoms then
          begin
           Loads := Loads - 1;
           ReportVars[1] := ReportVars[1] -1;
         Exit;
        end;
         wait(10000 + random(1000));
         AntiBan;
          if FindNormalRandoms then
         begin
         Loads := Loads - 1;
         ReportVars[1] := ReportVars[1] -1;
         exit;
         end;
         wait(10000 + random(1000));
         AntiBan;
          if FindNormalRandoms then
         begin
         Loads := Loads - 1;
         ReportVars[1] := ReportVars[1] -1;
         exit;
         end;
         wait(10000 + random(1000));
         AntiBan;
         if FindNormalRandoms then
         begin
         Loads := Loads - 1;
         ReportVars[1] := ReportVars[1] -1;
         exit;
         end;
         wait(10000 + random(1000));
         AntiBan;
         if FindNormalRandoms then
         begin
         Loads := Loads - 1;
         ReportVars[1] := ReportVars[1] -1;
         exit;
         end;
         Spin := Spin+28;
         ReportVars[0] := ReportVars[0] + 28;
         end
         else
         begin
         ProgressReport;
         Writeln('Spinning wheel not found. Terminating script');
         TerminateScript;
         end;
         end;
    
    /////////////////////////////////////SPINNING WHEEL TO STAIRS////????????///////////////////
    
    Procedure FindSpinStairs;
    begin
         RadialWalk(FindLadderColor,270,110,70,MMCX,MMCY);
         wait(3500 +random(500));
         if FindObjCustom(x, y, ['case', 'Stair', 'Staircase'],[7831425,5988706,3754069], 5) then
           Mouse(X,Y, 2, 2, false);
           ChooseOption('-up');
           wait(3500 + random(500));
           AntiBan;
     end;
    
    ///////////////////////////////////////////BANK AND GET NEW FLAX////////////////////////////
    
    Procedure Bank;
    begin
      SymbolAccuracy := 0.5;
      if FindSymbol(X, y, 'bank') then
        Mouse(X, Y-8, 2, 2, true);
        wait(4500 + random(543));
        AntiBan;
        if FindObjCustom(x, y, ['ooth', 'Bank Booth'], [8753305, 3622224, 8160910], 5) then
        begin
        wait(1500 + random(200));
        Mouse(X,Y, 2,2, false);
        Wait(200 + random(200));
        ChooseOption('-quickly');
        Wait(1500 + random(500));
        if Pinscreen then
        begin
        wait(500 + random(500));
        InPin(players[currentplayer].Pin);
        end;
        Wait(1500 + random(500));
        Mouse(574,220,  5, 5, false);
        wait(100 + random(100));
        ChooseOption('-All');
        Loads := Loads + 1;
        ReportVars[1] := ReportVars[1] + 1;
        FindFlaxBank;
        wait(500+random(200));
        Mouse(x,y, 5,5 ,false);
        wait(200+random(100));
        ChooseOption('-All');
        wait(500+random(500));
        end
        else
        begin
        ProgressReport;
        writeln('Could not find bank. Terminating script');
        TerminateScript;
          end;
    end;
    
    /////////////////////////////////SETUP///////////////////////////////////////////////
    
    procedure Setup;
    begin
      SetupSRL;
      ScriptID := '1076';
      SRLID := SRLStatsID;
      SRLPassword := SRLStatsPass;
      DeclarePlayers;
      ClearDebug;
      ActivateClient;
      loginPlayer;
      Wait(1500 + random(500));
      Mouse(727, 102, 4, 4, false);
      ChooseOption('mode on');
      wait(100 + random(250));
      MakeCompass('35');
    KeyDown(VK_Up);
    Wait(500 + random(500));
    KeyUp(VK_Up);
    wait(250 + random(100));
    end;
    
    
    ///////////////////////////////////////MAIN LOOP//////////////////////////////////////////
    
    begin
    Setup;
    repeat
      FindBankStairs;
      FindSpin;
      FindDoor;
      FindSpinStairs;
      Bank;
      ProgressReport;
    until (Loads = LoadsToDo);
    CloseBank;
    Wait(500 + random(500));
    LogOut;
    Progressreport;
    end.
    Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--               » Login Routines                              --//
    //-----------------------------------------------------------------//
    // * function  RSReady: Boolean;                      // * by ZephyrsFury
    // * Procedure LoginScreenMusic(State: Variant);      // * by Wizzup?
    // * procedure Login_SetAudio(Volume, SFX, Area: Integer; SMSetting: (Stereo, Mono, NoChange) );  // * by ZephyrsFury
    // * procedure Login_SetGraphics(Brightness: Integer; vl, rr, gd, td, ia, fl, gt, cs: string);    // * by ZephyrsFury
    // * procedure SetAutoingDefaults;                    // * by ZephyrsFury
    // * procedure Logout;                                // * by Starblaster100 and Raymond
    // * procedure LoginPlayer;                           // * by SRL Developers
    // * procedure RandomNextPlayer(Active: Boolean);     // * by Dankness, Ron and Raymond
    // * procedure NextPlayer(Active: Boolean);           // * by Dankness, Ron and Raymond
    // * procedure CheckUserNicks;                        // * by Sumilion and Raymond
    
    { var SRL_Logs: Integer;
      Description: Variables needed for some login functions. }
    { var RandomPlayer, GraphicsSet: Boolean;
      Description: Variables needed for some login functions. }
    var
      SRL_Logs: Integer;
      RandomPlayer, GraphicsSet: Boolean;
    
    procedure NextPlayer(Active: Boolean); forward;
    procedure RandomNextPlayer(Active: Boolean); forward;
    
    {*******************************************************************************
    function RSReady: Boolean;
    By: ZephyrsFury
    Description: Returns true if we are ready to auto (on loginscreen or logged in).
      Useful for waiting until RS has fully loaded.
    *******************************************************************************}
    
    function RSReady: Boolean;
    begin
      Result := (LoggedIn) or (GetColor(520, 146) = 4038981);
    end;
    
    {*******************************************************************************
    Procedure LoginScreenMusic(State: Variant);
    By: Wizzup?
    Description: Takes Boolean(True, False) or Integer(1..5) as arguments.
      1 or True = Off, 5 or False = Max.
          1   2   3   4   5
        <-o---o---o---o---o->
    *******************************************************************************}
    
    Procedure LoginScreenMusic(State: Variant);
    
    Var
       RealState: Variant;
       x: Extended;
    
    Begin
      if (LoggedIn) then Exit;
      if (CountColor(7750, 346, 356, 416, 369) <> 119) and (GetColor(520, 135) = 4038981) then
      begin
        TypeByte(vk_Escape);
        Wait(100);
      end;
      if (CountColor(7750, 346, 356, 416, 369) <> 119) then Exit;
      Case VarType(State) Of
      11: RealState := (State + 1) * 4;
      3: If InRange(State, 1, 5) Then
           RealState := State - 1;
         Else
           RealState := 0;
      End;
      x := (425.0 - 337.0) * RealState / 4.0 + 339.0;
      If CountColorTolerance(1647966, Round(x) - 5, 375, Round(x) + 5, 385, 20) < 5 Then
        If CountColorTolerance(991349, Round(x) - 5, 375, Round(x) + 5, 385, 20) < 5 Then
          Mouse(Round(x), RandomRange(375, 385), 0, 0, True);
    
    End;
    
    {*******************************************************************************
    procedure Login_SetAudio(Volume, SFX, Area: Integer; SMSetting: (Stereo, Mono, NoChange) );
    By: ZephyrsFury
    Description: Sets audio options through the login screen.
    Use: Enter the desired Setting for the desired Option. Make option 0 for no change.
      EG. Login_SetAudio(1, 5, 2, NoChange);
    
                            1   2   3   4   5
      Volume, SFX, Area:  <-o---o---o---o---o->
    *******************************************************************************}
    
    procedure Login_SetAudio(Volume, SFX, Area: Integer; SMSetting: TSMSetting);
    var
      II, Tx, Ty, T: Integer;
      Pts: TIntegerArray;
    begin
      if (LoggedIn) then Exit;
      TypeByte(vk_Escape);
      T := GetSystemTime;
      while (CountColor(7750, 346, 373, 416, 386) <> 119) and (GetSystemTime - T < 5000) do
        Wait(100);
      if (CountColor(7750, 346, 373, 416, 386) = 119) then
        MouseBox(334, 362, 426, 371, 1)
      else
        Exit;
      Wait(100);
      Pts := [Volume, SFX, Area];
      for II := 0 to 2 do
      begin
        if (Pts[II] = 0) then Continue;
        if (not(InRange(Pts[II], 0, 5))) then
        begin
          srl_Warn('Login_SetAudio', 'Points must be between 0 and 5', warn_AllVersions);
          Continue;
        end;
        Tx := 337 + Round((425 - 337) * (Pts[II] - 1) / 4);
        Ty := Round(3.5 * II * II + 46.5 * II + 245);
        if (GetColor(Tx, Ty) <> 1121100) then
          Mouse(Tx + 2, Ty - 14, 0, 0, True);
        Wait(50);
      end;
      if (GetColor(337, 389) = 181) and (SMSetting = Stereo) then
        Mouse(421, 385, 10, 10, True)
      else
      if (GetColor(426, 389) = 181) and (SMSetting = Mono) then
        Mouse(332, 385, 10, 10, True);
      Wait(100);
      TypeByte(vk_Escape);
    end;
    
    {*******************************************************************************
    procedure Login_SetGraphics(Brightness: Integer; vl, rr, gd, td, ia, fe, gt, cs: string);
    By: ZephyrsFury
    Description: Sets graphic options in the login screen.
    Use: Enter the desired Setting for the desired Option.
      Leave as 0 for no change of brightness and '' for no change in anything else.
    
      Parameter    Option                Setting
        Brightness   Brightness            1 - 4 (0 for no change)
        vl           Visible Levels        Current / All
        rr           Remove Roofs          Always / Selectively
        gd           Ground Decoration     Off / On
        td           Texture Detail        Low / High
        ia           Idle Animations       Few / Many
        fe           Flickering Effects    Off / On
        gt           Ground Textures       Few / Many
        cs           Chracter Shadows      Off / On
    
                        1   2   3   4
      Brightness:   <---o---o---o---o--->
    
    EG. Login_SetGraphics(2, 'current', '', 'off', 'low', 'few', '', 'few', 'off');
    
    For Autoing:
    Login_SetGraphics(4, 'current', 'always', 'off', 'low', 'few', 'off', 'few', 'off');
    *******************************************************************************}
    
    procedure Login_SetGraphics(Brightness: Integer; vl, rr, gd, td, ia, fe, gt, cs: string);
    var
      Settings, PosSettings, OptionName: TStringArray;
      II, T, W, tCol, x, y, mSpeed: Integer;
      TB: TBox;
      P: TPoint;
    begin
      if (LoggedIn) then Exit;
      Settings := [vl, rr, gd, td, ia, fe, gt, cs];
      PosSettings := ['Current', 'All', 'Always', 'Selectively', 'Off', 'On', 'Low',
        'High', 'Few', 'Many', 'Off', 'On', 'Few', 'Many', 'Off', 'On'];
      OptionName := ['Visible levels', 'Remove roofs', 'Ground decoration', 'Texture detail',
        'Idle animations', 'Flickering effects', 'Ground textures', 'Character shadows'];
      TypeByte(vk_Escape);
      T := GetSystemTime;
      while (CountColor(7750, 346, 373, 416, 386) <> 119) and (GetSystemTime - T < 5000) do
        Wait(100);
      if (CountColor(7750, 346, 373, 416, 386) = 119) then
        MouseBox(321, 338, 443, 346, 1)
      else
        Exit;
      mSpeed := MouseSpeed;
      MouseSpeed := 25;
      Wait(100);
      if (Brightness > 4) then
        srl_Warn('Login_SetGraphics', 'Brightness must be between 0 and 4', warn_AllVersions)
      else
      if (Brightness <> 0) then
      begin
        P := Point(89 + (Brightness - 1) * 21, 266);
        if (GetColor(P.x, P.y) <> 1121100) then
          Mouse(P.x - 3, P.y - 17, 6, 6, True);
      end;
      for II := 0 to 7 do
      begin
        TB.x1 := 67 + 130 * ((II + 1) mod 5);
        TB.y1 := 245 + 60 * ((II + 1) div 5);
        TB.x2 := TB.x1 + 109;
        TB.y2 := TB.y1 + 15;
        if (not(InStrArrEx(Capitalize(Settings[II]), [PosSettings[II * 2], PosSettings[II * 2 + 1]], W))) then
        begin
          srl_Warn('Login_SetGraphics', 'Invalid Setting: ' + Settings[II] + ' for Option: ' + OptionName[II] + '.', warn_AllVersions);
          Continue;
        end;
        tCol := (W mod 2) * 16777088 + 127;
        if (not(FindColor(x, y, tCol, TB.x1, TB.y1, TB.x2, TB.y2))) then
        begin
          Mouse(TB.x1 + 10, TB.y1 + 3, 10, 7, True);
          if (FindColor(x, y, tCol, TB.x1, TB.y2 + 1, TB.x2, TB.y2 + 1 + 51)) then
            Mouse(x, y, 10, 7, True)
          else
            MouseBox(TB.x1 + 10, TB.y1 + 3, TB.x2 - 40, TB.y2 - 3, 1);
        end;
      end;
      Wait(100);
      TypeByte(vk_Escape);
      MouseSpeed := mSpeed;
    end;
    
    {*******************************************************************************
    procedure SetAudioOff;
    By: ZephyrsFury
    Description: Sets the Audio to off (1 for each bar). Works logged in and out.
    *******************************************************************************}
    
    procedure SetAudioOff;
    begin
      if (LoggedIn) then
        SetAudio(1, 1, 1, NoChange)
      else
        Login_SetAudio(1, 1, 1, NoChange);
    end;
    
    {*******************************************************************************
    procedure SetAutoingDefaults;
    By: ZephyrsFury
    Description: Sets the graphic options for best SRL compatibility. Works both logged in and out.
    *******************************************************************************}
    
    procedure SetAutoingDefaults;
    begin
      if (LoggedIn) then
        SetGraphics(4, 'current', 'always', 'off', 'low', 'few', 'off', 'few', 'off')
      else
        Login_SetGraphics(4, 'current', 'always', 'off', 'low', 'few', 'off', 'few', 'off');
    end;
    
    {*******************************************************************************
    procedure Logout;
    By: Starblaster100 / Raymond
    Description: Logs you out.
    *******************************************************************************}
    
    function Logout: Boolean;
    var
      c, i: Integer;
    begin
      Result := (not (LoggedIn));
      if Result = True then
        Exit;
      if GameTab(14) = False then
        Exit;
      Wait(200 + Random(100));
      while (LoggedIn) and (c < 10) do
      begin
        Inc(c);
        if(ClickText('here', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
          for i := 0 to 10 do
          begin
            Wait(1000);
            if not(LoggedIn)then
            begin
              Result := True;
              Exit;
            end;
          end;
      end;
    end;
    
    {*******************************************************************************
    procedure LoginPlayer;
    By: SRL Developers
    Description: Logs in the Player[CurrentPlayer]. Detects most Client Login Errors
    *******************************************************************************}
    
    procedure LoginPlayer;
    var
      Mark, Attempts: Integer;
      Actions: TVariantArray;
      RetryLogin: Boolean;
    label
      ProcStart;
    begin
      ActivateClient;
      Wait(100);
      TypeByte(vk_Escape);
    
      if (GetColor(212, 327) = 238301) then    //At Click To Play screen
      begin
        Wait(1000 + Random(3000));
        MouseBox(227, 337, 555, 364, 1);
        MarkTime(Mark);
        while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
          Wait(1000 + Random(1000));
      end;
      if (not(RSReady)) then
      begin
        MarkTime(Mark);
        while (not(RSReady)) do
        begin
          Wait(100);
          if (TimeFromMark(Mark) > 180000) then
          begin
            WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
            TerminateScript;
          end;
        if (not(Players[CurrentPlayer].Active)) then
        end;
        WriteLn('Welcome to Runescape.');
      end;
      
      LoginScreenMusic(True);
      if (not(GraphicsSet)) then
      begin
        SetAutoingDefaults;
        GraphicsSet := True;
      end;
      ProcStart:
    
      if (not(LoggedIn)) then
      begin
        begin
          WriteLn('Player is not Active...');
          NextPlayer(False);
          Exit;
        end;
        Wait(900 + random(60));
    
        //Click 'Log In' on main menu
        while (GetColor(343, 175) <> 7750) do //while (GetColor(343, 174) <> 7750) do
        begin
          MouseBox(360, 180, 400, 185, 1);
          Wait(100 + Random(100));
        end;
    
        //Type Username
        Mouse(315, 272, 10, 5, True);
        while (CountColor(7750, 311, 269, 452, 284) > 13) do
        begin
          KeyDown(vk_Back);
          Wait(10 + Random(10));
          KeyUp(vk_Back);
          Wait(50 + Random(50));
        end;
        for Mark := 0 to 3 do
        begin
          KeyDown(vk_Back);
          Wait(10 + Random(10));
          KeyUp(vk_Back);
          Wait(50 + Random(50));
        end;
        Wait(100 + Random(200));
        WriteLn(Capitalize(Players[CurrentPlayer].Name));
        TypeSend(Players[CurrentPlayer].Name);
        Wait(100+random(50));
    
        //Type Password
        Mouse(315, 334, 10, 5, True);
        while (CountColor(7750, 311, 337, 452, 352) > 13) do
        begin
          KeyDown(vk_Back);
          Wait(10 + Random(10));
          KeyUp(vk_Back);
          Wait(50 + Random(50));
        end;
        for Mark := 0 to 3 do
        begin
          KeyDown(vk_Back);
          Wait(10 + Random(10));
          KeyUp(vk_Back);
          Wait(50 + Random(50));
        end;
        Wait(100 + Random(200));
        TypeSend(Players[CurrentPlayer].Pass);
        Wait(500 + Random(300));
    
        if (not(FindTextTPA(12509695, 0, 288, 205, 475, 247, 'login', StatChars, Nothing))) then   //If 'enter' from typesend didn't log us in
        begin
          MouseBox(355, 359, 403, 372, 1);  //Click 'login' login screen
          Wait(250 + random(100));
        end;
    
        MarkTime(Mark);
        repeat
          SetLength(Actions, 0);
    
          if (TimeFromMark(Mark) > 60000) then
            Actions := ['One minute has passed...', 0, 2, 'NextPlayer', 'Login Failed']
          else
          case (CountColor(12509695, 288, 205, 475, 247)) of   //Number of text colour points
            //   Actions := ['WriteLn Text', TimeToWait, NumberOfRetries, 'FinalAction', 'PlayerStatus'];
            760: Actions := ['Too many incorrect logins.', 5 * 60000, 2, 'NextPlayer', ''];
            536: Actions := ['Login limit exceeded. Please wait 1 minute and try again.', 60000, 2, 'NextPlayer', ''];
            711: Actions := ['Your account has been disabled', 0, 0, 'NextPlayer', 'Acc Disabled'];
            598: Actions := ['Invalid Username / Password', 0, 2, 'NextPlayer', 'Wrong User/Pass'];
            787: Actions := ['Not a Members Account', 0, 0, 'NextPlayer', 'Non-member'];
            408: Actions := ['World is full.', 5000, 20, 'Terminate', ''];
            623: Actions := ['Your account is already logged in', 5000, 0, 'RandomNextPlayer', ''];
            555: Actions := ['The Server is being updated.', 60000, 4, 'Terminate', 'Server Updating'];
            218: Actions := ['Error Connecting.', 20000, 9, 'Terminate', 'Error Connecting'];
            335: Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000), 4, 'Terminate', 'Login Server Offline'];
            512: Actions := ['RuneScape has been updated. Script Terminated.', 0, 0, 'Terminate', 'RS Updated'];
            489: Actions := ['Connection timed out.', 0, 4, 'Terminate', 'Connection Timed Out'];
            737: Actions := ['You are standing in a members-only area.', 0, 0, 'NextPlayer', 'In Mems-Only Area'];
            //10: Actions := ['Error loading your profile.', 5000, 10, 'NextPlayer', 'Profile Loading Failed']; // Error loading your profile. Will attempt to re-login 5 more times.)
            //11: Actions := ['Login server rejected session.', 1000, 10, 'NextPlayer', 'Login Serv. Rejected'];  // Login server rejected session.
          end;
    
          if (Length(Actions) > 0) then
          begin
            WriteLn(Actions[0]);
            Wait(Actions[1] + Random(100));
            if (Actions[2] <> 0) then
              if (Attempts < Actions[2]) or (Actions[2] = -1) then
              begin
                RetryLogin := True;
                Break;
              end;
            if (Actions[4] <> '') then
              Players[CurrentPlayer].Loc := Actions[4];
            case Actions[3] of
              'NextPlayer': NextPlayer(False);
              'RandomNextPlayer': RandomNextPlayer(True);
              'Terminate': TerminateScript;
            end;
            Exit;
          end;
          Wait(100);
        until(GetColor(212, 327) = 238301);
    
        if (RetryLogin) then
        begin
          RetryLogin := False;
          Inc(Attempts);
          goto ProcStart;
        end;
    
        if (GetColor(212, 327) = 238301) then
        begin
          Wait(1000 + Random(2000));
          MouseBox(227, 337, 555, 364, 1);
        end;
        MarkTime(Mark);
        while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
          Wait(1000 + Random(1000));
      end;
    
      if (LoggedIn) then
      begin
        PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
        if Length(Players[CurrentPlayer].NickTPA) < 2 then
        begin;
          Writeln('Creating the NickTPA.');
          if Players[CurrentPlayer].Nick <> '' then
            Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
          else
          begin;
            Writeln('Nickname isn''t set, taking the username instead..');
            Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
          end;
        end;
        AddToSRLLog('Current player: ' + Capitalize(Players[CurrentPlayer].Name));
      end;
    end;
    
    {*******************************************************************************
    procedure RandomNextPlayer(Active: Boolean);
    By: Dankness based on WT-Fawki's NextPlayer and modified by Ron and by Raymond
    Description: Picks Random Player that is Active and Logs in
    *******************************************************************************}
    
    procedure RandomNextPlayer(Active: Boolean);
    var
      LastPlayer: Integer;
    begin
      WriteLn('NextPlayer');
      LastPlayer := CurrentPlayer;
      Players[CurrentPlayer].Active := Active;
      Logout;
      PlayerCurTime := (GetSystemTime div 1000);
      Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
        ((PlayerCurTime - PlayerStartTime) / 60);
      repeat
        if (AllPlayersInactive) then Wait(60000);
        if (PlayersActive = 1) then Break;
        CurrentPlayer := Random(HowManyPlayers);
        Wait(100);
      until (Players[CurrentPlayer].Active) and (LastPlayer <> CurrentPlayer);
      SRL_Logs := SRL_Logs + 1;
      LoginPlayer;
    end;
    
    {*******************************************************************************
    procedure NextPlayer(Active: Boolean);
    By: Dankness and modified by Ron and by Raymond
    Description: Logs in the next player.
    Boolean: True - Current player is ok. False - Current player is false.
    *******************************************************************************}
    
    procedure NextPlayer(Active: Boolean);
    begin
      if RandomPlayer then
        RandomNextPlayer(Active)
      else
      begin
        WriteLn('NextPlayer(Active: ' + BoolToStr(Active)+ ');');
        Players[CurrentPlayer].Active := Active;
        Logout;
        if (SRL_Procs[srl_OnNextPlayer] <> nil) then
          SRL_Procs[srl_OnNextPlayer]();
        PlayerCurTime := (GetSystemTime div 1000);
        Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
          ((PlayerCurTime - PlayerStartTime) / 60);
        CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
        while Players[CurrentPlayer].Active = False do
        begin
          CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
          if (AllPlayersInactive) then Wait(60000); // Everybody False. Endless Loop.
        end;
        SRL_Logs := SRL_Logs + 1;
        LoginPlayer;
      end;
    end;
    
    {*******************************************************************************
    procedure CheckUserNicks;
    By: Sumilion / Raymond
    Description: Checks if all nicks are set correct.
    *******************************************************************************}
    
    procedure CheckUserNicks;
    var
      CorrectString: string;
      i: Integer;
      Wrong : Boolean;
      Str : String;
    begin
      for i := 0 to HowManyPlayers - 1 do
      begin
        if (not(Players[CurrentPlayer].Active)) then Continue;
        Wrong := False;
        if (Players[i].Nick = '') then
        begin
          Wrong := True;
          Str := 'WARNING : Please fill in your nickname.';
        end;
        if (Players[i].Nick <> LowerCase(Players[i].Nick)) then
        begin
          Wrong := True;
          Str := 'WARNING : Please Uncapitalise your nickname.';
        end;
        if (pos(Players[i].Nick, LowerCase(Players[i].Name)) = 1) then
        begin
          Wrong := True;
          Str := 'WARNING : Dont use the first letter in your nick.';
        end;
        if (pos(' ', Players[i].Nick) > 0) then
        begin
          Wrong := True;
          Str := 'WARNING : Dont use spaces in your Nick.';
        end;
        CorrectString := Capitalize(Players[i].Name);
        if not (Pos(LowerCase(Players[i].Nick), CorrectString) > 0) then
        begin
          Wrong := true;
          Str := 'WARNING : Nick does NOT match the name.';
        end;
        if Wrong then
        begin;
          Writeln('--');
          Writeln(Str);
          if (Length(Players[i].Name) > 0) then
            Writeln('Warning occured with player : ' + Players[i].Name);
          Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');
        end;
      end;
    end;
    Using scar dvi 3.15b and ive updated my SRL SVN 1 min ago what am i doing wrong please hlp

  2. #2
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Change CurrentPlayer :=1; to CurrentPlayer := 0;. You only have one player, and the array starts at index 0, not 1.
    :-)

  3. #3
    Join Date
    Feb 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Method View Post
    Change CurrentPlayer :=1; to CurrentPlayer := 0;. You only have one player, and the array starts at index 0, not 1.
    ok i got the first part but whats a index (NOOB TO THIS KINDA STUFF) what you mean by the index 0

    Edit: Now i get this when i try to run the script logged out

    Welcome to Runescape.
    Player is not Active...
    NextPlayer(Active: False);

  4. #4
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    change
    SCAR Code:
    HowManyPlayers :=1; //How many players to use in script
     NumberOfPlayers(1);
     CurrentPlayer :=1;

    to
    SCAR Code:
    HowManyPlayers :=1; //How many players to use in script
     NumberOfPlayers(HowManyPlayers);
     CurrentPlayer := 0;

    had to set the current player to player[playernum].

    Just copy and paste what i changed.
    I do visit every 2-6 months

  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    An index is a point in an array.
    Ex. you have an array with 2, 3, 5 in it. Index 0 is 2, index 1 is 3, index 2 is 5.

    Arrays start at 0.

  6. #6
    Join Date
    Feb 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    its still doing this and stoping w/e its doing...

    Player is not Active...
    NextPlayer(Active: False);

  7. #7
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Are you selecting the RS client?


    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  8. #8
    Join Date
    Feb 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Camo¤Kyle View Post
    Are you selecting the RS client?


    ~Camo
    whats the rs client?

  9. #9
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    what he means is are you using the cross hair and moving it on the runescape window?
    I do visit every 2-6 months

  10. #10
    Join Date
    Feb 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes..

  11. #11
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)
    The most important thing is to drag the cross hair located on the scar tool bar which has the PLAY, PAUSE, STOP BUTTON.
    If you see those then you go ALL THE WAY TO THE RIGHT, its in the same row. You will see this cross hair thingy. now move scar out of the way so you can see the runescape screen and the cross hair thingy at the same time click, and drag the cross hair thingy over the rs screen and let go.

    Thats my fool proof guide to dragging the cross hair xD.

  12. #12
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ninjamonkey80p View Post
    its still doing this and stoping w/e its doing...

    Player is not Active...
    NextPlayer(Active: False);
    Players[0].Active := false to Players[0].Active := true;...

  13. #13
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you might want to add a failsafe to that if you do that.. ( change it to Players[0].Active := true; )

  14. #14
    Join Date
    Feb 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok it works it logs in and goes down the stairs but it cant find the spinning wheel and it stops....

  15. #15
    Join Date
    Feb 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    got it working thanks guys...

    for all the help

  16. #16
    Join Date
    Feb 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Or type in that line SetupSrl;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ReFlax Lumby Flax Spinner
    By SirPa in forum First Scripts
    Replies: 119
    Last Post: 10-11-2009, 04:31 PM
  2. ReFlax Flax Spinner
    By SirPa in forum RS3 Outdated / Broken Scripts
    Replies: 32
    Last Post: 08-23-2009, 01:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •