Results 1 to 4 of 4

Thread: Case help

  1. #1
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Case help

    I want to make a case statement that allows me to have multiple numbers do one action ex...

    SCAR Code:
    case (random(10)) of
     1,2,3 : Action1;
     4,5,6,7: Action2;
     8,9,10 : Action3;
    end;

    The thing is that I have to do a lot of this and I was wondering if there was a faster way? Something like

    SCAR Code:
    1-3:Action1;

    instead of

    SCAR Code:
    1,2,3:Action1;

    Any help would be appreciated.

    P.S. Who is Drunkenoldma? Is it the guy who coded the scar tags? Did he do anything else?

  2. #2
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I dont know if there is a shorter way, but i think your asking for something like this?Sorry if I'm totally wrong.
    SCAR Code:
    case (random(3)) of
    0: begin
         1,2,3 : Action1;
       end;
    1: begin
         4,5,6,7: Action2;
       end;
    2: begin
         8,9,10 : Action3;
       end;
    end;

    Edit: yeah drunkenoldma is a member here but I dont think he is active anymore, and I'm not sure if he had created anything else.

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

    Default

    I think this should work:

    SCAR Code:
    case Random(10) of
      0..3: doThis;
      4..6: doThat;
      5..9: doSomethingElse;
    end;

    And yes, Drunkenoldma coded the SCAR tags.
    :-)

  4. #4
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by d1s3l View Post
    I dont know if there is a shorter way, but i think your asking for something like this?Sorry if I'm totally wrong.
    That was not what I was looking for but don't be sorry. I thank you for trying to help me and for the quick response.


    @Method

    That was what I was asking thank you.

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
  •