- # -- protection
- # -- variables
- set secure(trigger) "$"
- set secure(version) "1.5 Beta"
- set secure(author) "CrankY (cr@m2x.eu and #cr on irc.ec)"
- # -- settings
- set secure(chanflags) "A U b w t v o"
- set secure(modules) "email DNS badchan"
- set secure(trust,file) "database/trustlist.db"
- set secure(bchan,file) "database/badchan.db"
- # -- setudef
- # -- flag
- setudef flag protection
- # -- str
- setudef str secure_modules
- setudef str secure_chanflags
- setudef str secure_topic
- setudef str secure_welcome
- setudef str secure_id
- setudef str secure_enabled
- # -- copyright
- putlog "protection-script version $secure(version) scripted by $secure(author)"
- # -- bindings
- bind PUB mn|mn "$secure(trigger)protection" secure:script:protection
- bind PUB mn|mn "$secure(trigger)module" secure:script:module
- # -- procs
- proc secure:script:module {nickname hostname handle channel arguments} {
- global lastbind secure
- if {![channel get $channel "protection"]} {
- putserv "PRIVMSG $channel :enable protection first."
- return 0
- }
- set option [lindex [split $arguments] 1]
- set lmodule [lindex [split $arguments] 0]
- if {$option == "" || $lmodule == ""} {
- putserv "PRIVMSG $channel :usage: $lastbind 37module 37 37on/off 37."
- return 0
- }
- if {![string match "*$lmodule*" "$secure(modules)"]} {
- putserv "PRIVMSG $channel :unknown module ' 37$lmodule 37'. - available modules are: [string map {" " ","} "$secure(modules)"]"
- return 0
- }
- switch -- $option {
- "on" {
- if {![string match "*$lmodule*" "[channel get $channel "secure_modules"]"]} {
- putserv "PRIVMSG $channel :module ' 37$lmodule 37'successfully loaded."
- channel set $channel secure_modules "[channel get $channel "secure_modules"] $lmodule"
- } else {
- putserv "PRIVMSG $channel :module ' 37$lmodule 37' is already loaded."
- }
- }
- "off" {
- if {![string match "*$lmodule*" "[channel get $channel "secure_modules"]"]} {
- putserv "PRIVMSG $channel :module ' 37$lmodule 37' is not loaded."
- } else {
- putserv "PRIVMSG $channel :module ' 37$lmodule 37' successfully unloaded."
- channel set $channel secure_modules "[string map ""$lmodule" """ "[channel get $channel "secure_modules"]"]"
- }
- }
- }
- }
- proc secure:script:protection {nickname hostname handle channel arguments} {
- global lastbind
- set option [lindex [split $arguments] 0]
- if {$option == ""} {
- putquick "PRIVMSG $channel :usage: $lastbind 37on/off/status 37"
- return 0
- }
- switch -- $option {
- "on" {
- }
- "off" {
- }
- "status" {
- }
- }
- }
protection
By: cr | Date: Aug 23 2006 19:43 | Format: None | Expires: never | Size: 2.9 KB | Hits: 2285
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago