Results 1 to 7 of 7

Thread: case ... of problems

  1. #1
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default case ... of problems

    Edit: OKAY I AM SORRY I AM DUMB! I remembered what to do. As it turns out Random(2) actually picks a random number between 0 and 1 - yea it makes sense I know. I only remembered that because of good ol' C++.... Anyways if you want to virtual-slap me go for it. As for this thread - NO MORE TELLING ME HOW DUMB I AM.

    SideNote: what is funny is that nobody else actually figured out what was wrong either hehe...

    Okay I am writing a script and for some reason I am not gettin good results with cases. I know how to use them and I know I am missing one tiny crappy thing. When I run it, it always chooses option 1, never option 2.

    SCAR Code:
    case (RandomRange(1,2)) of
      1: begin
            Mouse(x, y, 3, 3, False);
            ChooseOption('ine');
          end;
      2: Mouse(x, y, 3, 3, True);
    end;

    I didn't have that begin, end at first but added it to see if it would help...

    Hope someone will point out my stupid errors ... Thanks...

  2. #2
    Join Date
    May 2008
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I believe you have to put a begin before just putting a command. At number 2. Also, is that the whole script? Post the whole script if not.

  3. #3
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ecnerwal View Post
    I believe you have to put a begin before just putting a command. At number 2. Also, is that the whole script? Post the whole script if not.
    I'm fairly sure you do not need a begin after the number 2 since it isn't more than one line. If someone else agrees with you though I will consider my question answered. Trust me, the whole script is entirely too long and too unnecessary for this little problem

  4. #4
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Why are you using RandomRange? Just use Random(2)...

  5. #5
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    RandomRange(1, 3) should work. I'm not sure why 1-2 doesn't work, but 1-3 definitely gives you both 1 and 2 as results while not giving you 3 or 0.
    :-)

  6. #6
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by itschris917 View Post
    Why are you using RandomRange? Just use Random(2)...
    I have tried using Random(2) also. I switched to RandomRange to see if that would help. I didn't put it back before I made that copy.

  7. #7
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Random(2) didnt work for you either??

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Case help
    By Aser in forum OSR Help
    Replies: 3
    Last Post: 11-22-2008, 05:21 AM
  2. Case..Of Help
    By Drew_Dawg in forum OSR Help
    Replies: 7
    Last Post: 02-02-2008, 11:47 PM
  3. In case if you got problems with connection
    By Negaal in forum Research & Development Lounge
    Replies: 4
    Last Post: 01-29-2008, 10:10 PM
  4. Case Problems
    By Tails111 in forum OSR Help
    Replies: 9
    Last Post: 08-20-2007, 11:06 AM
  5. Case - Else
    By stylen in forum OSR Help
    Replies: 0
    Last Post: 05-30-2007, 11:54 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
  •