# This is a small script made by Salvation (cking@acy.digex.net) # Parts taken from faith1.1.tcl and put into here. # # One problem is when the bot is first started up, $lamer is not set # so it will give an error from anyone joining and will not voice them. # I thought of putting ' set lamer "" ' in there but when you rehash # it will erase $lamer. If someone could fix that it would be great. # # Until a fix is made, when you start the bot, jump into dcc with it and # type ' .set lamer "" ' and it will work after that. # The problem has been fixed. bind join * * autov bind pub * !dv security_dvoice bind pub * !v security_voice bind pub * !demod security_pub_demoderate bind dcc o vreport give_vrep if {![info exists lamer]} { set lamer "" } proc security_dvoice {nick uhost handle channel arg} { append dvhost $nick "!" [getchanhost $nick $channel] set devhost [finduser $dvhost] if {[matchchanattr $devhost V $channel]} { dvoice $nick $uhost $handle $channel $arg return 0 } if {[matchattr $devhost V]} { dvoice $nick $uhost $handle $channel $arg return 0 } return 0 } proc security_voice {nick uhost handle channel arg} { append dvhost $nick "!" [getchanhost $nick $channel] set devhost [finduser $dvhost] if {[matchchanattr $devhost V $channel]} { voice $nick $uhost $handle $channel $arg return 0 } if {[matchattr $devhost V]} { voice $nick $uhost $handle $channel $arg return 0 } return 0 } proc security_pub_demoderate {nick uhost handle channel arg} { append dvhost $nick "!" [getchanhost $nick $channel] set devhost [finduser $dvhost] if {[matchchanattr $devhost V $channel]} { pub_demoderate $nick $uhost $handle $channel $arg return 0 } if {[matchattr $devhost V]} { pub_demoderate $nick $uhost $handle $channel $arg return 0 } return 0 } proc autov {nick uhost handle chan} { global lamer if ![botisop $chan] {return 0} if {[lsearch -exact $lamer [maskhost $uhost]] > -1} { return 0 } putserv "MODE $chan +v $nick" } proc dvoice {nick uhost handle channel arg} { global botnick lamer set who [lindex $arg 0] append dvhost $who "!" [getchanhost $who $channel] set devhost [finduser $dvhost] if {[string length $lamer] > 400} { set lamer "" } if {$who == ""} { putserv "NOTICE $nick :Usage: !dv " return 1 } if {![onchan $who $channel]} { putserv "NOTICE $nick :# $who must be on the channel for this to work!#" return 0 } if {[matchattr $devhost m]} { putserv "NOTICE $nick : #$nick: You Crazy? He is my owner and he wouldn't be happy!#" return 0 } if {[matchattr $devhost b]} { putserv "NOTICE $nick : #$nick: $who is my bud... why would I want to devoice him?#" return 0 } if {[matchattr $devhost o]} { putserv "NOTICE $nick : #$who is an op, I'm not allowed to do that.#" return 0 } if {$who == $botnick} { putserv "NOTICE $nick :Yeah right, like I'm going to devoice myself?" return 0 } putserv "MODE $channel -v $who" putserv "MODE $channel +m" set maskdv [maskhost $dvhost] lappend lamer $maskdv putserv "NOTICE $nick :#$who has been devoiced with address: $maskdv #" putserv "NOTICE $who :You have said or done something which either violates channel policy or exceeds the limits of good taste. Please msg $nick to regain voice!" return 1 } proc voice {nick uhost handle channel arg} { global lamer set who [lindex $arg 0] append vhost $who "!" [getchanhost $who $channel] if {$who == ""} { putserv "NOTICE $nick :Usage: !v " return 1 } if {![onchan $who $channel]} { putserv "NOTICE $nick :# $who must be on the channel for this to work!#" return 1 } set masklamer [maskhost $vhost] set dellamer [lsearch -exact $lamer $masklamer] if {$dellamer == -1} { putserv "NOTICE $nick :$who was not found in the list" putserv "MODE $channel +v $who" } else { putserv "NOTICE $nick :deleted nick: $who address: $masklamer" set lamer [lreplace $lamer $dellamer $dellamer] putserv "MODE $channel +v $who" } } proc pub_demoderate {nick uhost hand channel arg} { global lamer if {[string length $lamer] > 400} { set lamer "" putserv "MODE $channel -m" return 1 } putserv "MODE $channel -m" return 1 } proc give_vrep {hand idx args} { global lamer botnick putdcc $idx "[string toupper $botnick]\'s ON-LINE VREPORT" putdcc $idx " " if {$lamer == ""} { putdcc $idx "No offenders in memory" } else { putdcc $idx "OFFENDERS\([llength $lamer]\): $lamer" } return 1 }