Results 1 to 6 of 6

Thread: breaking loops?

  1. #1
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default breaking loops?

    so ive beening trying to make a yew cutter but got annoyed of making the finding function so im trying make the loop
    So how would i break out of the If Then but not the Repeat Until Loop?
    SCAR Code:
    Function CutTillFull:Boolean;

    Begin
    If Not LoggedIn Then Exit;

      Repeat

      If InvFull Then
      Begin
        Reult := True
        Exit;
      End;

      If Not CuttingYews Then
      Begin
        If TpaFind(1,'ew') Then
        Begin
          If Not IsUpText('ew') Then
          //Here i want to break out of the If Then but not the Repeat Until loop
            GetMousePos(x,y);
              If Random(10)=5 Then
               Begin
                 Mouse(x,y,0,0,False);
                 ChooseOption('ew');
               End Else
               Mouse(x,y,0,0,True);
        End;
      End;



      Until(False);
    End;
    Thanks
    ~Rya

    Edit: If some one could add me on msn tp help me that would be great
    Last edited by rya; 02-28-2010 at 04:26 PM.
    I see Now, says the blind man

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

    Default

    All you need to use is 'Break;', which you kinda touched on.

    SCAR Code:
    If Not IsUpText('ew') Then {}Break;{}

    Should do the trick

  3. #3
    Join Date
    Jan 2010
    Posts
    90
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If I understand what your asking, you cannot break out of an if then. Because if the condition is true it'll continue and if its false it will not. So maybe I just don't understand your question. Feel free to hit me up on MSN if you would like TheAlphaEchoTango@live.com

  4. #4
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Naum View Post
    All you need to use is 'Break;', which you kinda touched on.

    SCAR Code:
    If Not IsUpText('ew') Then {}Break;{}

    Should do the trick
    So that won't stop the repeat loop
    I see Now, says the blind man

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

    Default

    Oh lol, I miss-read.

    Edit, just do the if statement before the other so it doesn't carry on. Like so:

    SCAR Code:
    If {Not} IsUpText('ew') Then //change it appropriately here
         If TpaFind(1,'ew') Then
        Begin
            GetMousePos(x,y);
              If Random(10)=5 Then
               Begin
                 Mouse(x,y,0,0,False);
                 ChooseOption('ew');
               End Else
               Mouse(x,y,0,0,True);
        End;

  6. #6
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok thanks for the help
    I see Now, says the blind man

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
  •