Skip to content

Instantly share code, notes, and snippets.

@jsaak
Created February 1, 2016 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsaak/471358eac6446ab445d3 to your computer and use it in GitHub Desktop.
Save jsaak/471358eac6446ab445d3 to your computer and use it in GitHub Desktop.
cgi-irc kennylizer
cgi-irc kennylizer
This code converts sentences: the output is like that: "*ll* *ulm* *mmmmmlu* *lmu* *lu* *mmffmm*"
it is unfinished, but usable
How to install: modify nph-irc.cgi (located at /usr/lib/cgi-bin/cgiirc/ on debian systems)
To turn it on: create a file named "kenny" at /etc/cgiirc/ (echo flmufml>/etc/cgiirc/kenny)
To turn it off: remove the file (rm /etc/cgiirc/kenny)
You should extend this code to distinguish users
$ip contains the user's ip
there is pretty good code in nph-irc.cgi to do this, just have a look at it
...
message('command error', $error);
}
return 0;
}
}else{
# kennylizer start
if (-e "/etc/cgiirc/kenny") {
my @ka = ("l", "m", "u", "f", "m" );
my @wl = split(/ +/,$say);
my $say2 = "";
my $sw = "semmi";
my $i = 1;
foreach $sw (@wl) {
$say2 = $say2."*";
for($i = 0; $i < length $sw; $i++) {
$say2 = $say2.$ka[rand @ka];
}
$say2 = $say2."* ";
}
my $ip = $ENV{REMOTE_ADDR};
irc_send_message($target, $say2);
} else {
irc_send_message($target, $say);
}
}
}
# kennylizer end
#### Access Checking Functions
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment