Results 1 to 8 of 8

Thread: Correct Way to Write this Until...

  1. #1
    Join Date
    Jan 2007
    Posts
    248
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Correct Way to Write this Until...

    hey guys, how would be the correct way to write this....

    Code:
    Until true or AttemptsD > MaxAttemptsD
    What I want in this is something to repeat something until it is larger or = the value of a certain var.


    Thanks in Advanced

  2. #2
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    try this...no garentee its right but it might work
    SCAR Code:
    until ( varboolean = true or AttemptsD > MaxAttemptsD)
    STOP PM'ING ME

  3. #3
    Join Date
    Jan 2007
    Posts
    248
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Its not working, but here have a look...
    SCAR Code:
    Function FindXColors: Boolean;
    var AttemptsD, MaxAttemptsD, ctX, ctY: integer;
     Begin
     AttemptsD := 0;
     MaxAttemptsD := 12;
       Repeat
      Wait(250 + random(50));
       If FindObj(ctX, ctY, 'X', X, 4) then begin
      MMouse(ctX, ctY, 2, 2); Wait(200);
        X := GetColor(ctX + 3, ctY + 3);
        X := GetColor(ctX + 3, ctY - 3);
        X := GetColor(ctX - 3, ctY - 3);
        Result := True;  End;
       If not FindObj(ctX, ctY, 'X', X, 4) then begin
        Result := False; AttemptsD := AttemptsD + 1;  End;
       Until(Result = True or AttemptsD > MaxAttemptsD);
      End;

    The X's are Vars.... or something i had to block out from the leecher public

  4. #4
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    should work now...also for the if no statement i think u edited now...but when i copied it was something else(wont name cause u want to keep secret) so i changed to X before i posted

    SCAR Code:
    Function FindXColors: Boolean;
    var AttemptsD, MaxAttemptsD, ctX, ctY: integer;
     Begin
     AttemptsD := 0;
     MaxAttemptsD := 12;
       Repeat
      Wait(250 + random(50));
       If FindObj(ctX, ctY, 'X', X, 4) then begin
      MMouse(ctX, ctY, 2, 2); Wait(200);
        X := GetColor(ctX + 3, ctY + 3);
        X := GetColor(ctX + 3, ctY - 3);
        X := GetColor(ctX - 3, ctY - 3);
        Result := True;  End;
       If not FindObj(ctX, ctY, 'X', X, 4) then begin
        Result := False; AttemptsD := AttemptsD + 1;  End;
       Until(Result = True) or (AttemptsD > MaxAttemptsD)
      End;
    STOP PM'ING ME

  5. #5
    Join Date
    Jan 2007
    Posts
    248
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks alot Hobbit
    and ty for the X I forgot xD

    I'd ++ Rep if could but since u helped me b4, I cant.... (which is kinda good, but bad cuz u cant get extra rep from me yet :P)

  6. #6
    Join Date
    Feb 2006
    Location
    Under a rock.
    Posts
    1,351
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Code:
    until (AttemptsD mod MaxAttemptsD = 0)
    That should work
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

  7. #7
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Also no need for

    (SomeBoolean = true)

    just

    (SomeBoolean)

  8. #8
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    my way still worked....just the long hard way ...kinda like long division, its not neccisary cause of short division but i still like long better....though i didnt know that u didnt need the = true...learn something new everyday
    STOP PM'ING ME

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Is this correct?
    By NCDS in forum OSR Help
    Replies: 1
    Last Post: 12-23-2008, 03:14 AM
  2. How do i get it to the correct window?
    By your mom in forum OSR Help
    Replies: 1
    Last Post: 12-20-2008, 08:36 PM
  3. is this correct?
    By jones2644 in forum OSR Help
    Replies: 2
    Last Post: 07-05-2008, 10:37 PM

Posting Permissions

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