mIRC Simple Basketball script

By mrpotato44 on Mar 24, 2016

Completely random BasketBall Script when you type !basket

on *:TEXT:!basket*:#:{
  var %bball = $rand(1,10)
  if (%bball == 1) msg $chan $nick lays it up! Two points!
  if (%bball == 2) msg $chan $nick goes for a slam dunk! BOOM SHAKALAKA!
  if (%bball == 3) msg $chan $nick shoots a two pointer! Two points!
  if (%bball == 4) msg $chan $nick shoots from outside the line! Three points!
  if (%bball == 5) msg $chan $nick shoots from half court! Three points!
  if (%bball == 6) msg $chan $nick lays it up! And it is intercepted!
  if (%bball == 7) msg $chan $nick goes for a slam dunk! And it is intercepted!
  if (%bball == 8) msg $chan $nick shoots a two pointer! Air Ball!
  if (%bball == 9) msg $chan $nick shoots from outside the line! A miss!
  if (%bball == 10) msg $chan $nick shoots from half court! Off the rim, and... No Good!
}

Comments

Sign in to comment.
Arigateaux   -  Apr 19, 2016

This is a pretty good start. There are better ways of doing this without having to resort to copy/pasting the same type of information to add new content. One way I'd recommend is to think about it logically and make things that repeat themselves put on a single line, such as msg $chan $nick. Since these lines all share this trait in common, making it so it only has to use it once will save a lot of space when it's used a bunch of times.

Another thing that you can do is to set the new sentences to a single variable and just return the variable. This will also save space. The best way is to use tokens or a file for something as simple as this. Files can sometimes be a pain in the butt, since you have to edit a separate thing, but in the long run, it's a lot more manageable and makes your code a lot cleaner. If you don't want to attach a file with your script, which many people opt not to do, you could use tokens. Check out the Token Identifiers file in the help.

mrpotato44  -  Jun 09, 2016

thank you for your comments! :)

Sign in to comment

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.