SRL Archive - OSR Help

ChooseOptionMultiEx dying on me


Cigue

2010-01-29 16:33:27

I'm looking for a stable alternative to ChooseOption and derivates. any ideas?

YoHoJo

2010-01-29 16:44:26

I used ChooseOption('') all the time (and recently) and its been working 100% for me, whats going wrong with yours? Failing to identify the text? What text are you telling it to search for? Try shortening it to just two unique letters.

Cigue

2010-01-29 17:35:25

I will try, thank you :)

A second question : Knowing that there is no flag on screen, why is this an infinite loop?

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;

for reference, FlagDistance is

if (FindColor(X, Y, FlagColor, MMX1, MMY1, MMX2, MMY2)) then
Result := Distance(MMCX, MMCY, X + 1, Y + 14);

Update : Countcolor(flagcolor) return 19-20. isn't flagcolor unique? I see nothing red on minimap.

YoHoJo

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;

Wats wrong? I don't understand your question.
Not an infinite loop, it only loops if flagcolor is found.

Cigue

2010-01-29 17:42:43

SCAR is a strange machine. My problem was that it kept looping even if there was no flag, basically inventing the color. now it stopped.

Sex

2010-01-29 18:54:35

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.

Cigue

2010-01-29 19:25:17

when there is no flag it returns 0, although I made it so the while..do would stop if flagcolor wasn't found.

YoHoJo

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.


Well remember, flagdistance is
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.