Results 1 to 3 of 3

Thread: Help with my Chicken Killer!!

  1. #1
    Join Date
    Mar 2007
    Location
    Ohio
    Posts
    138
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help with my Chicken Killer!!

    I keep getting this error : [Runtime Error] : Out Of Range in line 123 in script X:\Program Files\SCAR 3.13\includes\SRL/SRL/Core/Login.scar

    Here's the script can you guys please help look over it, any suggestions??
    SCAR Code:
    program ChickenKiller;
    {.include SRL/SRL.scar}

    var x, y : Integer;
    Chickens, PlayerTimer : Integer;
    count:string;
     
    const
    TimePerPlayer = 15;// How long to fight and switch players (in mins)
    FightMode = 1;//  1,2,3,4 are your choices

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

      Players[0].Name := ' '; //username
      Players[0].Pass := ' '; //password
      Players[0].Nick := 'rio'; //3-4 letters from your username
      Players[0].Skill := 'strength';
      Players[0].Active := True;
    end;

    function FindChicken : Boolean;
    var
      Colors : array[1..4]of Integer;
      i : Integer;
    begin
     Result := False;
     colors[1] := 5227996;
     colors[2] := 923765;
     colors[3] := 5161431;
     colors[4] := 5269622;
     for i := 1 to 4 do
      begin
       if(FindObj(x, y, 'ick', colors[i], 5))then
        begin
        Result := True;
        end else
        Result := false;
      end;
    end;


    { NOT MINE I borrowed from Forefeathers }
    function countfeathers:integer;
    var
      feathers:integer;
    begin
      result:=0;
      feathers:=DTMFromString('78DA639464606010614001DBD7AC61E002D28' +
           'C40FC1F081845810C5E0634C08844026921202148400D485E8C08' +
           '73A409A8E107124A04D480FC2443408D3CA6DF31D448000949FC6' +
           'A00153F07BB');
      gametab(4);
      wait(200+random(50));
      if finddtm(feathers,x,y,mix1,miy1,mix2,miy2) then
      begin
        count:=GetTextAtEx(x-16, y-17, 0, statchars, False, False, 0, 1, 65535, 10, false, tr_AlphaNumericChars);
        count:=trim(TrimOthers(count));
        if not(count='') then
        begin
         result:=strtoint(count);
        end;
      end;
      freedtm(feathers);
    end;
    { NOT MINE I borrowed from Forefeathers }


    function FindFastRandoms: Boolean; //By WT-Fakawi.
    var
      i: Integer;
    begin
      for i := 1 to 8 do
      begin
        case I of
          1: if FindDead then
              Result := True;
          2: if FindMod then
              Result := True;
          3: if FindMime then
              Result := True;
          4: if FindMaze then
              Result := True;
          5: if FindQuiz then
              Result := True;
          6: if FindDemon then
              Result := True;
          7: begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          7: begin
              if InBlack then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'InBlack';
                Logout;
                Exit;
              end;
            end;
          8: RC;
        end;
        wait(1);
      end;
    end;


    procedure Feathers;
    var
    f : Integer;
    begin
     repeat
      begin
       if(FindObj(x, y, 'ath', 12171971, 5))then
        begin
         FTWait(2);
         MMouse(x, y, 5, 5);
         wait(30 + random(10));
         Mouse(x, y, 0, 0, false);
         wait(100 + random(30));
         ChooseOption('eather');
        end;
       F := f + 1;
      end;
     until(not(FindObj(x, y, 'ath', 12171971, 5))) or (f = 5);
    end;
     
     
    procedure Attack;
    begin
     if(FindChicken)then
      begin
       if(FindFight)then Exit;
       FindFastRandoms;
       MMouse(x, y, 5, 5);
       Mouse(x, y, 0, 0, true);
      end;
       repeat
        wait(300);
       until(not(FindFight));
      if(Random(5) = 2)then
      begin
       HoverSkill(Players[CurrentPlayer].Skill, false);
       wait(1000 + random(500));
      end;
     Chickens := Chickens + 1;
    end;

    procedure SetupPlayer;
    Begin
     if(not(LoggedIn))then
      Begin
       LoginPlayer;
      end;
     SetFightMode(FightMode);
    end;

    procedure Proggy;
    begin
     writeln('|<---------------------------->|');
     writeln('|< Stamp''s Chicken Killer 1.0 >|');
     writeln('|<---------------------------->|');
     writeln('|< Killed : ' + inttostr(Chickens) + 'Chickens >|');
     writeln('|<---------------------------->|');
    end;

    begin
     ActivateClient;
     SetupSRL;
     DeclarePlayers;
     SetupPlayer;
      repeat
      if(not(LoggedIn))then
        Begin
         NextPlayer(False);
          begin
          SetupPlayer;
           MarkTime(PlayerTimer);
           repeat
           Attack;
            wait(50);
            Feathers;
           FindFastRandoms;
           until(TimePerPlayer>= TimeFromMark(PlayerTimer));
           NextPlayer(True);
          end;
        end;
      until(false);
    end.

    It takes me to the Login script by the True False Booleans so its something with the player, i think...

  2. #2
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Let me guess...

    CurrentPlayer := 1;

    You only have player 0, and you're trying to load player 1. Out of range.


  3. #3
    Join Date
    Mar 2007
    Location
    Ohio
    Posts
    138
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with chicken killer
    By D1zl3 in forum OSR Help
    Replies: 2
    Last Post: 10-04-2008, 10:11 PM
  2. Chicken Killer (yet another one)
    By dontpanic in forum RS3 Outdated / Broken Scripts
    Replies: 122
    Last Post: 04-20-2008, 05:12 PM
  3. Chicken Killer
    By Electron Man in forum First Scripts
    Replies: 19
    Last Post: 11-19-2007, 12:32 PM
  4. Chicken killer
    By me_ntal in forum RS3 Outdated / Broken Scripts
    Replies: 5
    Last Post: 04-17-2007, 04:56 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
  •