Cigue
2010-01-29 16:33:27
I'm looking for a stable alternative to ChooseOption and derivates. any ideas?
2010-01-29 16:33:27
2010-01-29 16:44:26
2010-01-29 17:35:25
procedure Misc_Flag(WaitMore : Boolean);
begin
While FlagDistance >= Random(4) do
begin
Wait(100 + Random(50));
Writeln('5');
end;
if WaitMore then Wait(700+Random(400));
end;if (FindColor(X, Y, FlagColor, MMX1, MMY1, MMX2, MMY2)) then
Result := Distance(MMCX, MMCY, X + 1, Y + 14);2010-01-29 17:39:19
procedure Misc_Flag(WaitMore : Boolean);
begin
While FlagDistance >= Random(4) do //this does check for flag!
begin
Wait(100 + Random(50)); //then it waits
Writeln('5');
end;
if WaitMore then Wait(700+Random(400)); //and waits more if you want it to
end;2010-01-29 17:42:43
2010-01-29 18:54:35
2010-01-29 19:25:17
2010-01-29 20:39:48
From: Sex
Random(4) returns 0-3..
FlagDistance >= 0 would return true if it doesn't exist I think?
I don't know what it returns if there is no flag though most likely -1 so that might not be it.
if (FindColor(X, Y, FlagColor, MMX1, MMY1, MMX2, MMY2)) then
Result := Distance(MMCX, MMCY, X + 1, Y + 14);So it checks for a flag before even getting the distance. So the random(4) isn't the problem.