Top

Magic 8-ball


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Oct 31, 2009
Last Updated  Oct 31, 2009
Tags  8ball  magic  mirc 

Introduction

This is just another magic 8-ball, say !8ball and then your question to be given an answer, by the way, it only answers yes or no questions :P

Use: !8ball QUESTION

Example:
<%JohnSmith> !8ball Will I win $1 million dollars?
<@uBot> Original Question: Will I win $1 million dollars? Answer:
<@uBot> Have you gone mad?! I think you have

Enjoy!

UPDATE: Fixed all the bugs :)

Grab the Code

on *:TEXT:!8ball*:#: {
  set %8ball $rand(1,11)
 
  msg $chan Original question: $2- Answer:
 
  if (%8ball == 1) { msg $chan No! }
  if (%8ball == 2) { msg $chan Yes! }
  if (%8ball == 3) { msg $chan Of course }
  if (%8ball == 4) { msg $chan Have you gone mad?! I think you have }
  if (%8ball == 5) { msg $chan How should I know? Its not like I'm magic }
  if (%8ball == 6) { msg $chan Heck no! }
  if (%8ball == 7) { msg $chan Maybe... yeah }
  if (%8ball == 8) { msg $chan Why should I tell you? }
  if (%8ball == 9) { msg $chan If I say yes will you be quiet? }
  if (%8ball == 10) { msg $chan Yes... that will be 30 dollars }
  if (%8ball == 11) { msg $chan How should I say this? Um... no }
}

Comments

  (12)  RSS
sunslayer
Comments: 266
 
mIRC Snippet:  Magic 8-ball
Posted on Oct 31, 2009 3:26 pm
there are really too many of these :/
Quote:
IF(%8BALL Unknown command
space out ur /if's and their params
Ghost-writer
Comments: 255
 
mIRC Snippet:  Magic 8-ball
Posted on Oct 31, 2009 3:41 pm
Code:

on *:TEXT:!8ball*:#: {
  set %8ball $rand(1,12)
  msg $chan Original question: $2- Answer:
  if(%8ball == 1) { msg $chan No! }
  if(%8ball == 2) { msg $chan Yes! }
  if(%8ball == 3) { msg $chan Of course }
  if(%8ball == 4) { msg $chan Have you gone mad?! I think you have }
  if(%8ball == 5) { msg $chan How should I know? Its not like I'm magic }
  if(%8ball == 6) { msg $chan Heck no! }
  if(%8ball == 7) { msg $chan Maybe... yeah }
  if(%8ball == 1) { msg $chan Why should I tell you? | .timer 1 2 msg $chan BTW don't try and bribe me! }
  if(%8ball == 8) { msg $chan If I say yes will you be quiet? }
  if(%8ball == 9) { msg $chan Yes... that will be 30 dollars }
  if(%8ball == 10) { msg $chan How should I say this? Um... no }
  unset %8ball
}

Why are there so many 8balls on hawkee!!! argh! You should also use var %8ball so you dont need to unset it.
i guess you could try sockets but for purposes of this, you dont need the brackets. so like.
Code:

on *:TEXT:!8ball*:#: {
  var %8ball $rand(1,12)
  msg $chan Original question: $2- Answer:
  if %8ball == 1 msg $chan No!
  if %8ball == 2  msg $chan Yes!
  if %8ball == 3  msg $chan Of course
  if %8ball == 4 msg $chan Have you gone mad?! I think you have
  if %8ball == 5  msg $chan How should I know? Its not like I'm magic
  if %8ball == 6  msg $chan Heck no!
  if %8ball == 7 msg $chan Maybe... yeah
  if %8ball == 1 msg $chan Why should I tell you? | .timer 1 2 msg $chan BTW don't try and bribe me!
  if %8ball == 8 msg $chan If I say yes will you be quiet?
  if %8ball == 9 msg $chan Yes... that will be 30 dollars
  if %8ball == 10 msg $chan How should I say this? Um... no
}

And theres your code improved and 100% working.
Elijah
Comments: 4
 
mIRC Snippet:  Magic 8-ball
Posted on Oct 31, 2009 3:52 pm
I chose to unset it because I like to do that for my channel since well I have it full of scripts
Elijah
Comments: 4
 
mIRC Snippet:  Magic 8-ball
Posted on Oct 31, 2009 7:21 pm
Yeah I decided to go over my whole script to make sure nothing woulf interfere and removed that line of code from it, it wasn't working with it anyway, kept unsetting it before giving a result for some reason
Jethro_
Comments: 436
 
mIRC Snippet:  Magic 8-ball
Posted on Nov 1, 2009 2:43 am
This will make sure anything asked follows with the question mark at the end of a question:
Code:
on $*:TEXT:/(?<=\x3F)/S:#: {
  msg $chan Original question: $strip($2-) And the answer is:
  var %8ball = $rand(1,11)
  if (%8ball == 1) { msg $chan No! }
  if (%8ball == 2) { msg $chan Yes! }
  if (%8ball == 3) { msg $chan Of course }
  if (%8ball == 4) { msg $chan Have you gone mad?! I think you have }
  if (%8ball == 5) { msg $chan How should I know? Its not like I'm magic }
  if (%8ball == 6) { msg $chan Heck no! }
  if (%8ball == 7) { msg $chan Maybe... yeah }
  if (%8ball == 8) { msg $chan Why should I tell you? }
  if (%8ball == 9) { msg $chan If I say yes will you be quiet? }
  if (%8ball == 10) { msg $chan Yes... that will be 30 dollars }
  if (%8ball == 11) { msg $chan How should I say this? Um... no }
}
Last but not least, you could have chosen the local variable instead of the global variable. This uses the same command that you've indicated.
Elijah
Comments: 4
 
mIRC Snippet:  Magic 8-ball
Posted on Nov 2, 2009 2:36 pm
Thanks Jehtro_, I'll consider all that
sunslayer
Comments: 266
 
mIRC Snippet:  Magic 8-ball
Posted on Nov 2, 2009 2:55 pm
you could always throw in a $gettok to shorten it
3nigmat1c
Comments: 15
 
mIRC Snippet:  Magic 8-ball
Posted on Nov 7, 2009 5:35 am
Jethro yours is cool... If there is not so many people on the channel. It gets a bit irritating when you like, in a heated discussion and your bot randomly gives frustrating input, but still awesome :) Nice 8ball Elijah
Ghost-writer
Comments: 255
 
