#!/usr/bin/perl package Tortures; use cybot; @objects = load_list("data/objects"); @organs = load_list("data/organs"); @fluids = load_list("data/fluids"); @tortures = load_list("data/tortures"); register_command("comfort",sub { my ($bot,$chan,$nick,$host, $victim,@commands) = @_; my @cs = load_list("data/conforts"); my $action = $cs[rand(@cs)]; $action =~ s//$victim/g; $bot->action($chan, $action); }, "Comforts you!"); register_command("torture",sub { my ($bot,$chan,$nick,$host, @commands) = @_; if($commands[0] eq "reload"){ @objects = load_list("data/objects"); @organs = load_list("data/organs"); @fluids = load_list("data/fluids"); @tortures = load_list("data/tortures"); $bot->message ($chan, $#tortures+1 . " tortures loaded."); } else { my $victim = $commands[0]; $victim = $nick if $victim eq "me"; my $i = random($#objects); $randomobject = $objects[$i]; my $i = random($#organs); $randomorgan = $organs[$i]; my $i = random($#fluids); $randomfluid = $fluids[$i]; $x = random($#tortures); $torture = $tortures[$x]; $torture =~ s//$victim/; $torture =~ s//$chan/; $torture =~ s//$randomobject/; $torture =~ s//$randomorgan/; $torture =~ s//$randomfluid/; @torturefoo = split("\\\\n", $torture); for (0..$#torturefoo){ if ($torturefoo[$_] =~ /^me (.*)/){ $bot->action($chan, $1); } else { $bot->message($chan, $torturefoo[$_]); } } } }); 1;