Results 1 to 4 of 4

Thread: Help plz repeat problem

  1. #1
    Join Date
    Jun 2007
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help plz repeat problem

    program fish;

    var
    x,y: Integer;

    begin
    If FindColor(x, y,16777215,435,220,435,220) Then
    Begin
    KeyDown(GetKeyCode('s'));
    wait(10 + random(100));
    KeyUp(GetKeyCode('s'));
    end else
    Begin
    KeyDown(GetKeyCode('d'));
    wait(10 + random(100));
    KeyUp(GetKeyCode('d'));
    end;
    end.


    i want it to repeat i haved tryde cant fix it

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    SCAR Code:
    program fish;

    var
    x,y: Integer;

    procedure fish;
    begin
    If FindColor(x, y,16777215,435,220,435,220) Then
    Begin
    KeyDown(GetKeyCode('s'));
    wait(10 + random(100));
    KeyUp(GetKeyCode('s'));
    end else
    Begin
    KeyDown(GetKeyCode('d'));
    wait(10 + random(100));
    KeyUp(GetKeyCode('d'));
    end;
    end;

    begin
    repeat
    fish;
    until
    allplayers(inactive);
    end.
    or something

  3. #3
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    look at my tut for loops, and see if you can learn how to do them, so if you have a problem in the future you can do it yourself

    Click here!
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  4. #4
    Join Date
    Oct 2006
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Here is your code with a repeat, and fixed standards.

    Code:
    program fish;
    {.include SRL/SRL.scar}
    
    var
      x,y: Integer;
    
    procedure GetFish;
    begin
      if FindColor(x, y,16777215,435,220,435,220) then
      begin
        KeyDown(GetKeyCode('s'));
        wait(10 + random(100));
        KeyUp(GetKeyCode('s'));
      end else
      begin
        KeyDown(GetKeyCode('d'));
        wait(10 + random(100));
        KeyUp(GetKeyCode('d'));
      end;
    end;
    
    begin
      repeat
        GetFish;
      until(AllPlayersInactive)  // Or Whatever
    end.
    Also, go to Tutorial Island [Beginners] and read some tutorials on statements.

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
  •