vaseline28 commented on a Page, Gambling time  -  Jun 20, 2008
  if ($1 == !heads) {
    var %coinflip $rand(1,2)
    describe $chan flips a coin
    if (%coinflip == 1) {
      writeini money.ini CMoney $nick $calc($readini(money.ini, CMoney, $nick + 1))
      describe $chan sees the coin land on Heads
      msg $chan You now have $readini(money.ini, CMoney, $nick) coins.
    }
    if (%coinflip == 2) { 
      describe $chan sees the coin fall on tails.
      msg $chan sorry $nick $+ , you lose.
    }
  }
  if ($1 == !tails) {
    var %coinflip $rand(1,2)
    describe $chan flips a coin
    if (%coinflip == 2) {
      writeini money.ini CMoney $nick $calc($readini(money.ini, CMoney, $nick + 1))
      describe $chan sees the coin land on Tails
      msg $chan You now have $readini(money.ini, CMoney, $nick) coins.
    }
    if (%coinflip == 1) { 
      describe $chan sees the coin fall on Heads
      msg $chan sorry $nick $+ , you lose.
    }
  }
}
}

That section could be re-written to:

if (($1 == !heads) || ($1 == !tales)) {
var %x $iif($1 == !heads,1,2)
var %t $rand(1,2)
describe $chan flips a coin.
if (%t == %x) {

} else { } }

You see it cut out lots of space (replace and with your commands for each occasion).

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.