#!/usr/bin/perl # # Coded by spielkind@ircnet $nick=$ARGV[0]; # set here the userfile of the bot $userfile="/home/johoho/eggdrop/lamestbot.user"; $habuser=0; $brauchnoch=1; $habseen=0; open USER, "$userfile" or &fehler; while(($zeile=)&&($brauchnoch)) { if ($zeile=~/^$nick/i) { $habuser=1; next; } if (($habuser)&&($zeile=~/^--LASTON\s*(\d*)/)) { $habseen=$1; $brauchnoch=0; next; } if (($habuser)&&(!(($zeile=~/^!/)||($zeile=~/^-/)))) { $habuser=0; } }; close USER; if ($habseen!=0) { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=gmtime($habseen); $laston=gmtime($habseen); print "Content-type: text/html\n\n"; # print "$laston\n"; $mon++; $year+=1900; $min="0".$min if ($min<10); print "$mday.$mon.$year, $hour:$min"; } else { &unbekannt; } exit; sub unbekannt() { print "Content-type: text/html\n\n"; print "$nick? don't know...\n"; exit; } sub fehler() { print "Content-type: text/html\n\n"; print "uhm, can't find or read datafile\n"; exit; }