Briefcase Game

By NightBlade on Oct 12, 2008

This one , I made on a boring day.

;Briefcase Game, by NightBlade

on 1:TEXT: !briefcase*:#:{
  set %briefcase $rand(1,3)
  if (%briefcase == 1) describe $chan pulls a pistol out of a briefcase and shoots $nick in the head
  if (%briefcase == 2) describe $chan pulls a pellet gun out of a briefcase and shoots $nick in the chest
  if (%briefcase == 3) describe $chan pulls out a huge wad of money and tosses it to $nick
}

Comments

Sign in to comment.
NightBlade   -  Oct 13, 2008

yea.. by Scripting means..

Call me a Nooob

 Respond  
Imrac   -  Oct 12, 2008

Instead of setting a variable use /var, that way its local to the script and not a global variable. maybe something like:

on 1:TEXT: !briefcase:#:{
  var %x $rand(1,3), %m
  if (%x == 1) %m = pulls a pistol out of a briefcase and shoots $nick in the head
  elseif (%x == 2) %m = pulls a pellet gun out of a briefcase and shoots $nick in the chest
  else %m = pulls out a huge wad of money and tosses it to $nick
  describe $chan %m
}
 Respond  
Typo   -  Oct 12, 2008

Your right there, thats why i tried to make it interesting with $r() and $iif(), lol.

 Respond  
NightBlade   -  Oct 12, 2008

lol, yea, it was too short, anyone with half a scripting brain could make it

 Respond  
Typo   -  Oct 12, 2008

Lmao, you changed the code on me. You get the idea tho.

 Respond  
Typo   -  Oct 12, 2008

You could even use $r() (the same as $random()) to make it a little shorter.
So your code..

on 1:TEXT:!candy*:#:{
  set %candy $rand(1,2)
  if (%candy == 1) describe $chan smacks $nick over the head with an iron pan "1,0no candy for you!6"
  if (%candy == 2) describe $chan gives $nick a piece of candy
}

Could be shortened to..

on 1:TEXT:!candy*:#: describe $chan $iif($r(1,2) == 2,gives $nick a piece of candy,smacks $nick over the head with an iron pan "1 $+ $chr(44) $+ 0no candy for you!6")

Notice how I had to use the $chr(44) instead of the comma in the color 1,0 part, that was to keep the $iif from treating it as a part of the $iif and therefor failing. The $+'s ofcourse were needed to rebuild 1,0 from 1 $chr(44) 0.
Keep up the coding. :)

 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.