All pastes #607271 Raw Edit

tb

public text v1 · immutable
·published 2007-07-07 14:04 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($2) $chan $3 %var.time $4-
}
alias calctime {
  if ($2 == -s) set %var.time %time seconds
  if ($2 == -m) set %var.time %time Minutes
  if ($2 == -h) set %var.time %time hours
}