hey guys, how would be the correct way to write this....
What I want in this is something to repeat something until it is larger or = the value of a certain var.Code:Until true or AttemptsD > MaxAttemptsD
Thanks in Advanced
hey guys, how would be the correct way to write this....
What I want in this is something to repeat something until it is larger or = the value of a certain var.Code:Until true or AttemptsD > MaxAttemptsD
Thanks in Advanced
try this...no garentee its right but it might work
SCAR Code:until ( varboolean = true or AttemptsD > MaxAttemptsD)
STOP PM'ING ME
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
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
Thanks alot Hobbit
and ty for the X I forgot xD
I'd ++ Rep if couldbut since u helped me b4, I cant.... (which is kinda good, but bad cuz u cant get extra rep from me yet :P)
That should workCode:until (AttemptsD mod MaxAttemptsD = 0)
SRL Developer
◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘
Also no need for
(SomeBoolean = true)
just
(SomeBoolean)
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
There are currently 1 users browsing this thread. (0 members and 1 guests)