All pastes #19488 Raw Edit

Something

public text v1 · immutable
#19488 ·published 2005-08-07 10:19 UTC
rendered paste body
proc dcc:human {handle idx arg} {
 global channel
 if {$arg == ""} {
  putdcc $idx "usage: .human <nick>"
  return
 }
 set newhost [getchanhost $arg $channel]
 if { $newhost != "" } {
  set temphost [split [lindex [split $newhost @] 1] .]
  if {[testip [lindex [split $newhost @] 1]]} {
   set newhost *!*[lindex [split $newhost @] 0]@[join [lrange $temphost 0 end-1] .].*
  } else {
   if {[llength $temphost] == 3} {
    set newhost *!*[lindex [split $newhost @] 0]@*.[join [lrange $temphost end-1 end] .]
   } elseif {[llength $temphost] > 3} {
    set newhost *!*[lindex [split $newhost @] 0]@*.[join [lrange $temphost end-2 end] .]
   } else {
    set newhost *!*$newhost
   }
  }
  setuser human HOSTS $newhost
  putidx $idx "$arg added to human list"
 } else {
  putidx $idx "$arg is not in $channel"
 }
}