Results 1 to 9 of 9

Thread: For to do

  1. #1
    Join Date
    Apr 2007
    Posts
    994
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default For to do

    SCAR Code:
    function Hillgiantfight(Color:TintegerArray; tol: integer): integer; //My first function, so...

    var
      xxt,yyt,x,y,ftd:integer;
     
    begin
      if (not (LoggedIn) or (FindDead)) then Exit;
      for ftd:=0 to high(color) do
        x:=MMCX;
        y:=MMCY;
      if FindObjTPA(x, y,color[ftd], tol, -1, 15, 15, 50,['ill','ttack','iant'])and  //Line with error
      not FindColor(x, y, 65280, MIX1, MIY1, MIX2, MIY2) then
      begin
        Result:=1
        Mouse(x,y,1,1,true);
      end else
      begin
        if findcolortolerance(xxt,yyt,60909, MMX1, MMY1, MMX2, MMY2,tol) then
        begin
          xxt:=xxt+5;
          yyt:=yyt+5;
          if (not(findcolortolerance(xxt,yyt,5400423,MMX1, MMY1, MMX2, MMY2,tol))) then
          begin
            xxt:=xxt-5;
            yyt:=yyt-5;
            Mouse(xxt,yyt,5,5,true);
            result:=2
          end else
          begin
            result:=3
          end;
        end;
      end;
    end;

    I get a
    Out Of Range in line 277 in script

    Line with error:
    SCAR Code:
    if FindObjTPA(x, y,color[ftd], tol, -1, 15, 15, 50,['ill','ttack','iant'])and

    Oh, and its a runtime error. Whats wrong with it?
    [QUOTE]<GoF`> oh no its Raymooond
    <Raymooond> Heya
    <GoF`> is it ray or some other ray?
    <LeeLokHin> No idea
    <LeeLokHin> Raymond, what's the game you like the most?
    <Raymooond> Runescape
    <-- LeeLokHin has kicked Raymooond from #srl (Faker.)[/QUOTE]

  2. #2
    Join Date
    Feb 2008
    Location
    In the woods of Finland
    Posts
    45
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The loop needs begin and end

    SCAR Code:
    For 0 to High(Color) do
      begin
       //the whole thingy
      end;
    Cut & Drop or Stock Powerchonker


    Teh 3vil Oar H1t5 Chuck Norris Stone c0ld

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

    Default

    Quote Originally Posted by Trollvete View Post
    The loop needs begin and end

    SCAR Code:
    For 0 to High(Color) do
      begin
       //the whole thingy
      end;

    Im sure thats not the problem.
    Try checking by using debugging.

  4. #4
    Join Date
    Feb 2008
    Location
    In the woods of Finland
    Posts
    45
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I still am quite sure of it, and I also tested it.
    SCAR Code:
    begin
      if (not (LoggedIn) or (FindDead)) then Exit;
      for ftd:=0 to high(color) do
        x:=MMCX; // <- it will just repeat this high(color) times if there is no begin

        y:=MMCY;

    Edit: Cheers, Drizzt
    Cut & Drop or Stock Powerchonker


    Teh 3vil Oar H1t5 Chuck Norris Stone c0ld

  5. #5
    Join Date
    Dec 2007
    Location
    I'm the short man in all those arcade games you play
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Check your if, then. Each if should have a then.
    Each begin should have an end.

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

    Default

    actually, it is the problem, i tested and compiled. good work troll
    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

  7. #7
    Join Date
    Apr 2007
    Posts
    994
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Yep, thanks, troll. Of all the things I could have forgotten, I forgot a begin...end

    *Bangs head on wall*

    Thanks a lot!
    [QUOTE]<GoF`> oh no its Raymooond
    <Raymooond> Heya
    <GoF`> is it ray or some other ray?
    <LeeLokHin> No idea
    <LeeLokHin> Raymond, what's the game you like the most?
    <Raymooond> Runescape
    <-- LeeLokHin has kicked Raymooond from #srl (Faker.)[/QUOTE]

  8. #8
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Yeah, you will always need a begin and an end if there is more than one statment in the area that you want to for to do bit.

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

    Default

    Thanks for correcting me Trollvete I've repped you .

Thread Information

Users Browsing this Thread

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

Posting Permissions

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