chuck norris facts and other stuff :P
!chuck - random chuck quote
!chuck [number] - selected quote
*edit I cut the color down a lot
**edit massive overhaul
as stated before a socket would be better then a huge txt file
you could do something like this..
on $*:text:/^!chuck$/iS:#: {
if ($sock(chuck)) sockclose chuck
sockopen chuck www.ninjadude.com 80
sockmark chuck msg #
}
on *:sockopen:chuck: {
sockwrite -nt $sockname GET /chuck-norris-facts-generator.php HTTP/1.1
sockwrite -nt $sockname Host: $+(www.ninjadude.com,$str($crlf,2))
}
on *:sockread:chuck: {
var %chuck | sockread %chuck
if ($regex(%chuck,/<font.+>(.+)/)) {
$sock(chuck).mark $regml(1)
sockclose chuck
}
}
or if you want to use 4q.cc web site for the chuck facts
on $*:text:/^@chuck$/iS:#: {
if ($sock(cu)) sockclose cu
sockopen cu 4q.cc 80
sockmark cu msg #
}
on *:sockopen:cu: {
sockwrite -nt $sockname GET /index.php?pid=fact&person=chuck HTTP/1.1
sockwrite -nt $sockname Host: $+(4q.cc,$str($crlf,2))
}
on *:sockread:cu: {
var %cu | sockread %cu
if ($regex(%cu,/\t{3}(\w.+)<\/div>/)) {
$sock(cu).mark $replace($regml(1),",')
sockclose cu
}
}
make sure it works dude cuz i couldnt get it to work either.i type !chuck and nuthin happens.i put the facts in a .txt file named jokes.txt in my Mirc folder and put on :text:!chuck:#:{ .msg $chan $iif(($2 isnum 1- $+ $lines(Jokes.txt)),$read(Jokes.txt,$2),$read(Jokes.txt)) } }
in my bots script editor and i typed typed !chuck and nuthin happened this script fails miserably.try workin on it some more.
1) Download mIRC
2) Go to remotes (Alt+R)
3) Paste on :text:!chuck:#:{ .msg $chan $iif(($2 isnum 1- $+ $lines(Jokes.txt)),$read(Jokes.txt,$2),$read(Jokes.txt)) } } into the space
4) Close remotes and type /write jokes.txt | run jokes.txt
5) Paste all the chuck norris stuff in it and save
Aaron, you could just do $iif($read(jokes.txt,$2),$v1,$read(jokes.txt))
Would be better with a socket script connecting to chucknorrisfacts.com or better yet http://4q.cc/index.php?pid=fact&person=chuck (<--- Random CN fact)
works 100% thank you