This script will send a boring, random message to the active channel when the irc server pings you. (You must have your client looking at the active channel window) It's useful when your nickname idles in a quiet channel, where activity is scarce and that you're away from keyboard every so often.
Below are some random ones emitted when you get pinged by the server:
I'm in Illinois hello hello! Is there evrybody some there see ya Hola desde España Holy Sh*t!! I feel like such a spy...if your really live...grab your head.. Are you workin' hard or hardly workin'? CATS MEOW MEOW MEOW**Usage:** right-click on your nick list or channel to toggle the script on and off.
menu nicklist,channel {
Turn Random Messages
.On:enable #rm
.Off:disable #rm
}
#rm on
on *:sockread:rm:{
var %rm
sockread %rm
if ($regex(%rm,/<h1>(.*)<\/h1>/)) {
[ [ $sock(rm).mark ] ]
sockclose rm
}
}
on *:ping:{
if ($sock(rm)) sockclose $v1
sockopen rm www.randommessages.com 80
var %m = 1
while ($comchan($me,%m)) {
if ($v1 == $iif($active ischan,$v1)) {
sockmark rm msg $v1 $!regml(1)
}
inc %m
}
}
on *:sockopen:rm:{
tokenize 94 $left($str(sockwrite -nt rm^,2),-1)
var %- 1, %` GET / HTTP/1.1^Host: $!+($sock(rm).addr,$str($crlf,2))
while $gettok(%`,%-,94) {
[ [ $+($,%-,$chr(32),$v1) ] ]
inc %-
}
}
#rm end
I get a Internal Server Error
:/
Do you know what's wrong @Jethro ?
also : seems nice : if you can fix it, i'll give it a like ;)
My mistake. I forgot to edit the variables. Here is it:
on me:*:part:#:{
if (%random) {
$+(.timer,$network) off
set -e %randommsg 1
}
}
on *:quit:{
if ($nick == $me) && (%random) {
$+(.timer,$network) off
set -e %randommsg 1
}
}
on *:disconnect:{
if (%random) $+(.timer,$network) off
set -e %randommsg 1
}
on me:*:join:#:{
if (%randommsg) {
notice $me Random Message has been toggled off. $&
Right-click on the nicklist or channel to toggle it on.
unset %random*
}
}
on *:kick:#:{
if ($knick == $me) && (%random) $+(.timer,$network) off
set -e %randommsg 1
}
on *:sockread:rm:{
var %rm
sockread %rm
if ($regex(%rm,/<h1>(.*)<\/h1>/)) {
[ [ $sock(rm).mark ] ]
sockclose rm
}
}
alias -l randommsg {
if ($sock(rm)) sockclose $v1
sockopen rm www.randommessages.com 80
sockmark rm amsg $!regml(1)
}
on *:sockopen:rm:{
tokenize 94 $left($str(sockwrite -nt rm^,2),-1)
var %- 1, %` GET / HTTP/1.1^Host: $!+($sock(rm).addr,$str($crlf,2))
while $gettok(%`,%-,94) {
[ [ $+($,%-,$chr(32),$v1) ] ]
inc %-
}
}
menu channel,nicklist {
Random Message
.ON {
if (!%random) {
set -e %random $$?"Input the trigger time in seconds:"
$+(.timer,$network) 0 %random randommsg
echo 2 # * Time Interval in Seconds: $+($chr(2),%random)
if (%randommsg) unset $v1
}
else echo 4 # * Random Message is Already Switched On!
}
.OFF {
if (%random) {
$+(.timer,$network) off
echo 2 * Random Message Has Been Turned Off!
unset %random*
}
else echo 4 # * Random Message is Already Switched Off!
}
}
ehm Jethro, is it possible to make it talk randomly in a channel but with a controllable timer instead of the server pings, im not reuqesting a dialog though, i just want to know how to control the timer in the script, like saying a random message in a random channel every 10 minutes ( without the server pings ) + controllable.
Well, Mukey, if you want to speed the snippet and make the bot talk constantly, it has to be modified using a timer (a preset delay of time for the trigger) or a text event to activate it. (By text event, it triggers when someone talks) But be warned that you may be labeled as annoying on account of random, gibberish drivel this snippet produces. The main idea of it is to make you "stand out" as being there, not as a lifeless idler in a channel during the downtime when you're not active and participating.
If you still insist on your wish, Mukey, let me know, and I'll make the personal adjustment for you.
alabama, it doesn't talk constantly, but it talks when the server pings you, depending how often your server send you a ping. It's rather useful if you will, especially when you're away from your PC, you have nothing to say, and you want to appear that you're alive and kicking. :P People who don't know will think you're there speaking. It's especially useful when you're on a channel where the ops kick for idlers. This sort of acts like an auto-bot talker. You can turn it off when you're back on your PC via nicklist and channel popup.
You could easily host your own on your own website change Line 17 to your own website and change Line 28's "GET /" to the location of a PHP script e.g. "GET /random/index.php" and have a simple PHP Script that spits out random Scentences. I could possibly post one on here.