Simple 8ball Snippet

By shugo103 on Jun 24, 2006

Just type @8ball -your question-

on 1:text:@8Ball*:#: {
  var %8ball $rand(1,14)
  if (%8ball == 1) { .msg $chan 4 $+ Yes, Of course. }
  if (%8ball == 2) { .msg $chan 12 $+ No! }
  if (%8ball == 3) { .msg $chan 15 $+ Maybe, If you are nice }
  if (%8ball == 4) { .msg $chan 4 $+ Of course! }
  if (%8ball == 5) { .msg $chan 14 $+ Ask again later. }
  if (%8ball == 6) { .msg $chan 12 $+ Sure... }
  if (%8ball == 7) { .msg $chan 15 $+ Maybe. }
  if (%8ball == 8) { .msg $chan 14 $+ Never! }
  if (%8ball == 9) { .msg $chan 4 $+ Damnit I said no!!! }
  if (%8ball == 10) { .msg $chan 12 $+ HAHAHA yeah righhht... In 1000 years maybe. }
  if (%8ball == 11) { .msg $chan 15 $+ If you are patient, Then yes. }
  if (%8ball == 12) { .msg $chan 4 $+ If you you are inpatient then no. }
  if (%8ball == 13) { .msg $chan 12 $+ I don't want to answer that right now. }
  if (%8ball == 14) { .msg $chan 14 $+ You don't want to know the answer to that >.>;... }
}

Comments

Sign in to comment.
guest598594   -  Sep 19, 2007

sorry for the two use $read...forgot to erase the bottom one :P

 Respond  
guest598594   -  Sep 19, 2007

why does everyone do if (%8ball == number) its such a waste of code...

on *:text:!8ball*:#:{
  var %8ball = No|Yes|Maybe|Try Later|Etc...
  msg $chan $gettok(%8ball,$r(1,$numtok(%8ball,124)),124)
}

i find a variable a lot easier than writing/readin a txt

x1gu10n3r: use $read(file.txt) to read a random line

just use $read(file.txt) to read random line

 Respond  
X1qu10n3r   -  Jan 08, 2007

just keep things simple...but i\'d rather use this...

on 1:text:!8ball:#: {
var %8ball $r(1,$lines(8ball.txt))
msg $chan The Magical 8ball says \" $+ $read(8ball.txt,%8ball) $+ \"
}
menu
{
.Add 8ball Message: var %a $?=\"8ball Message:\" | write 8ball.txt %a
}

but hell, i like yours too.

 Respond  
Naemuti   -  Jan 08, 2007

Vengeance, how the hell is that complicated? That\'s not only redundant and poor coding, it\'s also extremely simple.

shugo103
-_- Let it be the way it is. There is nothing wrong with it no?

Besides the fact that you\'re denying suggestions to make it better? There\'s tons wrong with it that I can see.

 Respond  
Vengeance   -  Jan 08, 2007

if you just want it complicated for fun use this

(yes its redundant and pretty pointless but its complicated :) )

on :text:!8ball :#: {
var %8ball $rand(1,5)
describe $chan dont take this stuff to seriously its just a thingermabob :)
if ((%8ball == 1 )) msg # The magic 8ball says \" $+ $read(8ball.txt,1) $+ \"
if ((%8ball == 2 )) msg # The magic 8ball says \" $+ $read(8ball.txt,2) $+ \"
if ((%8ball == 3 )) msg # The magic 8ball says \" $+ $read(8ball.txt,3) $+ \"
if ((%8ball == 4 )) msg # The magic 8ball says \" $+ $read(8ball.txt,4) $+ \"
if ((%8ball == 5 )) msg # The magic 8ball says \" $+ $read(8ball.txt,5) $+ \"
}

 Respond  
sean   -  Jul 04, 2006

wtf@Raichu. This type of snippet would be more proficient if it were reading from a .txt, this way u can just add the result to the end of a list, instead of expanding the $rand and making another if statement

 Respond  
CaRe_Taker   -  Jul 02, 2006

i wasnt puttin down his coding
i was just suggestings
it to Read From a .txt file

 Respond  
Raichu   -  Jul 02, 2006

this snipped needs mirc...

and a 8ball snippet is ment for fun.

Odd how people would want a .txt as a question file. He got his own style of scripting.

 Respond  
[-mafas-]   -  Jul 01, 2006

for what this script is needed? :S

 Respond  
shugo103   -  Jun 27, 2006

Cage, I did not know that snippet even existed O_O; I just made that 8ball for fun.

 Respond  
Cage   -  Jun 27, 2006

http://www.hawkee.com/snippet.php?snippet_id=1692

Odd how your script is very similar to the one above...

 Respond  
CaRe_Taker   -  Jun 25, 2006

With this Reading from a txt file there will be less code
an You could even have an add Feature like
if ($strip($$1) == !add) { /write 8ball.txt $2- }
Well s0me this like that any whooo :)

 Respond  
shugo103   -  Jun 25, 2006

-_- Let it be the way it is. There is nothing wrong with it no?

 Respond  
Emensity   -  Jun 25, 2006

There\'s no need for the \"$+\" identifier; you can take that out.

 Respond  
shugo103   -  Jun 25, 2006

Ya happy? :P

 Respond  
Pariah   -  Jun 25, 2006

The difference is /set is global, /var is local.
The %8ball variable will still exist after the script has finished with it, with /var it would be gone as soon as the script was done with it.

Either way though, the setting of a variable and checking if\'s, is uneccessary. You could simple place your responces in a text file and read a random line.

on *:text:@8ball:#:.msg # $read(responces.txt)

 Respond  
shugo103   -  Jun 25, 2006

Well, set works just as well as var in my opinion, It makes no differents for this snippet.

 Respond  
sean   -  Jun 25, 2006

instead of \"set\" use \"var\" this way your not setting a global variable that becomes useless. in addition: u don\'t need backslashes and you can just use \"#\" instead of \"$chan\"

 Respond  
shugo103   -  Jun 24, 2006

Yeah, It might be really simple but it works :P

 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.