1.) the lines where it says:dani wrote:work fine!!! but i need a simple functions.. and i dont know how..
1. only ops use this command
2. ignore permanent, with out $time (third possibility)
3. can ignore a nick for a part? ex. amigo_***
where * is anything.
please help me and thanks mates.
Code: Select all
bind pub - !ignore pub:cmdignore
bind pub - !unignore pub:cmdunignore
Code: Select all
if {![string match {[0-9]*} $time]} {set it "15m"} else {set it "$time"}
set time [lindex [split $text] 1]
Code: Select all
newignore $im $handle "$ir" $it
Code: Select all
newignore $im $handle "$ir" 0
Code: Select all
set reason [join [lrange [split $text] 2 end]]
Code: Select all
set reason [join [lrange [split $text] 1 end]]
Code: Select all
set inick [regsub -all -- {[^a-z0-9]} $target ""]
Code: Select all
if {[onchan $target]} {set im "$target!*@*"} else {"set im $target"}
Code: Select all
if {[onchan $target]} {set im "*$inick*!*@*"} else {"set im $target"}
Code: Select all
bind pub o|o !ignore pub:cmdignore
bind pub o|o !unignore pub:cmdunignore
bind pub o|o !listignores listignores
proc pub:cmdignore {nick uhost handle channel 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 reason [join [lrange [split $text] 1 end]]
set host [lindex [split [getchanhost $target $chan] @] 1]
if {$reason == ""} {set ir "Requested By $nick on [join [ctime [unixtime]]]."} else {set ir "$reason Set By $nick on [join [ctime [unixtime]]]."}
if {![string match *!*@* $target] && ![onchan $target]} {
putserv "PRIVMSG $channel :invalid target; no such nickname/hostmask."
return 0
}
if {[onchan $target]} {set im "*!*@*.[join [lrange [split $host .] end-2 end] .]"} else {"set im $target"}
newignore $im $handle "$ir" 0
putserv "PRIVMSG $channel :$nick, now ignoring $im for $it minutes."
return 1
}
proc pub:cmdunignore {nick host handle channel text} {
if {$text == ""} {return 0}
set imask [lindex [split $text] 0]
if {![isignore $imask]} {putserv "PRIVMSG $channel :invalid ignore $imask."; return 0}
if {[killignore $imask]} {
putserv "PRIVMSG $channel :$nick, no longer ingoring $imask."
return 1
} else {
putserv "PRIVMSG $channel :failed, ignore $imask must be removed manually."
return 0
}
}
proc listignores {nick host hand chan text} {
set ilist [ignorelist]
if {![llength $ilist]} {
putserv "NOTICE $nick :I am not currently ignoring anyone."
return 0
}
set inum 0
foreach i $ilist {
set mask [join [lindex $i 0]]
set reason [join [lindex $i 1]]
set begin [join [clock format [lindex $i 3] -format %D-%T]]
set end [join [clock format [lindex $i 2] -format %D-%T]]
puthelp "NOTICE $nick :[incr inum]: \"$mask\" - Set at: $begin by [lindex $i end] for reason \"$reason\" - Ends at: $end"
}
}
Code: Select all
if {[regexp -nocase -- {^[-_./\\]+?([a-z0-9]+)[-_./\\]+$} [lindex [split $text] 0] a b}
Code: Select all
if {[regexp -nocase -- {^[-_./\\]+?([a-z0-9]+)[-_./\\]+$} [lindex [split $text] 0] a b]}