All pastes #607277 Raw Edit

tb

public text v1 · immutable
·published 2007-07-07 14:09 UTC
rendered paste body
On $*:text:/^[!@]T(ime)?b(an)?/Si:#: {
  if (!$4) .notice $nick Correct syntax: !Tb [-smh]Time Nick Reason
  elseif ($nick !isop $chan) && ($nick !ishop $chan) .notice $nick You are not an operator!
  elseif ($3 isop $chan) || ($3 ishop $chan) .notice $nick You cannot tempban your superiors!
  elseif (!$time($2)) .notice $nick Please use the following switches: -s (seconds) -m (minutes) -h (hours)
  else set %type $2 | set %time $3 | ban -ku $+ $calctime($3) $4 $chan Banned for %var.time Reason: $5-
}
alias calctime {
if (%type == -s) return %time
elseif (%type == -m) return $calc(%time *60)
elseif (%type == -h) return $calc(%time *3600)
elseif (%type == -s) set %var.time %time Second(s)
elseif (%type == -m) set %var.time %time Minute(s)
elseif (%type == -h) set %var.time %time hour(s)
}