# this is all you need to configure $file = "/usr/games/fortune"; # %n can be used for their direct name (with spaces). # %q can be used for their name without spaces. # %l can be used for their lowercase name. # %U can be used for their uppercase name. # %o can be used for the "common name". This is lowercase without spaces. # thats it # plugin name $pgm = "eski fortune replier"; # program version $ver = "1.0"; $ar = 0; GAIM::register($pgm, $ver, "goodbye", ""); GAIM::add_event_handler("event_im_recv","im_recv"); GAIM::add_event_handler("event_im_send", "needsetup"); GAIM::print("The fortune replier has been loaded.", "$pgm $ver plugin loaded."); sub needsetup { my ($x,$u,$m) = @_; if ($m =~ '\!fortunereply on') { $ar = 1; GAIM::print("On","Fortune Auto-Reply is turned on"); return 1; } elsif ($m =~ '\!fortunereply off') { $ar = 0; GAIM::print("Off","Fortune Auto-Reply is turned off"); return 1; } } sub im_recv { ($x,$u,$m) = @_; if ($ar == 1) { system("$file > ./fortune"); open(BOB,"./fortune"); @BOB = ; close(BOB); $m = join('',@BOB); #sleep 5; GAIM::print_to_conv($x, $u, $m); } } sub goodbye { GAIM::print("The replier has been unloaded.", "$pgm $ver plugin unloaded."); }