chuck norris fact snippet

By Aaron on Jan 13, 2007

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

Comments

Sign in to comment.
napa182   -  Jul 22, 2010

heh

 Respond  
SnoooP   -  Jul 22, 2010

I was waiting for you napa haha :P

 Respond  
napa182   -  Jul 22, 2010

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),&quot;,')
    sockclose cu
  }
}
 Respond  
FordLawnmower   -  Jul 22, 2010

This is a very old post thez, but you would actually just need $read(chuck.txt)

 Respond  
thez   -  Jul 22, 2010

on *:text:!chuck:#:{
set %chuck $rand(1,599)
msg $chan " $+ $read(chuck.txt,%chuck) $+ "
}

Save all those facts into chuck.txt

 Respond  
Dragon1-9-8-4   -  Dec 01, 2008

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.

 Respond  
Anti   -  Jul 09, 2008

Hah okay here i am rusty me.

 Respond  
guest598594   -  Jul 09, 2008

$iif is kind of like an if and else combined

$iif(if statement,if true do this,if false do this)

//echo -a $iif(MountainDew == Anti,yes,no) --> no
//echo -a $iif(3 isnum 1-9,yup,no) --> yup

 Respond  
Anti   -  Jul 09, 2008

Oh wow talk about flood issues why not turn it into a notice kinda thing... its nice but whats up with the IFF wtf is that? isnt it if....

 Respond  
guest598594   -  Jul 09, 2008

If some else types !chuck. On Text events are for other people, not yourself. If you would like you use it yourself, you would need to turn it into an alias or an on text event.

 Respond  
Spamsci   -  Jul 09, 2008

Well, if I follow all those steps, does that mean that any IRC channel I open will read my a fact if I type !chuck???

 Respond  
guest598594   -  Jul 08, 2008

What do you mean \"upload\"?

 Respond  
Spamsci   -  Jul 08, 2008

Thanks for the fast replies.

I\'m an op on the channel i want to upload it to, is that enough? Or do i need to be admin?

 Respond  
guest598594   -  Jul 08, 2008
on *:text:!chuck*:#:{ 
  msg $chan $iif(($2 isnum 1- $+ $lines(Jokes.txt)),$read(Jokes.txt,$2),$read(Jokes.txt))
}
Vegitha  -  Dec 17, 2019

works 100% thank you

Sign in to comment

Spamsci   -  Jul 08, 2008

It doesn\'t seem to be working...

Theres a bracket mismatch apparently.

 Respond  
guest598594   -  Jul 08, 2008

Oh, well if the facts are already in the txt, then you\'re all set. Make sure you have this is your remotes though:

on *:text:!chuck*:#:{ .msg $chan $iif(($2 isnum 1- $+ $lines(Jokes.txt)),$read(Jokes.txt,$2),$read(Jokes.txt)) } }

And just have someone type !chuck

 Respond  
Spamsci   -  Jul 08, 2008

Sorry, but I got lost after step 4.

Where do I type \"/write jokes.txt | run jokes.txt\"???

And where do I paste the facts?

I\'ve got all the facts saved as jokes.txt in the mIRC folder, and added the remote.

I\'m an op in this server, is that enough to upload the script?

 Respond  
BlueThen   -  Jul 08, 2008

Waow. That\'s a lot of facts. I had my own little file, but I only saved ones that I thought were funny. :/

 Respond  
guest598594   -  Jul 08, 2008

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))

 Respond  
Spamsci   -  Jul 08, 2008

I\'m a bit new to this, so I need a little help.

I\'ve saved it how you said where you said, but how do i upload it to my IRC channel?

 Respond  
PowerDragon   -  Jan 28, 2007

i gave it a 10/10

 Respond  
PowerDragon   -  Jan 28, 2007

Hey I love it.
Can you do me a favor and make it so that theres only 1 file for this? Using the rand thing.

 Respond  
Aaron   -  Jan 28, 2007

did you put it in your mirc file?

 Respond  
Death_first   -  Jan 28, 2007

cant get jokes.txt to work

:((

 Respond  
Aaron   -  Jan 20, 2007

BIG update, put in a text read

hope you liek the 700+ quotes :P

 Respond  
Aaron   -  Jan 14, 2007

ill just leave this as is for right now, ill update it later

 Respond  
Acid-Religion   -  Jan 14, 2007

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)

 Respond  
Noutrious   -  Jan 14, 2007

This could be 1 line script using $read(chuck.txt) function.

 Respond  
Aaron   -  Jan 13, 2007

upgraded it a little, read edit

 Respond  
RoninWarrior   -  Jan 13, 2007

Be carefull with the chuck norris snippets folks you will end up with a CNRHK to the head!!!!!!

 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.