Results 1 to 13 of 13

Thread: ChooseOption

  1. #1
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default ChooseOption

    Does ChooseOption not handle Uppercase letters?

    The thing I am having it choose option is "Enter Cave entrance"... if I do ChooseOptino('nter Cave entrance'); it fails. :S

    Here is to test, it doesn't write Hi...
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    begin
    setupsrl;
    wait(2000);
    if ChooseOption('ave entranc') then
      WriteLn('hi');
    end.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  2. #2
    Join Date
    Jan 2007
    Location
    Tennessee
    Posts
    642
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Try doing the exact same script on something you know works, like a ladder.
    Then if it works i guess the problem is in the text you are looking for.
    And you could see if there is a difference in using 'Ladder' and 'adder'

  3. #3
    Join Date
    Jun 2007
    Location
    Ohio
    Posts
    341
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i think it does. ive used it before for like 'Chop' and stuff like that and it worked fine for me. maybe just test it a few times and find out.

  4. #4
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    the thing is chooseoption handles only white text as far as i know..

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  5. #5
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    ChooseOption does handle the whole text, or atleast the blue afaik, but the UpChars font's some capped letters are broken, so use low caps. You don't need nearly that long uptext, use 'ntranc' or so.

  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by JuKKa View Post
    the thing is chooseoption handles only white text as far as i know..
    That is not right. ChooseOption handle's all colors. I think hy means that the result of chooseoption is not right, right hy?



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  7. #7
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i don't think it works with spaces, in my cow killer, i was going to try 'ttack Cow',but it didn't work, so i tried Cow and it worked, so i think it can't handle spaces.
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  8. #8
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    That is not right. ChooseOption handle's all colors. I think hy means that the result of chooseoption is not right, right hy?
    Well then its probably something, if u use 2 different like the example above, 'tack cow' where "tack" is white, and "cow" is yellow. Well.. could be im wrong again. I have to look at the code of Chooseoption

    edit

    I see, it uses bitmapmasks well i dunno then..

    To devs: i made the function work faster

    SCAR Code:
    program New;

    {.Include SRL/SRL.Scar}

    Var
      T: Integer;

    function ChooseOptionEx(txt: string): Boolean;
    var
      x1, y1, x2, y2, LeftCorner, RightCorner, x, y: Integer;
    begin
      LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
        '411A600064715CEA914500CACE13F0');
      RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
        'C5200D30002E35F8C501C9C013F0');
      if (FindBitmapIn(LeftCorner, x1, y1, Msx1, Msy1, Msx2, Msy2))Then
        if (FindBitmapIn(RightCorner, x2, y2, Msx1, Msy1, Msx2, Msy2)) then
          if (FindText(x, y, txt, upchars, x1, y1, x2, 502)) then
          begin
            Result := True;
            Mouse(x1 + 5, y + 3, Length(txt) * 6, 4, True);
          end else
          begin
            MMouse(x1 - 50, y1 - 50, 40, y2-y1);
            Wait(200 + Random(100));
          end;
      FreeBitmap(LeftCorner);
      FreeBitmap(RightCorner);
    end;
     
    Begin
      SetupSRL;
     
      T := GetSystemTime;
      ChooseOptionEx('hello');
      Writeln('Ex '+IntToStr(GetSystemTime - T)+' Msec');
     
      T := GetSystemTime;
      ChooseOption('hello');
      Writeln('Ex '+IntToStr(GetSystemTime - T)+' Msec');
    End.

    run that and see for ur self. About 100msec faster

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  9. #9
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    That is not right. ChooseOption handle's all colors. I think hy means that the result of chooseoption is not right, right hy?
    It actually results okay, if I do Result := ChooseOption('nter'); it works fine.

    I guess spaces don't work.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  10. #10
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Spaces do work it's just that it mucks up sometimes. Thats when you need to make a bitmap.

  11. #11
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by Hy71194 View Post
    It actually results okay, if I do Result := ChooseOption('nter'); it works fine.

    I guess spaces don't work.
    They should work...



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  12. #12
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Well, they don't for me


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  13. #13
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    is entrance supposed to be capatalized in the game? Cause then scar can't do caps.
    I do visit every 2-6 months

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Chooseoption help
    By Brianb in forum OSR Help
    Replies: 37
    Last Post: 08-27-2008, 07:30 PM
  2. Hwo to use ChooseOption
    By PwNZoRNooB in forum OSR Help
    Replies: 3
    Last Post: 04-29-2007, 09:22 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
  •