Results 1 to 3 of 3

Thread: case random...

  1. #1
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default case random...

    ok so im making a cake stall thiever and banker. Im trying to make it more random by adding this:

    Procedure ClickStall;
    begin
    case random(2)of
    1 : Mouse(x, y, 1, 1, True);
    2 : Mouse(x, y, 1, 1, False);
    wait(100+random(100));
    ChooseOption('teal');
    end;
    end;

    Error it gives me is that a semi colon is expected on line 33 which is the "wait(100+random(100));" line.

    It wont compile and im not sure what to change.
    Any help?

  2. #2
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    Procedure ClickStall;
    begin
      case random(2)of
      0 : Mouse(x, y, 1, 1, True);
      1 : begin
             Mouse(x, y, 1, 1, False);
             wait(100+random(100));
             ChooseOption('teal');
           end;
      end;
    end;

    You need to havethe begin end; for the 2nd case because you are doing more than 1 function/procedure.

    Also random(2) is not 1,2. Counting starts at 0 so random(2) is 0,1

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  3. #3
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Thank you very much, theres 1 problem down lol.
    Would you mind helping me on MSN for a minute?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Case..Of Help
    By Drew_Dawg in forum OSR Help
    Replies: 7
    Last Post: 02-02-2008, 11:47 PM
  2. Using Case and Of
    By Fourscape in forum Outdated Tutorials
    Replies: 3
    Last Post: 08-18-2007, 08:40 PM
  3. Case - Else
    By stylen in forum OSR Help
    Replies: 0
    Last Post: 05-30-2007, 11:54 PM
  4. Case OF
    By Jagex_Fagex in forum News and General
    Replies: 3
    Last Post: 10-25-2006, 08:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •