Code: Select all
bind raw - notice shun-snotice
proc shun-snotice {from keyword arg} {
if {![string match -nocase "*shun added*" $arg]} { return }
set shun [lrange $arg 1 end]
putserv "privmsg #shuned :$shun"
}
bind pub o !shun pub:shun
proc pub:shun {nick host hand chan text} {
global botnick
if {[llength $text] < 1} { putserv "privmsg $channels $nick: Used !shun nick +tiempo razón"
return 0
}
set target [lindex $text 0]
set tiempo [lindex $text 1]
set reason [lrange $text 2 end]
if {($target != "")} {
putquick "shun $target $tiempo $reason"
} else {
putquick "shun $target :$tiempo $reason"
return 0
}
}
Code: Select all
if {($target != "")} {
putquick "shun $target $tiempo $reason"
} else {
if {($target == "")} {
putquick "shun $target :$tiempo $reason"
}
Code: Select all
if {($target != "")} {
putquick "shun $target $tiempo $reason"
} else {
putquick "shun $target :$tiempo $reason"
}
Code: Select all
bind raw - notice shun-snotice
proc shun-snotice {from keyword arg} {
if {![string match -nocase "*shun added*" $arg]} { return }
set shun [lrange $arg 1 end]
putserv "privmsg #shuned :$shun"
}
bind pub o !shun pub:shun
proc pub:shun {nick host hand chan text} {
set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
set text [split $text]
set target [lindex $text 0]
set tiempo [lindex $text 1]
set reason [lrange $text 2 end]
set items [split $text]
if {[llength $items] < 1} { putnow "NOTICE $nick :Syntax\: !shun nick" ; return }
if {$tiempo eq ""} { set tiempo "1h" }
if {$reason eq ""} { set reason "$tiempo shun for abuse/behaviour" }
if {![onchan $target $chan]} {
putnow "NOTICE $nick $target is not on $chan"
} else {
if {![isbotnick $target] && ![isbotnick $target] && ![isop $target $chan] && ![ishalfop $target $chan] && ![matchattr [nick2hand $target $chan] o|o $chan]} {
putquick "shun $target $tiempo $reason"
}
}
}
Code: Select all
bind raw - notice shun-snotice
proc shun-snotice {from keyword arg} {
if {![string match -nocase "*shun added*" $arg]} { return }
set shun [lrange $arg 1 end]
putserv "privmsg #shuned :$shun"
}
bind pub o !shun pub:shun
proc pub:shun {nick host hand chan text} {
set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
set text [split $text]
if {![llength $text]} { putnow "NOTICE $nick :Syntax\: !shun nick" ; return 0 }
set target [lindex $text 0]
if {![onchan $target $chan]} { putnow "NOTICE $nick :$target is not on $chan" ; return 0 }
if {[isbotnick $target] || [isop $target $chan] || [ishalfop $target $chan]} { return 0 }
if {[matchattr [nick2hand $target $chan] o|o $chan]} { return 0 }
set tiempo [lindex $text 1]
set reason [join [lrange $text 2 end]]
if {$tiempo ne "" && ![regexp -nocase {^[1-9][0-9]*[hdmy]$} $tiempo]} {
set reason [string trim "$tiempo $reason"]
set tiempo ""
}
if {$tiempo eq ""} { set tiempo "1h" }
if {$reason eq ""} { set reason "$tiempo shun for abuse/behaviour" }
putquick "shun $target $tiempo $reason"
return 0
}
wich resulted in :!shun Finn 10s
so the reason wasnt filled in only the targetnick and duration but still the default duration of 1 hour was used while we filled 10 seconds in and the default reason wasnt used since it wasnt filled in not sure why*** Shun added for *@184.178.172.25 on Sun Aug 7 00:08:38 2022 GMT (from &Falcon!F@127.0.0.1 to expire at Sun Aug 7 01:08:38 2022 GMT: 10s)
Adjust the regexp to cover what you see as all the choices...$tiempo is in the syntax of 12h 1d 1m 1y
Code: Select all
{^[1-9][0-9]*[hdmy]$}
Code: Select all
bind raw - notice shun-snotice
proc shun-snotice {from keyword arg} {
if {![string match -nocase "*shun added*" $arg]} { return }
set shun [lrange $arg 1 end]
putserv "privmsg #shuned :$shun"
}
bind pub o !shun pub:shun
proc pub:shun {nick host hand chan text} {
set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
set text [split $text]
if {![llength $text]} { putnow "NOTICE $nick :Syntax\: !shun nick" ; return 0 }
set target [lindex $text 0]
if {![onchan $target $chan]} { putnow "NOTICE $nick :$target is not on $chan" ; return 0 }
if {[isbotnick $target] || [isop $target $chan] || [ishalfop $target $chan]} { return 0 }
if {[matchattr [nick2hand $target $chan] o|o $chan]} { return 0 }
set tiempo [lindex $text 1]
set reason [join [lrange $text 2 end]]
if {$tiempo ne "" && ![regexp -nocase {^[1-9][0-9]*[dhms]$} $tiempo]} {
set reason [string trim "$tiempo $reason"]
set tiempo ""
}
if {$tiempo eq ""} { set tiempo "1h" }
if {$reason eq ""} { set reason "$tiempo shun for abuse/behaviour" }
putquick "shun $target $tiempo $reason"
return 0
}
Code: Select all
if {$tiempo ne "" && ![regexp -nocase {^[1-9][0-9]*[dhms]$} $tiempo]} {
Code: Select all
if {$tiempo ne "" && ![regexp -nocase {^[1-9][0-9]*[dhms]$} $tiempo] && $tiempo != 0} {
Code: Select all
bind raw - notice shun-snotice
proc shun-snotice {from keyword arg} {
if {![string match -nocase "*shun added*" $arg]} { return }
set shun [lrange $arg 1 end]
putserv "privmsg #shuned :$shun"
}
bind pub o !shun pub:shun
proc pub:shun {nick host hand chan text} {
set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
set text [split $text]
if {![llength $text]} { putnow "NOTICE $nick :Syntax\: !shun nick" ; return 0 }
set target [lindex $text 0]
if {![onchan $target $chan]} { putnow "NOTICE $nick :$target is not on $chan" ; return 0 }
if {[isbotnick $target] || [isop $target $chan] || [ishalfop $target $chan]} { return 0 }
if {[matchattr [nick2hand $target $chan] o|o $chan]} { return 0 }
set tiempo [lindex $text 1]
set reason [join [lrange $text 2 end]]
if {$tiempo ne "" && ![regexp -nocase {^[1-9][0-9]*[dhms]$} $tiempo] && $tiempo != 0} {
set reason [string trim "$tiempo $reason"]
set tiempo ""
}
if {$tiempo eq ""} { set tiempo "1h" }
if {$reason eq ""} { set reason "$tiempo shun for abuse/behaviour" }
putquick "shun $target $tiempo $reason"
return 0
}