Jump to content
Sign in to follow this  

Pick a random action from a set?

Recommended Posts

I don't have a certain script in mind, but I was wondering, for future reference, how you would go about making a script perform an action from a set? Without any input from the user, it would just randomly pick action 1, or action 2, or action 3 and so on.

Share this post

Link to post
Share on other sites

$NumberOfActions = 3
$random = Int(Random(1, $NumberOfActions+ + 1))
  Case $random = 1
   ;do first thing
  Case $random = 2
   ;do second thing
  Case $random = 3
   ;do third thing
  Case Else
    MsgBox(0, "error", "invalid action.  Please program a responce before adjusting the number of actions variable.")

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...