Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set mutedhosts ""
- setudef flag muting
- bind join -|- * myavoice
- bind pub -|- !mute mymute
- bind pub -|- !demute demute2
- bind pub n !mute mutetrigger
- proc myavoice {n u h c} {
- if {![channel get $c muting]} {return}
- global mutedhosts
- if {[lsearch -exact $mutedhosts $u] == -1} {
- pushmode $c +v $n
- } else { puthelp "PRIVMSG $n :\002$n\002 (\002*!*$u\002) have been muted for 10 mins." }
- }
- proc mymute {n u h c a} {
- if {![channel get $c muting] || ![isop $n $c]} {return}
- global mutedhosts
- foreach v [split $a] {
- if {[onchan $v $c]} {
- lappend mutedhosts [set uh [getchanhost $v $c]]
- pushmode $c -v $v
- utimer 600 [list demute $v $uh $c]
- }
- }
- }
- proc demute2 {n u h c a} {
- if {![channel get $c muting] || ![isop $n $c] || ![onchan $a $c]} {return}
- foreach v [split $a] {
- demute $v [getchanhost $v $c] $c
- }
- }
- proc demute {n h c} {
- global mutedhosts
- if {[set pos [lsearch -exact $mutedhosts $h]] == -1} {return}
- while {[set pos [lsearch -exact $mutedhosts $h]] != -1} {
- set mutedhosts [lreplace $mutedhosts $pos $pos]]
- }
- if {[onchan $n $c]} {
- pushmode $c +v $n
- } {
- foreach curuser [chanlist $c] {
- if {[getchanhost $curuser] == $h && ![isvoice $curuser $c]} {pushmode $c +v $curuser}
- }
- }
- }
- proc mutetrigger {n u h c a} {
- global lastbind
- switch -- $a {
- "on" {
- channel set $c +muting
- puthelp "PRIVMSG $n :\002$n\002 muting system enabled on $c."
- }
- "off" {
- channel set $c -muting
- puthelp "PRIVMSG $n :\002$n\002 muting system disabled on $c."
- }
- default {
- puthelp "PRIVMSG $n :\002$n\002 usage: $lastbind \[on|off\]."
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement