Results 1 to 8 of 8

Thread: ChooseOptionMultiEx dying on me

  1. #1
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default ChooseOptionMultiEx dying on me

    I'm looking for a stable alternative to ChooseOption and derivates. any ideas?
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    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.

  3. #3
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I will try, thank you

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

    SCAR Code:
    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

    SCAR Code:
    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.
    Last edited by Cigue; 01-29-2010 at 10:39 PM.
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    SCAR Code:
    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.

  5. #5
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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.
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  6. #6
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    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.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  7. #7
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  8. #8
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    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
    SCAR Code:
    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.

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
  •