Results 1 to 10 of 10

Thread: Whats wrong with this case statement :c

  1. #1
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default Whats wrong with this case statement :c

    Simba Code:
    case(2) of :
      1.  Mouse(x,y,0,0,False);
          wait(1000);
          ChooseOption('Use');
      2.  Mouse(x,y,0,0,True);
    I'm pretty sure that's not how it's supposed to go like...
    But it's my first time using a case statement :P

  2. #2
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    change the . to : after the 1 and 2.

    remove the ':' after 'of', it is not needed

    looking at your code, you realise it will only do 2?

    If you want to do a random of 1 or 2 then do

    Simba Code:
    case random(2) of
      1:  begin
           Mouse(x,y,0,0,False);
           wait(1000);
           ChooseOption('Use')
           end;
      2:  Mouse(x,y,0,0,True);
    end;
    Last edited by Yanhua; 01-20-2012 at 01:17 AM.
    Click Here for my PUBLIC script: Auto Tabs Pro

  3. #3
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Why you so pro :c
    Thanks

  4. #4
    Join Date
    Oct 2008
    Posts
    500
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    random(2) will return either 0 or 1 if I remember right.

    You will probably need to change those to 0 and 1.

  5. #5
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Simba Code:
    case Random(2) of
      0:  begin
           Mouse(x,y,0,0,False);
           wait(1000);
           ChooseOption('Use')
           end;
      1:  Mouse(x,y,0,0,True);
    end;

    Is what you want I think

    -Boom

  6. #6
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Dynamite View Post
    Simba Code:
    case Random(2) of
      0:  begin
           Mouse(x,y,0,0,False);
           wait(1000);
           ChooseOption('Use')
           end;
      1:  Mouse(x,y,0,0,True);
    end;

    Is what you want I think

    -Boom
    I posted the exact same thing...
    Click Here for my PUBLIC script: Auto Tabs Pro

  7. #7
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Yanhua View Post
    I posted the exact same thing...
    Random(2) will generate either 0 or 1.
    So no, you didn't <3

    -Boom

  8. #8
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Dynamite View Post
    Random(2) will generate either 0 or 1.
    So no, you didn't <3

    -Boom
    Oh, okay. In that case he can use RandomRange(1,2)
    Click Here for my PUBLIC script: Auto Tabs Pro

  9. #9
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Yanhua View Post
    Oh, okay. In that case he can use RandomRange(1,2)
    Indeed <3

    -Boom

  10. #10
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    545
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by Dynamite View Post
    Simba Code:
    case Random(2) of
      0:  begin
           Mouse(x,y,0,0,False);
           wait(1000);
           ChooseOption('Use')
           end;
      1:  Mouse(x,y,0,0,True);
    end;

    Is what you want I think

    -Boom
    Simba Code:
    case Random(2) of
      0:  begin
           Mouse(x,y,3,3,False);
           wait(800 + random(400));
           ChooseOption('Use');
           end;
      1:  Mouse(x,y,3,3,True);
    end;

    This would be best

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
  •