This code is created to add ignores to hosts (masks ) of nicks (NOT BAN).simo wrote:greetingz , i was searching for public ban command script couldnt really find any most only ban nick and not host , i was wondering if someone would have one already made
Code: Select all
#Sintax: !ignore [nick | mask] <time in min> <reason>
proc pub:cmdignore {nick uhost handle chan text} {
if {$text == ""} {return 0}
if {[regexp -nocase -- {^[-_./\\]+?([a-z0-9]+)[-_./\\]+$} [lindex [split $text] 0] a b]} {
set target *$b*!*@*
} else {
set target [join [lindex [split $text] 0]]
}
set b $target
set largo [string length $text]
set time [join [lindex [split $text] 1]]
set reason [join [lrange [split $text] 2 [expr { "$largo" - 1}]]]
if {![string match "*\[0-9\]*" $time]} {set it 15} else { set it "$time"}
set host [lindex [split [getchanhost $target $chan] @] 1]
set idents [lindex [split [getchanhost $target $chan] @] 0]
if {$reason == ""} {set ir "Solicitado por $nick en [join [ctime [unixtime]]]."} else { set ir "$reason Puesto por $nick en [join [ctime [unixtime]]]."}
if {![string match *!*@* $target] && ![onchan $target]} {
putserv "PRIVMSG $chan :$target NO se encuentra en el canal!."
return 0
}
if {[onchan $target]} {set im "*!*@[join [lrange [split $host .] 0 end] .]"} else {set im "$target"}
if {[onchan $target]} {set ident1 "*![join $idents]@*" }
if {"$idents" == "ircap"} {set ident1 "*![join $idents]@[join $host]"}
newignore $im $handle "$ir" $it
newignore $ident1 $handle "$ir" $it
if {("$it" == 0) && ($reason != "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por siempre, $reason."; return 1 }
if {("$it" == 0) && ($reason == "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por siempre."; return 1 }
if {("$it" == 1) && ($reason != "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por $it minuto, $reason."; return 1}
if {("$it" == 1) && ($reason == "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por $it minuto."; return 1}
if {("$it" != 0) && ($reason == "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por $it minutos, $reason."; return 1
} else { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por $it minutos; $reason."
return 1
}
}
like this:newignore $im $handle "$ir" $it
newignore $ident1 $handle "$ir" $it
Code: Select all
putserv "mode #chan +b $im $handle $ir $it"
putserv "mode #chan +b $ident1 $handle $ir $it"
The default time is 15 minutesif {"$idents" == "ircap"} {set ident1 "*![join $idents]@[join $host]"}
if {![string match "*\[0-9\]*" $time]} {set it 15} else { set it "$time"}
wow.. Thanks, bero93. I hadn't even noticed, everything I added to github has been edited for github, the code I use all binds back to the same trigger so I appreciate you letting me know so I can fix the code. Github needs a bug push notification or something.bero93 wrote:there is a error on line 45 of your ban scriptGet_A_Fix wrote:If you need to, you can check out some of my releases. There is a public ban script, an ignore script and many other's.
see github