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 >.>;... }
}
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
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.
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) $+ \"
}
http://www.hawkee.com/snippet.php?snippet_id=1692
Odd how your script is very similar to the one above...
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)