Posted by Jeff W on Wed 12 Nov 06:15 (modification of post by view diff)
report abuse | download | new post
- #!/usr/bin/perl
- use warnings;
- use strict;
- # Just edit which channels you want it to work on and which ones not to.
- # Read the script is recommended, edit or add phrases to random strings if
- # you want. I dont really care. Its a useless script anyways :p -- Jeff W. aka vizsla or towlie
- my $script = "\cC13ASL";
- my $version = "2.0";
- my $desc = "ASL responder";
- Xchat::register($script,$version,$desc, \&unload);
- #text events to do callbacks on and what messages to look for
- my $hook = Xchat::hook_print("Channel Message", \&asl_sub);
- # list of phrases to be later randomized :D
- my @tooyoung;
- my @teens;
- my @twenties;
- my @fifties;
- # counts when something is like an asl is captured
- my $counter;
- # Evaluates Text Event "Channel Message".
- sub asl_sub {
- #current room name
- my $channel = Xchat::get_info("channel");
- #If a channel is either #help or #trivia, then it wont go any further.
- if ($channel =~ /^#(?:help|trivia)$/i) {
- return Xchat::EAT_NONE;
- }
- #then gets text from desired rooms
- my $text = $_[0][1];
- Xchat::strip_code($text);
- my $nick = $_[0][0];
- Xchat::strip_code($nick);
- # asl regex, 129 is highest age, 2 digits, or 1 digit then any spaces or / or - or , sex mfmalefemale, and atleast 15 letters
- # not sure, I just wrote it this way for boredom... I forgot already what half of it means xD
- #regex callbacks assigning
- my $age = $1;
- my $sex = $2;
- if ( $age < 13 && $channel !~ /^#lobby/i ) {
- my $said = &randomtooyoung(); #reference to sub
- Xchat::command("timer .4 msg $channel $nick $said");
- &hook_timer(10000);
- }
- elsif ( $age > 12 && $age < 20 ) {
- my $said = &randomteen();
- Xchat::command("timer .4 msg $channel $nick you are $age $said");
- &hook_timer(10000);
- }
- elsif ( $age > 19 && $age < 30 && $sex =~/^f/i ) {
- my $said = &randomtwenty();
- Xchat::command("timer .4 msg $channel $nick omg $age $said");
- &hook_timer(10000);
- }
- elsif ( $age > 29 && $age < 40 ) {
- Xchat::command("timer .4 msg $channel $nick you are $age years old :o");
- &hook_timer(10000);
- }
- elsif ( $age > 39 && $age < 50 ) {
- Xchat::command("timer .4 msg $channel $nick NO! dont have your midlife crisis :P , $age isn't that old, maybe.");
- &hook_timer(10000);
- }
- elsif ( $age > 49 && $age < 65 ) {
- my $said = &randomfifty();
- Xchat::command("timer .4 msg $channel $nick whoa your are $age years old o: $said");
- &hook_timer(10000);
- }
- elsif ($age > 64 && $age < 100 && $sex =~ /^f/i ) {
- Xchat::command("timer .4 msg $channel $nick you are officially old dont forget your medication grandma");
- &hook_timer(10000);
- }
- elsif ( $age > 64 && $age < 100 && $sex =~ /^m/i ) {
- Xchat::command("timer .4 msg $channel $nick you are officially old dont forget your medication grandpa");
- &hook_timer(10000);
- }
- elsif ( $age > 99 ) {
- Xchat::command("timer .4 msg $channel $nick LIES! your not $age years old pfft");
- &hook_timer(10000);
- }
- }
- # These will only work in the room specified below #teen-chat or #lizard
- elsif ( $channel =~ /^#(?:teen\-chat|lizard)$/i ) {
- # I dont know if it works, it looks for CAPS
- if ( $text =~ /(?:[A-Z]{10,14}|[A-Z]{2,} [A-Z]{8,15})/ ) {
- Xchat::command("timer .4 bs say $channel \cB$nick\cO: Easy on the caps please...");
- &hook_timer(4000);
- }
- # If a noobs says "pm me" or something overly used...
- elsif ( $text =~ /\bpm (?:me|you|u)\b/i ) {
- Xchat::command("timer .4 bs say $channel $nick no we do not want to pm you :|");
- &hook_timer(10000);
- }
- Xchat::command("timer .3 msg $channel Baby Don't Hurt Me, Don't Hurt Me, No More...");
- &hook_timer(5000);
- }
- Xchat::command("cs kick $channel $nick Requested.");
- &hook_timer(10000);
- }
- }
- return Xchat::EAT_NONE;
- }
- # routine to make a timer to help stop of abuse of script
- sub hook_timer {
- $counter++;
- Xchat::unhook($hook);
- Xchat::hook_timer($milliseconds,
- sub {
- $hook = Xchat::hook_print("Channel Message", \&asl_sub);
- return Xchat::REMOVE;
- }
- );
- if ($counter > 10 ) {
- Xchat::command("unload asl.pl");
- }
- }
- # these subs pick a random scalar of a global array ( lines 18-29)
- sub randomteen {
- @teens = ( "omg hawt", "get away emo n00b", "teenagers pfft >.> ...", "don't go emo on me D: \\wrists",
- "go be a kid D:", "kids these days... >.<", "your my new pet", "meow", "www.freejavachat.com" );
- }
- sub randomtwenty {
- @twenties = ( "go to college", "go party", "you're in the prime of your life", "hawt", "will you mary me?",
- "why give your asl?", "get a job!" );
- }
- sub randomfifty {
- @fifties = ( "don't forget your colonoscopy! ;o", "are you my dad?", "adopt me", "I see a bald spot",
- "just about over the hill :P" );
- }
- sub randomtooyoung {
- @tooyoung = ( "goo goo gaga", "its recess! go outside and play and come back when you're of age",
- "pedobear wants you", "you are too young for here", "I'm telling your mom!",
- "hellokitty.com is better for you", "I like barbies too", "nap time, you're too young" );
- }
- # prints when script is unloaded :O
- sub unload {
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.