Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
atraeyu
Novice


Joined: 29 Dec 2006
Posts: 41
Location: Chester, VT

PostPosted: Fri Dec 14, 2007 11:02 pm   

Adding Randomness
 
I want cast light to execute only 10% of the time. I'm doing this by using the following:

#CASE %random {cast light} {#NOOP} {#NOOP} {#NOOP} {#NOOP} {#NOOP} {#NOOP} {#NOOP} {#NOOP} {#NOOP}

Is there a better way?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Fri Dec 14, 2007 11:07 pm   
 
#if (%random(1,10)==10) {cast light}
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Fri Dec 14, 2007 11:08 pm   
 
Of course if you are going to cast 9 other spells as well then #switch is probably what you are looking for.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
atraeyu
Novice


Joined: 29 Dec 2006
Posts: 41
Location: Chester, VT

PostPosted: Fri Dec 14, 2007 11:14 pm   
 
Thank you :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net