rendered paste body ;Alias Syntax- /tb nick time (in seconds)
;Remote Trigger Syntax- [!@.]tb nick time (in seconds)
menu channel {
TB:dialog -ma tbd tbd
}
menu nicklist {
TB
.1 Minute:/ban -ku60 $chan $1 4 TempBan- 1 Minute
.5 Minutes:/ban -ku300 $chan $1 4 TempBan- 5 Minutes
.10 Minutes:/ban -ku600 $chan $1 4 TempBan- 10 Minutes
.Custom:dialog -me tbd tbd
}
dialog tbd {
title \"Temp Ban\"
size -1 -1 120 78
option dbu
list 1, 2 9 50 50, size
text , 2, 2 1 50 8
combo 3, 58 20 58 10, drop
edit \"\", 4, 86 40 30 10
text \"Choose a time...\", 5, 76 11 40 8
text \"Or enter one in seconds\", 6, 58 32 58 8
button \"Cancel\", 9, 23 63 37 12, cancel
button \"Ban\", 10, 64 63 37 12
}
on *:DIALOG:tbd:init:*:{
did -a tbd 2 $active
did -a tbd 3 1 Minute : 60
did -a tbd 3 2 Minutes : 120
did -a tbd 3 5 Minutes : 300
did -a tbd 3 10 Minutes : 600
did -a tbd 3 30 Minutes : 1800
var %i = 0
while (%i < $nick($active,0)) {
inc %i 1
did -a tbd 1 $nick($active,%i)
}
}
on *:DIALOG:tbd:sclick:3:{
did -r tbd 4
}
on *:DIALOG:tbd:sclick:10:{
if ($did($dname,1).seltext == $null) { .echo -q $input(No user specified,o) | halt }
else { if ($did($dname,3).seltext == $null) && (($did($dname,4).text == $null) || ($did($dname,4).text !isnum 1-)) {
var %time = 60
}
elseif ($did($dname,4).text != $null) {
var %time = $did($dname,4).text
}
elseif ($did($dname,3).seltext != $null) {
var %time = $gettok($did($dname,3).seltext,2,58)
}
}
/ban -ku $+ $remove(%time,$chr(32)) $active $did($dname,1).seltext 4 TempBan- $calc( %time / 60) Minutes
.timer 1 %time .notice $did($dname,1).seltext You have been unbanned form $active
dialog -x tbd
}
on $*:TEXT:/^[!@.]tb */si:#:{
if ($address($nick,4) == $address($me,4)) {
if (!$3) { halt }
if ($3 isnum 1-) {
tb1 $2 $3 $chan
}
else {
tb1 $2 60 $chan
}
}
}
alias tb1 {
if (!$2) { halt }
/ban -ku $+ $2 $3 $1 4 TempBan- $calc( $2 / 60) Minutes
.timer 1 $2 .notice $1 You have been unbanned from $3
}
alias tb {
if (!$2) { halt }
/ban -ku $+ $2 $chan $1 4 TempBan- $calc( $2 / 60) Minutes
.timer 1 $2 .notice $1 You have been unbanned from $chan
}