mIRC Snippet:  Magic 8-ball
Posted on Nov 7, 2009 6:05 am
$gettok would make this 3 lines :>, example?
Code:

on *:TEXT:!ball*:#: {
msg $chan The reply to your question: $strip($2) $+ , would have to be!
msg $chan $gettok(No|Yes|Maybe|Another time|When i die|in a million years|lick my nuts?|of course,$rand(1,8),124)
}
3nigmat1c
Comments: 15
 
mIRC Snippet:  Magic 8-ball
Posted on Nov 7, 2009 6:14 am
Quote:
$rand(1,8),124)


What does that do?
sunslayer
Comments: 266
 
mIRC Snippet:  Magic 8-ball
Posted on Nov 7, 2009 10:44 am
$rand(1,8) returns a random number between 1 and 8, the 124) was the third param from $gettok
Jethro_
Comments: 436
 
mIRC Snippet:  Magic 8-ball
Posted on Nov 7, 2009 11:45 am
You can also do it this way:
Code:
on *:TEXT:*:#: {
  tokenize 32 $strip($1-)
  if ($1 == !8ball) {
    msg $chan Original question: $2- And the answer is:
    var %x = No!|Yes!|Of course|Have you gone mad?! I think you have|$&
      How should I know? Its not like I'm magic|Heck no!|Maybe... yeah|Why should I tell you?|$&
      If I say yes will you be quiet?|Yes... that will be 30 dollars|How should I say this? Um... no
    msg $chan $gettok(%x,$rand(1,$numtok(%x,124)),124)
  }
}

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom