Results 1 to 12 of 12

Thread: error

  1. #1
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    error

    can sum1 solve this error for me???

    the error is :
    SCAR Code:
    [Runtime Error] : Out Of Range in line 954 in script

    Line 954 is:
    SCAR Code:
    If FindObjCustom(x,y,['ocks'],[Rockcolor[i]],6) then



    Line 954 is in this part of the script is:

    SCAR Code:
    procedure ClickRock;
    begin
      Mouse(x, y, 1, 1, True);
      writeln('1');
      Replylaugh;
      writeln('2');
      Makesurepick;
      writeln('3');
      FindGas;
      writeln('4');
      Leveled;
      writeln('5');
      Myrandom;
      writeln('6');
    end;

    procedure FindRock;
    var
    RockColor : Array [0..2] of Integer;
    i : Integer;
    begin
      Rockcolor[0]:=3030370;
      Rockcolor[1]:=3161957;
      Rockcolor[2]:=2832993;
      begin
        if (not (Loggedin)) then Exit;
        for i:= 0 to 2 do
        writeln('7');
        If FindObjCustom(x,y,['ocks'],[Rockcolor[i]],6) then
        begin
        writeln('8');
          ClickRock;
          writeln('9');
        end;
      end;
    end;

    procedure MinedaRock;
    var MiningTime : integer;
    begin
      MakeCompass('N');
      writeln('10');
      SetAngle(True);
      writeln('11');
      repeat
      writeln('12');
        if Not(LoggedIn) then exit;
        FindRock;
        writeln('13');
        MarkTime(MiningTime);
        writeln('14');
        repeat
        writeln('15');
          Wait(250+Random(300));
          writeln('16');
        until FindBlackChatMessage('anage') or FindBlackChatMessage('vailable') or (timefrommark(MiningTime) > (WaitperRock +random(250)));
      until (InvFull);
      if (InvFull) then
      begin
        writeln( 'Inventory Full walking to bank.' );
      end;
    end;

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

    Default

    use this

    SCAR Code:
    procedure FindRock;
    var
    RockColor : Array [0..2] of Integer;
    i : Integer;
    begin
    If not LoggedIn then Exit;

    Rockcolor[0]:=3030370;
    Rockcolor[1]:=3161957;
    Rockcolor[2]:=2832993;

    For i := 0 to GetArrayLength(RockColor) do Begin
    If FindObjCustom(x,y,['ocks'],[Rockcolor[i]],6) then
    Begin
    ClickRock;
    Exit;
    End;
    End;
    End;

    Don't forget to rep me

  3. #3
    Join Date
    Apr 2007
    Posts
    277
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Shouldn't it be:

    SCAR Code:
    [Rockcolor(i)]

    instead of

    SCAR Code:
    [Rockcolor[i]]
    Current Script: Al-Kharid Fighter and Banker
    Status : Just Started

  4. #4
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Da Owner and lancelot are wrong, it should be RockColors[i] instead of [RockColors[i]]


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

    Default

    Umm, no because it's inside a TStringArray...

    OWNED

  6. #6
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Yup cazax Da Owner well Owned you hehe.
    Umm its fine, I didn't get any error check your srl/scar .. ?

  7. #7
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Still wrong da owner:

    use this
    SCAR Code:
    procedure FindRock;
    var
    RockColor : Array [0..2] of Integer;
    i : Integer;
    begin
    If not LoggedIn then Exit;
     
    Rockcolor[0]:=3030370;
    Rockcolor[1]:=3161957;
    Rockcolor[2]:=2832993;
     
    For i := 0 to GetArrayLength(RockColor) do Begin
    If FindObjCustom(x,y,['ocks'],[Rockcolor[i]],6) then
    Begin
    ClickRock;
    Exit;
    End;
    End;
    End;

    Don't forget to rep me
    for i := 0 to getarraylength(RockColors) do?
    You are going to get a runtime error too, the length of rockcolors are 0..1..2 and you are starting from 0 and then 0...

    OWNED

    should be:
    SCAR Code:
    for i := 0 to High(RockColors) do
      If FindObjCustm(bla, bla, RockColors[i], bla) then


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

    Default

    No, you don't get a runtime error. Run it and you will see. High is just like GetArrayLength...

  9. #9
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    No, you don't get a runtime error. Run it and you will see. High is just like GetArrayLength...
    High is a sort of Length(something) - 1 (or GetArrayLength).
    The length of the rocks are 0,1 and 2
    so you are using: for i := 0 to 0,1 and 2 do ...


  10. #10
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    actually, i'm pretty sure the owning is about to come from me

    SCAR Code:
    procedure FindRock;
    var
    RockColor : Array [0..2] of Integer;
    i : Integer;
    begin
      Rockcolor[0]:=3030370;
      Rockcolor[1]:=3161957;
      Rockcolor[2]:=2832993;
      begin
        if (not (Loggedin)) then Exit;
        for i:= 0 to 2 do
        begin //begin/end added, so "i" was the same everytime
          writeln('7');
          If FindObjCustom(x,y,['ocks'],[Rockcolor[i]],6) then
          begin
            writeln('8');
            ClickRock;
            writeln('9');
          end;
        end;
      end;
    end;
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

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

    Default

    I already did that in mine

  12. #12
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    bah. your standards screwed with my head, and i didn't see it
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Line 135: [Error] (14845:1): Syntax error in script
    By AbsTrACt'^.| in forum OSR Help
    Replies: 16
    Last Post: 05-23-2008, 01:14 PM
  2. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  3. Smart error and Some kind of Math.scar error
    By FagetHax0r in forum OSR Help
    Replies: 6
    Last Post: 02-24-2008, 10:43 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
  •