Created
February 1, 2016 09:07
-
-
Save jsaak/471358eac6446ab445d3 to your computer and use it in GitHub Desktop.
cgi-irc kennylizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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