# Tame the WHOWAS history! -- A complete WHOIS reply suite # Original concept: Mycroft (mycroft@ai.mit.edu) # Written by hop (jnelson@iastate.edu) # # Unlike the original, this one will show you the first whowas # reply that comes each time a whowas occurs, and munches the rest. # This is how i like it. Also, it is much more simply constructed, # since it only tracks the current whowas. The original seemed to be # overkill at times, and didnt cope with whowas away messages # # The alias /show_whowas toggles the functionality of # this script on or off. # # If you arent using 2.3.16+9, you will have to uncomment # the lines as instructed below. alias delete { fe ($*) dx { ^assign -$dx } } ## nasty recursive alias for non-plus clients. #alias delete { # if ([$1]) {delete $1-} # assign -$0 #} alias purge { foreach $0 i {purge $0.$i} delete i $0 } alias show_whowas { @ showall_whowas = 1 - showall_whowas echo *** Showing ${showall_whowas?ALL:ONE} whowas ## use these lines instead of the above one for non-plus clients. # if (showall_whowas) # {echo *** Showing ALL whowas} # {echo *** Showing ONE whowas} } alias howlong @ function_return = tdiff(${time()-[$0]}) # Ok. A whowas has started on #^401 -10 * @ in_a_whowas = 1 # This comes first on ^314 * { if (!whowas.already_got_one || showall_whowas) { @ whowas.already_got_one = 1 echo WHOWAS $1 was $2@$3 \($5-\) } } # This comes second on ^312 * { if (in_a_whowas) { if (!whowas.already_got_two || showall_whowas) { @ whowas.already_got_two = 1 echo WHOWAS on $1 \(Signoff: $2-\) } } {echo WHOIS on $1} } # This comes third on ^301 * if (!in_a_whowas) {echo AWAY  $0 is away: $1-} # This comes last on ^369 * { purge whowas delete in_a_whowas echo END OF LIST } # Other whois stuff on ^311 * echo WHOIS $1 is $2@$3, \($5-\) on ^313 * echo WHOIS $1- on ^317 * echo WHOIS $1: Idle - \($tdiff($2)\), On for $howlong($3) on ^318 * echo END OF LIST on ^319 * echo WHOIS is on channels $1- on ^401 * echo WHOIS $1 is not on IRC on ^406 * echo WHOWAS $1 has not been on recently