its a basic !8ball script
all you have to do is type !8ball and it works.
stupid and simple but eh its something.
and my second script so... enjoy :D
on *:TEXT:!8ball*:#:{
/set %an $rand(1,8)
if (%an == 1) /msg $chan Yes, $nick
if (%an == 2) /msg $chan No, $nick
if (%an == 3) /msg $chan Quite possibly, $nick
if (%an == 4) /msg $chan Without a doubt, $nick
if (%an == 5) /msg $chan Absolutely not, $nick
if (%an == 6) /msg $chan Please ask again, $nick - I can't tell right now
if (%an == 7) /msg $chan Certainly, $nick
if (%an == 8) /msg $chan Impossible, $nick
}
you can do a different take by making it into a socket script. to use it you ask in the form of a question.
<~napa182> 8ball will i ever find my car keys?
<~Sick0> [The magic 8ball says:] Outlook good.
on $*:text:/^(8ball\s(.+)\?)$/S:#:{
if (!%ball8flood) {
set -u3 %ball8flood $nick
if ($sock(8ball)) .sockclose 8ball
sockopen 8ball pages.cs.wisc.edu 80
sockmark 8ball # 14[04The magic 8ball says:14]
}
}
on *:sockopen:8ball: {
sockwrite -nt $sockname GET /~craft/8ball.cgi HTTP/1.1
sockwrite -nt $sockname Host: $+(pages.cs.wisc.edu,$str($crlf,2))
}
on *:sockread:8ball: {
var %8ball | sockread %8ball
if ($regex(%8ball,/<h4>(.+)<\/h4>/)) { msg $sock(8ball).mark $regml(1) | sockclose 8ball }
}
just a different take
briggy, this is the same philosophy of why we all look different in appearance. Oval, square and triangle faces; blond, brown, brunette and red hairs, as well as the eye and skin colors. As human beings, we all like things differently...and we can't make every one of us to fancy the same thing, can we?
why not use $read?
on :text:!8ball:#: { if ($2 == $null) msg $chan Specify a question!
else msg $chan $read 8ball.txt }
after that just put a file in your irc directory called 8ball.txt
every answer is separed by a new line.
Here some answers i got:
My answer is: cake.
rawr.
Yes.
No.
Maybe.
I think so.
Are you serious?
Are you kidding?
I thought that too.
Damn you're totally right!
Unfortunately, my answer is no.
Hell Yeah!
No way!
F U PAL
-hope that helped ;)
Global variables require a harddrive write/read
local variables are held in ram. Also, by avoiding
set variables as much as possible you 'future proof'
your scripts come the day you wish to run it off a
solid state harddrive or flash memory device. I try
to only use a set global variable if I need to retain
the data across sessions and make it available to all
scripts and connections. Another nice thing about using
local variables is less likely to have variable name
collisions. They only work within that one alias, event,
or menu item. Makes it easy to use single letter variable
names.