Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # ____ _ _____ _ ____ _ #
- # / ___| |__ __ _ _ _|_ _|__ ___ | |___ __ _|___ \ / | #
- # | | | '_ \ / _` | '_ \| |/ _ \ / _ \| / __| \ \ / / __) | | | #
- # | |___| | | | (_| | | | | | (_) | (_) | \__ \ \ V / / __/ _| | #
- # \____|_| |_|\__,_|_| |_|_|\___/ \___/|_|___/ \_/ |_____(_)_| #
- # #
- # Moonspell www.pthelp.org moon@pthelp.org #
- # #
- # Script desenvolvido por Filipe Silva. #
- # Bugs, sugestões, opiniões, comentarios: enviem para moon@pthelp.org #
- # #
- # partyline: .chantools #
- # msg: !ajuda #
- # #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. Optools .)=- # Comandos de Operador, totalmente Seguro, apenas Nicks #
- #-=-=-=-=-=-=-=-=-=-=-=# registados o Podem usar. Para escolher os canais deve #
- set optools(enable) 1; # fazer na partyline: .chanset <#canal> +tools #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Define a Flag necessaria para usar o Script.
- set optools(flag) "o"
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. OnJoin .)=- # Script de boas vindas, a quem entra no canal e anuncios #
- set onjoin(enable) 1; # Onjoin. #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Ficheiro Onde serao gravadas as Mensagens Onjoin.
- set onjoin(db) "text/onjoin.db"
- # Canal ou Canais em que pretende usar o Script! (separar por espaços)
- set onjoin(chan) "#mirc"
- # [notc/msg] - Notice/Mensagem - Tipo de Onjoin!
- set onjoin(type) "notc"
- # Define a Flag necessaria para usar o Script.
- set onjoin(flag) "m"
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. Anti-Pub .)=- # Script Anti-Pub, simples e eficaz, bane publicidade a #
- #-=-=-=-=-=-=-=-=-=-=-=# outros Canais. Para que o canal seja verificado pelo #
- set antipub(enable) 1; # script faca na partyline: .chanset <#canal> +nochanpub #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Defina a sua frase de kick!
- set antipub(kick) "Publicidade nao permitida"
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. BadWords .)=- # Script bastante simples, para kickar/banir Asneiras. #
- #-=-=-=-=-=-=-=-=-=-=-=# Para que o canal seja verificado pelo script deve #
- set bw(enable) 1; # fazer na partyline: .chanset <#canal> +nobadwords #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Defina a sua frase de kick!
- set bw(kick) "Temos que respeitar os mandamentos do canal!"
- # Flag necessaria para alterar a lista de palavras.
- set bw(flag) "o|o"
- # Ficheiro Onde serao gravadas as Palavras interditas.
- set bw(db) "text/badwords.db"
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. Caps-Lock .)=- # Script para kick excesso Caps-Lock #
- #-=-=-=-=-=-=-=-=-=-=-=-=-# Para que o canal seja verificado pelo script deve #
- set caps(enable) 1; # fazer na partyline: .chanset <#canal> +nocaps #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Defina a sua frase de kick!
- set caps(kick) "Maiusculas em excesso significa gritar!!!"
- # Percentagem mxima de caracteres em maisculas.
- set caps(percent) 70
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. Anti-Idle .)=- # Script Anti-Idle, Funciona para Idle Global, (raw 317) #
- #-=-=-=-=-=-=-=-=-=-=-=# Verifica primeiro o idle no Canal. Para escolher canais #
- set idle(enable) 1; # sem Idle fazer na partyline: .chanset <#canal> +noidle #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Intervalo de tempo para verificar o Idle! (minutos)
- set idle(interval) "2"
- # Maximo de tempo idle permitido no Canal! (minutos)
- set idle(time) "20"
- # [ops/voices/both/all] - Utilizadores aos quais se aplicará o Script.
- set idle(users) "all"
- # Flag para excluir utilizadores da verificacao de Idle.
- set idle(antiidle) "C"
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. Anti-Away .)=- # Script Anti-away, (raw 352 & Action) . Para escolher #
- #-=-=-=-=-=-=-=-=-=-=-=# canais sem operadores away basta fazer na partyline: #
- set away(enable) 0; # .chanset <#canal> +noaway #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Intervalo de tempo para verificar o Away! (minutos)
- set away(time) "2"
- # [ops/voices/both] - Utilizadores aos quais se aplicará o Script.
- set away(users) "both"
- # Flag para excluir utilizadores da verificacao de away.
- set away(antiaway) "C"
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. AddOps .)=- # Script que facilita adicionar users automaticamente #
- set addops(enable) 1; # no ChanServ e Eggdrop ... #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Canal onde pretende usar o Script!
- set addops(chan) "#mirc"
- # Define a Flag necessária para usar o Script.
- set addops(flag) "m"
- # Define as Flags que o Utilizador receberá
- set addops(dflags) "o"
- # [0/1] - Inactivo/Activo - Opcao ChanServ (registo na access list - PTnet)
- set addops(chanserv) 0
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. HelpServ .)=- # Script de ajuda a Guests, apenas necessario para canais #
- set helpserv(enable) 0;# sem Secure Mode (PTnet). Ninguem nasce ensinado! #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Canal onde pretende usar o Script!
- set helpserv(chan) "#mirc"
- # [0/1] - Ligar/Desligar - Opcao de Ban!
- set helpserv(ban) "0"
- # Periodo de tempo que o Guest tera para mudar de nick antes de ser Banido!
- set helpserv(time) "5"
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. LimitOps .)=- # Script para Limitar o Numero de Opados num determinado #
- #-=-=-=-=-=-=-=-=-=-=-=# canal. (As Oplandias estao fora de moda.) #
- set limit(enable) 0; # para adicionar canais: .chanset <#canal> +limitops #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Numero Maximo de Operadores (Bots correctamente definidos (+b) nao contam)
- set limit(ops) 5
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. CTCP .)=- # Script que permite alterar os CTCP replies do Eggdrop #
- set ctcp(enable) 1; # #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. uHost Mask .)=- # Escolher o tipo de ban usado em todos os scripts #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- set script(bantype) 4; # #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=# #
- # 1) nick!*@* #
- # 2) *!*@some.domain.com #
- # 3) *nick*!*@some.domain.com #
- # 4) *!*ident@some.domain.com #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # -=(. FAQ .)=- # Respostas as possiveis duvidas que possam surgir #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # P: Para que serve este Script ? #
- # R: Este script, e a compilacao de varios Scripts com funcoes variadas #
- # cada script tem uma breve descricao no respectivo cabecalho. #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # P: O que e uma Flag? #
- # R: Flag e o nome dado ao estatuto(s) que cada Utilizador do Eggdrop tem, para #
- # mais informacoes sobre cada uma delas faz (.help whois) na PartyLine do bot.#
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # P: O que quer dizer Idle ? #
- # R: Idle e o tempo de inactividade de um cliente em relacao ao seu servidor, #
- # ou seja, um utilizador que nao envia nenhuma Informacao durante "X" tempo, #
- # esse "X" corresponde ao Idle. #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # P: Eu tenho uma duvida diferente, onde posso obter ajuda ? #
- # R: Nesse caso, podera sempre pedir ajuda no canal #Eggdrop (irc.ptnet.org), e #
- # #Egg (irc.brasnet.org), canais pertencentes ao GUPE (Grupo de Utilizadores #
- # Portugueses de Eggdrops), ou directamente comigo. #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # Copyright © 1997-2015 by Filipe Silva - Moonspell <moon@pthelp.org>. #
- # #
- # Permission to use, copy, modify, and/or distribute this software for any #
- # purpose with or without fee is hereby granted, provided that the above #
- # copyright notice and this permission notice appear in all copies. #
- # #
- # THE SOFTWARE IS PROVIDED ÒAS ISÓ AND MOONSPELL DISCLAIMS ALL WARRANTIES WITH #
- # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY #
- # AND FITNESS. IN NO EVENT SHALL MOONSPELL BE LIABLE FOR ANY SPECIAL, DIRECT, #
- # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM #
- # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR #
- # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR #
- # PERFORMANCE OF THIS SOFTWARE. #
- # #
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- ### Nao alterar nada a partir daqui...
- #
- proc u {} {return };# underline code
- proc r {} {return };# reverse code
- proc b {} {return };# bold code
- proc c {} {return };# color code
- proc o {} {return };# reset attributes code
- #
- set script(logo) [join [lrange [split "[b]([b]ChanTools[b])[b][u]:[u]"] 0 end]]
- set script(version) "v2.1.1b"
- set script(copyright) "(c) 1997-2015 Moonspell <moon@pthelp.org>"
- putlog "## $script(logo) $script(version) $script(copyright) - Activo!"
- bind chon - * ct:chon
- proc ct:chon {hand idx} {
- global script
- if {[matchattr $hand mnt]} {
- putidx $idx " "
- putidx $idx "## $script(logo) $script(version) $script(copyright) - Activo!"
- putidx $idx " "
- }
- }
- set sub(strip) 0
- set sub(raw) 0
- ### -=(. Optools .)=- BINDS/PROCS:
- if { $optools(enable) eq "1" } {
- # Variaveis especificas do modulo.
- setudef flag tools
- set sub(raw) 1
- #Binds
- bind pub $optools(flag) !up pub:up
- bind pub $optools(flag) !down pub:down
- bind pub $optools(flag) !middle pub:middle
- #bind pub $optools(flag) +o pub:op
- #bind pub $optools(flag) !op pub:op
- #bind pub $optools(flag) -o pub:deop
- #bind pub $optools(flag) !deop pub:deop
- #bind pub $optools(flag) +v pub:voice
- bind pub $optools(flag) !voice pub:voice
- #bind pub $optools(flag) -v pub:devoice
- bind pub $optools(flag) !devoice pub:devoice
- #bind pub $optools(flag) !kick pub:kick
- #bind pub $optools(flag) !k pub:kick
- #bind pub $optools(flag) +b pub:ban
- #bind pub $optools(flag) !ban pub:ban
- #bind pub $optools(flag) !b pub:ban
- #bind pub $optools(flag) -b pub:unban
- #bind pub $optools(flag) !unban pub:unban
- #bind pub $optools(flag) !ub pub:unban
- #bind pub $optools(flag) !topic pub:topic
- #bind pub $optools(flag) !t pub:topic
- #Procs
- proc pub:up {nick uhost hand chan text} {
- global whois optools services script
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set whois up
- set optools(chan) $chan
- raw:307 from 307 "$::botnick $nick"
- }
- } else {
- set whois up
- set optools(chan) $chan
- set reg no
- go:whois $nick
- }
- }
- }
- proc pub:middle {nick uhost hand chan text} {
- global whois optools services script
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set whois middle
- set optools(chan) $chan
- raw:307 from 307 "$::botnick $nick"
- }
- } else {
- set whois middle
- set optools(chan) $chan
- set reg no
- go:whois $nick
- }
- }
- }
- proc pub:down {nick uhost hand chan text} {
- if {[channel get $chan tools]} {
- pushmode $chan -v $nick
- pushmode $chan -o $nick
- flushmode $chan
- }
- }
- proc pub:op {nick uhost hand chan text} {
- global whois whom optools services script
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set whom [lrange [split $text] 0 end]
- set whois op
- set optools(chan) $chan
- raw:307 from 307 "$::botnick $nick"
- }
- } else {
- set whom $text
- set whois op
- set optools(chan) $chan
- set reg no
- go:whois $nick
- }
- }
- }
- proc pub:deop {nick uhost hand chan text} {
- global whois whom optools services script
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set whom [lrange [split $text] 0 end]
- set whois deop
- set optools(chan) $chan
- raw:307 from 307 "$::botnick $nick"
- }
- } else {
- set whom $text
- set whois deop
- set optools(chan) $chan
- set reg no
- go:whois $nick
- }
- }
- }
- proc pub:voice {nick uhost hand chan text} {
- global whois whom optools services script
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set whom [lrange [split $text] 0 end]
- set whois voice
- set optools(chan) $chan
- raw:307 from 307 "$::botnick $nick"
- }
- } else {
- set whom $text
- set whois voice
- set optools(chan) $chan
- set reg no
- go:whois $nick
- }
- }
- }
- proc pub:devoice {nick uhost hand chan text} {
- global whois whom optools services script
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set whom [lrange [split $text] 0 end]
- set whois devoice
- set optools(chan) $chan
- raw:307 from 307 "$::botnick $nick"
- }
- } else {
- set whom $text
- set whois devoice
- set optools(chan) $chan
- set reg no
- go:whois $nick
- }
- }
- }
- proc pub:kick {nick uhost hand chan text} {
- global whois whom reason optools services script
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set whom [lindex [split $text] 0]
- set reason [join [lrange [split $text] 1 end]]
- set whois kick
- set optools(chan) $chan
- raw:307 from 307 "$::botnick $nick"
- }
- } else {
- set whom [lindex [split $text] 0]
- set reason [join [lrange [split $text] 1 end]]
- set whois kick
- set optools(chan) $chan
- set reg no
- go:whois $nick
- }
- }
- }
- proc pub:ban {nick uhost hand chan text} {
- global whois host reason whom optools services script
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set whom [lindex [split $text] 0]
- if {$whom ne ""} {
- set host [getchanhost $whom $chan]
- set reason [lrange $text 1 end]
- set whois ban
- set optools(chan) $chan
- raw:307 from 307 "$::botnick $nick"
- } else {
- puthelp "NOTICE $nick :$script(logo) indique o nick que pretende banir"
- }
- }
- } else {
- set whom [lindex [split $text] 0]
- if {$whom ne ""} {
- set host [getchanhost $whom $chan]
- set reason [lrange $text 1 end]
- set whois ban
- set optools(chan) $chan
- set reg no
- go:whois $nick
- } else {
- puthelp "NOTICE $nick :$script(logo) indique o nick que pretende banir"
- }
- }
- }
- }
- proc pub:unban {nick uhost hand chan text} {
- global whois host optools whom script services
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set host [lindex [split $text] 0]
- if {$host ne ""} {
- set whois unban
- set optools(chan) $chan
- set whom $nick
- raw:307 from 307 "$::botnick $nick"
- } else {
- puthelp "NOTICE $nick :$script(logo) indique o nick ou host que pretende desbanir"
- }
- }
- } else {
- set host [lindex [split $text] 0]
- if {$host ne ""} {
- set whois unban
- set optools(chan) $chan
- set whom $nick
- set reg no
- go:whois $nick
- } else {
- puthelp "NOTICE $nick :$script(logo) indique o nick ou host que pretende desbanir"
- }
- }
- }
- }
- proc pub:topic {nick uhost hand chan text} {
- global whois reg topic optools script services
- if {[channel get $chan tools]} {
- if {$services(on) eq "no"} {
- if {![isid $nick]} {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return 0
- } else {
- set topic [join [lrange [split $text] 0 end]]
- set whois topic
- set optools(chan) $chan
- raw:307 from 307 "$::botnick $nick"
- }
- } else {
- set topic [join [lrange [split $text] 0 end]]
- set whois topic
- set optools(chan) $chan
- set reg no
- go:whois $nick
- }
- }
- }
- # Mensagem de carregamento.
- if { ![info exists optools(on)] } {
- putlog "-- $script(logo) Optools - Activado!"
- set optools(on) 1
- } else {
- set loaded(Optools) ""
- }
- }
- ### -=(. OnJoin .}=- BINDS\PROCS:
- if { $onjoin(enable) eq "1" } {
- #Binds
- bind pub $onjoin(flag) !onjoin pub:set:onjoin
- bind join * * join:get:onjoin
- #Procs
- proc pub:set:onjoin {nick uhost hand chan arg} {
- global onjoin script
- if {([llength $arg] < 2)} {
- puthelp "NOTICE $nick :$script(logo) \002Comando\002\037:\037 !onjoin add|del"
- return 0
- }
- switch [lindex $arg 0] {
- "add" {
- if {![file exists $onjoin(db)]} {
- file mkdir [lindex [split $onjoin(db) /] 0]
- }
- set msgjoin [join [lrange [split $arg] 1 end]]
- set join [open $onjoin(db) a+]
- fconfigure $join -translation binary
- puts $join $msgjoin
- close $join
- puthelp "NOTICE $nick :$script(logo) Linha de OnJoin \"$msgjoin\" adicionada com sucesso!"
- }
- "del" {
- if {![file exists $onjoin(db)]} {
- puthelp "NOTICE $nick :$script(logo) Não Existem OnJoin definidas."
- return 0
- }
- set del [lindex [split $arg] 1]
- if {$del eq "all"} {
- exec rm $onjoin(db)
- puthelp "NOTICE $nick :$script(logo) Todas as OnJoin foram apagadas!"
- return 0
- }
- set join [open $onjoin(db) r];set joinn [open $onjoin(db).new w]
- set count "0"
- set alter "0"
- while {![eof $join]} {
- set curjoin [gets $join]
- if {$curjoin ne ""} {
- incr count
- if {$count ne $del} {
- puts $joinn $curjoin
- } else {
- set alter "1"
- }
- }
- }
- close $join
- close $joinn
- exec mv $onjoin(db).new $onjoin(db)
- if {$alter eq "1"} {
- if {$count eq "1"} {exec rm $onjoin(db)}
- puthelp "NOTICE $nick :$script(logo) Apagada a OnJoin número \002$del\002."
- } else {
- puthelp "NOTICE $nick :$script(logo) Não é possivel apagar a OnJoin."
- }
- }
- }
- }
- proc join:get:onjoin { nick uhost hand chan } {
- global onjoin script
- if {(([lsearch -exact [string tolower $onjoin(chan)] [string tolower $chan]] ne -1)||($onjoin(chan) eq "*"))&&(![matchattr $hand b])&&(![isbotnick $nick])} {
- if {![file exists $onjoin(db)]} {
- return 0
- } else {
- set join [open $onjoin(db) r]
- while {![eof $join]} {
- set msgjoin [gets $join]
- if {$msgjoin ne ""} {
- set msgjoin [join [lrange [split $msgjoin] 0 end]]
- switch [string tolower $onjoin(type)] {
- "notc" {
- if {([lindex $msgjoin 0] eq "off") } {
- set msgjoin [join [lrange [split $msgjoin] 1 end]]
- puthelp "NOTICE $nick :$msgjoin"
- } else {
- puthelp "NOTICE $nick :$script(logo) $msgjoin"
- }
- }
- "msg" {
- if {([lindex $msgjoin 0] eq "off") } {
- set msgjoin [join [lrange [split $msgjoin] 1 end]]
- puthelp "PRIVMSG $nick :$msgjoin"
- } else {
- puthelp "PRIVMSG $nick :$script(logo) $msgjoin"
- }
- }
- }
- }
- }
- close $join
- }
- }
- }
- # Mensagem de carregamento.
- if { ![info exists onjoin(on)] } {
- putlog "-- $script(logo) OnJoin - Activado!"
- set onjoin(on) 1
- } else {
- set loaded(OnJoin) ""
- }
- }
- ### -=(. Anti-Pub .)=- BINDS/PROCS:
- if { $antipub(enable) eq "1" } {
- # Variaveis especificas do modulo.
- setudef flag nochanpub
- set sub(strip) 1
- set antipub(interval) 60
- # Binds
- bind pubm - "* *#*" chan:pub
- bind notc - * notc:pub
- bind ctcp - ACTION act:pub
- # Procs
- proc chan:pub {nick uhost hand chan arg} {
- global antipub script
- set arg [strip:codes $arg]
- if {([regexp "#\[a-zA-Z0-9\]+" $arg])&&([channel get $chan nochanpub])} {
- set pattern [lindex [string range $arg [string first # $arg] end ] 0]
- if {[string match -nocase *[string tolower $pattern] [string tolower $chan]] eq "1"} {
- foreach word [split $arg] {
- if {[string match [string tolower "*#*"] $word]} {
- append words "$word "
- }
- }
- foreach bad [split $words] {
- if {![string match -nocase *[string tolower $bad]* [string tolower $chan]] eq "1"} {
- if {![matchattr $hand f|f $chan]||![isop $nick $chan]} {
- ban:proc:antipub $nick $uhost $hand $chan $arg
- }
- }
- }
- } elseif {[matchattr $hand f|f $chan]} {
- } elseif {[isop $nick $chan]} {
- } else {
- ban:proc:antipub $nick $uhost $hand $chan $arg
- }
- }
- }
- proc ban:proc:antipub {nick uhost hand chan args} {
- global antipub script
- if {[validuser "1$chan"] eq 0} {
- adduser "1$chan"
- chattr "1$chan" +B-fhpvom
- setuser "1$chan" PASS chantools
- setuser "1$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
- }
- if {[validuser "2$chan"] eq 0} {
- adduser "2$chan"
- chattr "2$chan" +B-fhpvom
- setuser "2$chan" PASS chantools
- setuser "2$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
- }
- foreach antipubtimer [timers] {
- if {[string equal -nocase clear:hosts [lindex $antipubtimer 1]]} {
- killtimer [lindex $antipubtimer 2]
- break
- }
- }
- set host [uhost:mask $nick $uhost 4]
- set nmask "${nick}!*@*"
- set uchan [nick2hand $nick $chan]
- set cat 0
- if {[matchattr $uchan B]} {
- if {[string match -nocase "*$host*" [getuser "1$chan" HOSTS]] eq 1 && [getuser "1$chan" HOSTS] ne ""} {
- set cat 1
- }
- if {[string match -nocase "*$host*" [getuser "2$chan" HOSTS]] eq 1 && [getuser "2$chan" HOSTS] ne ""} {
- set cat 2
- }
- switch $cat {
- "0" {
- setuser "1$chan" HOSTS $host
- setuser "1$chan" HOSTS $nmask
- putkick $chan $nick "$antipub(kick) [b]\[1 de 3\][b]"
- }
- "1" {
- setuser "2$chan" HOSTS $host
- setuser "2$chan" HOSTS $nmask
- delhost "1$chan" $host
- delhost "1$chan" $nmask
- putkick $chan $nick "$antipub(kick) [b]\[2 de 3\][b]"
- }
- "2" {
- delhost "2$chan" $host
- delhost "2$chan" $nmask
- set reason "$antipub(kick) [b]\[3 de 3\][b]"
- set reason [join [lrange [split $reason] 0 end]]
- ban:proc:new $nick $uhost $chan $script(bantype) $reason
- }
- }
- } else {
- setuser "1$chan" HOSTS $host
- setuser "1$chan" HOSTS $nmask
- putkick $chan $nick "$antipub(kick) [b]\[1 de 3\][b]"
- }
- timer $antipub(interval) clear:hosts
- }
- proc notc:pub {nick uhost hand args chan} {
- if {[string tolower $chan] ne [string tolower $::botnick]} {
- if {[string match "*#*" [string tolower $args]]} {
- chan:pub $nick $uhost $hand $chan $args
- }
- }
- }
- proc act:pub {nick uhost hand chan key args} {
- if {[string tolower $chan] ne [string tolower $::botnick]} {
- if {[string match "*#*" [string tolower $args]]} {
- chan:pub $nick $uhost $hand $chan $args
- }
- }
- }
- # Mensagem de carregamento.
- if { ![info exists antipub(on)] } {
- putlog "-- $script(logo) Anti-Pub - Activado!"
- set antipub(on) 1
- } else {
- set loaded(Anti-Pub) ""
- }
- }
- ### -=(. BadWords .)=- LISTA/BINDS/PROCS:
- if { $bw(enable) eq "1" } {
- # Variaveis especificas do modulo.
- setudef flag nobadwords
- set sub(strip) 1
- set bw_array() ""
- set bw_count 0
- set bw(interval) 60
- # Binds
- bind pubm - * pubm:bw
- bind ctcp - ACTION act:bw
- bind notc - * notc:bw
- bind msg * !bw msg:bw:options
- bind dcc $bw(flag) bw dcc:bw:options
- # Memory
- if { [file exists $bw(db)] } {
- set fd [open $bw(db) r]
- while { ![eof $fd] } {
- set bw_array($bw_count) [gets $fd]
- incr bw_count
- }
- close $fd
- }
- # Procs
- proc dcc:bw:options {hand idx arg} {
- global script bw bw_array bw_count
- putcmdlog "#$hand# bw $arg"
- set reply [lindex [split $arg] 0]
- if {$reply eq ""} {
- putidx $idx "$script(logo) [b]comando[b][u]:[u] .bw add/del/list \[palavra\]"
- } else {
- switch [string tolower [lindex $arg 0]] {
- "add" {
- if {([llength $arg] < 2)} {
- putidx $idx "$script(logo) [b]comando[b][u]:[u] .bw add <palavra>"
- return 0
- }
- set arg [string tolower [join [lrange [split $arg] 1 end]]]
- for {set i 0} {$i < $bw_count} {incr i} {
- if { $arg eq $bw_array($i) } {
- putidx $idx "$script(logo) [b]palavra[b][u]:[u] '$arg' ja existe"
- return 0
- }
- }
- set bw_array($bw_count) "$arg"
- incr bw_count
- putidx $idx "$script(logo) [b]adicionada[b][u]:[u] '$arg'"
- bw:writedb
- return 0
- }
- "del" {
- if {([llength $arg] < 2)} {
- putidx $idx "$script(logo) [b]comando[b][u]:[u] .bw del <palavra>"
- return 0
- }
- set arg [string tolower [join [lrange [split $arg] 1 end]]]
- set bw(deleted) "no"
- for {set i 0} {$i < $bw_count} {incr i} {
- if { $arg eq $bw_array($i) } {
- set bw_array($i) ""
- putidx $idx "$script(logo) [b]eliminada[b][u]:[u] '$arg'"
- set bw(deleted) "yes"
- }
- }
- if { $bw(deleted) eq "no" } {
- putidx $idx "$script(logo) [b]palavra[b][u]:[u] '$arg' nao existe"
- }
- bw:writedb
- return 0
- }
- "list" {
- set bw_txforb ""
- set bw_countwords 0
- for {set i 0} {$i < $bw_count} {incr i} {
- if { $bw_array($i) ne "" } {
- set bw_txforb "$bw_txforb $bw_array($i)"
- incr bw_countwords
- }
- }
- if { $bw_countwords eq 0 } {
- putidx $idx "$script(logo) <Lista vazia>"
- } else {
- putidx $idx "$script(logo) [b]palavras[b][u]:[u] $bw_txforb"
- }
- return 0
- }
- }
- }
- }
- proc msg:bw:options {nick uhost hand arg} {
- global script bw bw_array bw_count
- if {[passwdok $nick [lindex $arg 1]] && [matchattr $hand $bw(flag)]} {
- switch [string tolower [lindex $arg 0]] {
- "add" {
- if {([llength $arg] < 3)} {
- puthelp "PRIVMSG $nick :$script(logo) [b]comando[b][u]:[u] !bw add <password> <palavra>"
- return 0
- }
- set arg [string tolower [join [lrange [split $arg] 2 end]]]
- putcmdlog "$script(logo) $nick ($uhost) usou !bw add (palavra : '$arg')"
- for {set i 0} {$i < $bw_count} {incr i} {
- if { $arg eq $bw_array($i) } {
- puthelp "PRIVMSG $nick :$script(logo) [b]palavra[b][u]:[u] '$arg' ja existe"
- return 0
- }
- }
- set bw_array($bw_count) "$arg"
- incr bw_count
- puthelp "PRIVMSG $nick :$script(logo) [b]adicionada[b][u]:[u] '$arg'"
- bw:writedb
- return 0
- }
- "del" {
- if {([llength $arg] < 3)} {
- puthelp "PRIVMSG $nick :$script(logo) [b]comando[b][u]:[u] !bw del <password> <palavra>"
- return 0
- }
- set arg [string tolower [join [lrange [split $arg] 2 end]]]
- set bw(deleted) "no"
- putcmdlog "$script(logo) $nick ($uhost) usou !bw del (palavra : '$arg')"
- for {set i 0} {$i < $bw_count} {incr i} {
- if { $arg eq $bw_array($i) } {
- set bw_array($i) ""
- puthelp "PRIVMSG $nick :$script(logo) [b]eliminada[b][u]:[u] '$arg'"
- set bw(deleted) "yes"
- }
- }
- if { $bw(deleted) eq "no" } {
- puthelp "PRIVMSG $nick :$script(logo) [b]palavra[b][u]:[u] '$arg' nao existe"
- }
- bw:writedb
- return 0
- }
- "list" {
- putcmdlog "$script(logo) $nick ($uhost) usou !list"
- set bw_txforb ""
- set bw_countwords 0
- for {set i 0} {$i < $bw_count} {incr i} {
- if { $bw_array($i) ne "" } {
- set bw_txforb "$bw_txforb $bw_array($i)"
- incr bw_countwords
- }
- }
- if { $bw_countwords eq 0 } {
- puthelp "PRIVMSG $nick :$script(logo) <Lista vazia>"
- } else {
- puthelp "PRIVMSG $nick :$script(logo) [b]palavras[b][u]:[u] $bw_txforb"
- }
- return 0
- }
- }
- } else {
- puthelp "PRIVMSG $nick :$script(logo) [b]comando[b][u]:[u] !bw <add/del/list> <password> \[palavra\]"
- }
- }
- proc pubm:bw {nick uhost hand chan args} {
- global bw bw_array bw_count
- if {[channel get $chan nobadwords]} {
- if { ([isop $nick $chan])||([isw $nick $chan o]) } {
- return 0
- }
- set args [join $args]
- set args [strip:codes $args]
- for {set i 0} {$i < $bw_count} {incr i} {
- if { $bw_array($i) ne "" } {
- set badw [join $bw_array($i)]
- if {[string match [string tolower $badw] [string tolower $args]]} {
- ban:proc:bw $nick $uhost $hand $chan $badw
- }
- }
- }
- }
- }
- proc ban:proc:bw {nick uhost hand chan args} {
- global bw script
- if {[validuser "1$chan"] eq 0} {
- adduser "1$chan"
- chattr "1$chan" +B-fhpvom
- setuser "1$chan" PASS chantools
- setuser "1$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
- }
- if {[validuser "2$chan"] eq 0} {
- adduser "2$chan"
- chattr "2$chan" +B-fhpvom
- setuser "2$chan" PASS chantools
- setuser "2$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
- }
- foreach bwtimer [timers] {
- if {[string equal -nocase clear:hosts [lindex $bwtimer 1]]} {
- killtimer [lindex $bwtimer 2]
- break
- }
- }
- set host [uhost:mask $nick $uhost 4]
- set nmask "${nick}!*@*"
- set badw [string tolower $args]
- set badw [regsub -all {\{|\}} $badw ""]
- set uchan [nick2hand $nick $chan]
- set cat 0
- if {[matchattr $uchan B]} {
- if {[string match -nocase "*$host*" [getuser "1$chan" HOSTS]] eq 1 && [getuser "1$chan" HOSTS] ne ""} {
- set cat 1
- }
- if {[string match -nocase "*$host*" [getuser "2$chan" HOSTS]] eq 1 && [getuser "2$chan" HOSTS] ne ""} {
- set cat 2
- }
- switch $cat {
- "0" {
- setuser "1$chan" HOSTS $host
- setuser "1$chan" HOSTS $nmask
- putkick $chan $nick "$bw(kick) ($badw) [b]\[1 de 3\][b]"
- }
- "1" {
- setuser "2$chan" HOSTS $host
- setuser "2$chan" HOSTS $nmask
- delhost "1$chan" $host
- delhost "1$chan" $nmask
- putkick $chan $nick "$bw(kick) ($badw) [b]\[2 de 3\][b]"
- }
- "2" {
- delhost "2$chan" $host
- delhost "2$chan" $nmask
- set reason "$bw(kick) [b]\[3 de 3\][b]"
- set reason [join [lrange [split $reason] 0 end]]
- ban:proc:new $nick $uhost $chan $script(bantype) $reason
- }
- }
- } else {
- setuser "1$chan" HOSTS $host
- setuser "1$chan" HOSTS $nmask
- putkick $chan $nick "$bw(kick) ($badw) [b]\[1 de 3\][b]"
- }
- timer $bw(interval) clear:hosts
- }
- proc act:bw {nick uhost hand chan key args} {
- if {[string tolower $chan] ne [string tolower $::botnick]} {
- pubm:bw $nick $uhost $hand $chan $args
- }
- }
- proc notc:bw {nick uhost hand args chan} {
- if {[string tolower $chan] ne [string tolower $::botnick]} {
- set tchan [lindex [split $chan "@"] 1]
- if {($tchan ne "") && ([channel get $tchan nobadwords] eq "1")} {
- pubm:bw $nick $uhost $hand $tchan $args
- } else {
- pubm:bw $nick $uhost $hand $chan $args
- }
- }
- }
- proc bw:writedb {} {
- global bw_array bw_count bw
- if {![file exists $bw(db)]} {
- file mkdir [lindex [split $bw(db) /] 0]
- }
- set fd [open $bw(db) w]
- fconfigure $fd -translation binary
- for {set i 0} {$i < $bw_count} {incr i} {
- if { $bw_array($i) ne "" } {
- puts $fd "$bw_array($i)"
- }
- }
- close $fd
- return 0
- }
- # Mensagem de carregamento.
- if { ![info exists bw(on)] } {
- putlog "-- $script(logo) BadWords - Activado!"
- set bw(on) 1
- } else {
- set loaded(BadWords) ""
- }
- }
- ### -=(. Anti-Idle .)=- PROCS:
- if { $idle(enable) eq "1" } {
- # Variaveis especificas do modulo.
- setudef flag noidle
- set sub(raw) 1
- #Procs
- proc idle:check { } {
- global idle whois services
- set whois idlemode
- if {$services(on) eq "no"} {
- return 0
- }
- foreach chan [channels] {
- if {[channel get $chan noidle]} {
- set idle(ujoin) [getchanjoin $::botnick $chan]
- set curTime [unixtime]
- set idle(join) [expr {$curTime - $idle(ujoin)}]
- set idle(times) [expr {$idle(time) * 60}]
- foreach nick [chanlist $chan] {
- if {![isw $nick $chan b] && ![isw $nick $chan $idle(antiidle)] && ![isbotnick $nick]} {
- switch [lindex $idle(users) 0] {
- "ops" {
- if {[isop $nick $chan]} {
- if {([getchanidle $nick $chan]>$idle(time))||$idle(times) > $idle(join)} {
- go:whois $nick
- }
- }
- }
- "voices" {
- if {[isvoice $nick $chan]} {
- if {([getchanidle $nick $chan]>$idle(time))||$idle(times) > $idle(join)} {
- go:whois $nick
- }
- }
- }
- "both" {
- if {[isop $nick $chan] || [isvoice $nick $chan]} {
- if {([getchanidle $nick $chan]>$idle(time))||$idle(times) > $idle(join)} {
- go:whois $nick
- }
- }
- }
- "all" {
- if {[isop $nick $chan] || [isvoice $nick $chan]} {
- if {([getchanidle $nick $chan]>$idle(time))||$idle(times) > $idle(join)} {
- go:whois $nick
- }
- }
- if {([isw $nick $chan o]) && ![isop $nick $chan] || ([isw $nick $chan v]) && ![isw $nick $chan o] && ![isvoice $nick $chan] && ![isop $nick $chan]} {
- go:whois $nick
- }
- }
- }
- }
- }
- }
- }
- if {![string match "*idle:check*" [timers]]} {
- timer $idle(interval) idle:check
- }
- }
- if {![string match "*idle:check*" [timers]]} {
- timer $idle(interval) idle:check
- }
- # Mensagem de carregamento.
- if { ![info exists idle(on)] } {
- putlog "-- $script(logo) Anti-Idle - Activado!"
- set idle(on) 1
- } else {
- set loaded(Anti-Idle) ""
- }
- }
- ### -=(. Anti-Away .)=- BINDS/PROCS:
- if { $away(enable) eq "1" } {
- # Variaveis especificas do modulo.
- setudef flag noaway
- set sub(raw) 1
- #Binds
- bind ctcp - ACTION act:away
- #Procs
- proc act:away {nick uhost hand chan key arg} {
- global away services
- if {$services(on) eq "no"||![channel get $chan noaway]} {
- return 0
- }
- if {[string tolower $chan] ne [string tolower $::botnick]} {
- if {[isop $nick $chan] && ![isw $nick $chan $away(antiaway)]} {
- if {[string match "*away*" $arg] && ![string match "*back" $arg] && ![string match "*voltou*" $arg]} {
- putserv "WHO $chan"
- }
- }
- }
- }
- if {![string match "*away:demode*" [timers]]} {
- timer $away(time) away:demode
- }
- proc away:demode {} {
- global away services
- if {![string match "*away:demode*" [timers]]} {
- timer $away(time) away:demode
- }
- if {$services(on) eq "yes"} {
- foreach chan [channels] {
- if {[channel get $chan noaway]} {
- putserv "WHO $chan"
- }
- }
- }
- }
- # Mensagem de carregamento.
- if { ![info exists away(on)] } {
- putlog "-- $script(logo) Anti-Away - Activado!"
- set away(on) 1
- } else {
- set loaded(Anti-Away) ""
- }
- }
- # -=(. AddOps .)=- BINDS/PROCS:
- if { $addops(enable) eq "1" } {
- #Binds
- bind msg $addops(flag) addop msg:addop
- bind msg $addops(flag) delop msg:delop
- #Procs
- proc msg:addop {nick uhost hand text} {
- global addops script
- set usernick [lindex [split $text] 1]
- set nivel [lindex $text 2]
- set host "*!*[lindex [split $uhost "@"] 0]*@[lindex [split $uhost "@"] 1]"
- set addops(option) "$addops(chanserv)"
- if {([llength $text] >= 2)} {
- if {[validuser $usernick]} {
- set addops(option) "valid"
- }
- if {![passwdok $nick [lindex $text 0]]} {
- set addops(option) "badpw"
- }
- } else {
- set addops(option) "help$addops(chanserv)"
- }
- switch [lindex $addops(option) 0] {
- "0" {
- adduser $usernick $usernick!*@*
- chattr $usernick +$addops(dflags)
- puthelp "PRIVMSG $nick :$script(logo) [b]$usernick[b] Foi Adicionado à lista do canal [b]$addops(chan)[b] com acesso aos meus comandos."
- }
- "1" {
- set nivelt "[regexp -all {^[1-9]$|^1[0-4]$} $nivel nivelt]"
- if {$nivelt ne "1"} {
- puthelp "PRIVMSG $nick :$script(logo) /msg $::botnick addop password \[nick\] [b]\[nivel 1 a 14\][b]"
- } else {
- adduser $usernick $usernick!*@*
- chattr $usernick +$addops(dflags)
- putserv "chanserv access $addops(chan) add $usernick $nivel"
- puthelp "PRIVMSG $nick :$script(logo) [b]$usernick[b] Foi Adicionado à lista do canal [b]$addops(chan)[b] com nível [b]$nivel[b], com acesso aos meus comandos."
- }
- }
- "help0" {
- puthelp "PRIVMSG $nick :$script(logo) /msg $::botnick addop password \[nick\]"
- }
- "help1" {
- puthelp "PRIVMSG $nick :$script(logo) /msg $::botnick addop password \[nick\] \[nivel\]"
- }
- "valid" {
- puthelp "PRIVMSG $nick :$script(logo) [b]$usernick[b] ja existe na minha Lista."
- }
- "badpw" {
- puthelp "PRIVMSG $nick :$script(logo) password errada!"
- }
- }
- }
- proc msg:delop {nick host hand text} {
- global addops script
- set usernick [lindex [split $text] 1]
- if {$text eq "" || [string tolower $text] eq "help"} {
- puthelp "PRIVMSG $nick :$script(logo) /msg $::botnick delop password \[nick\]"
- return;
- }
- if {![passwdok $nick [lindex $text 0]]} {
- puthelp "PRIVMSG $nick :$script(logo) password errada!"
- return 0;
- } else {
- if {![validuser $usernick]} { puthelp "PRIVMSG $nick :$script(logo) [b]$usernick[b] nao existe na minha Lista.";return 0 }
- deluser $usernick
- puthelp "PRIVMSG $nick :$script(logo) [b]$usernick[b] Foi Removido da lista do canal [b]$addops(chan)[b] com sucesso! Sem acesso aos meus comandos."
- if { $addops(chanserv) eq "1" } { putserv "chanserv access $addops(chan) del $usernick" }
- }
- }
- # Mensagem de carregamento.
- if { ![info exists addops(on)] } {
- putlog "-- $script(logo) AddOps - Activado!"
- set addops(on) 1
- } else {
- set loaded(AddOps) ""
- }
- }
- ### -=). Raws .(=- Script Auxiliar -=). BINDS/PROCS:
- if { $sub(raw) eq "1" } {
- set reg no
- set whois no
- set awaymode no
- set services(nick) "ChanServ"
- set services(host) "PTnet.org"
- #Binds
- bind raw - "301" raw:301 ;# Whois - Away Mode
- bind raw - "302" raw:302 ;# Userhost
- bind raw - "307" raw:307 ;# Whois - registado nickserv
- bind raw - "313" raw:313 ;# Whois - IRC Operator
- bind raw - "314" raw:314 ;# Whowas
- bind raw - "317" raw:317 ;# Whois - Idle Time
- bind raw - "318" raw:318 ;# Whois - /End
- bind raw - "352" raw:352 ;# Who - Away Mode
- bind raw - "369" raw:369 ;# Whowas - /End
- bind raw - "600" raw:600 ;# Watch - Online
- bind raw - "601" raw:601 ;# Watch - Offline
- bind raw - "604" raw:604 ;# Watch Online List/Add
- bind raw - "605" raw:605 ;# Watch Offline List/Add
- #Procs
- proc raw:301 {from key arg} {
- global whois awaymode
- switch [lindex $whois 0] {
- "idlemode" {
- set awaymode yes
- }
- }
- }
- proc raw:302 {from key arg} {
- global script unick whois ident optools
- if {[lindex [split $arg] 2] ne "" } {
- set arg [lindex [split $arg "@"] 1]
- set host [lindex [split $arg "="] 1]
- if {[lindex [split $host "+"] 1] ne ""} {
- set ident [lindex [split $host "+"] 1]
- unban:proc $unick $ident $optools(chan)
- } else {
- set ident [lindex [split $host "-"] 1]
- unban:proc $unick $ident $optools(chan)
- }
- } else {
- set whois whowas
- putserv "WHOWAS $unick"
- }
- }
- proc raw:307 {from key arg} {
- global whois reg script topic
- global optools whom reason host pswd
- switch [lindex $whois 0] {
- "up" {
- set reg yes; set nick [lindex [split $arg] 1]
- if {[matchattr [nick2hand $nick] o]} {
- pushmode $optools(chan) +o $nick
- pushmode $optools(chan) -v $nick
- flushmode $optools(chan)
- }
- }
- "middle" {
- set reg yes; set nick [lindex [split $arg] 1]
- pushmode $optools(chan) +v $nick
- pushmode $optools(chan) -o $nick
- flushmode $optools(chan)
- }
- "op" {
- set reg yes; set nick [lindex [split $arg] 1]
- if {[matchattr [nick2hand $nick] m]} {
- set nochange ""
- if {[llength [split $whom]] eq 0 } { set plus $nick } else { set plus $whom }
- for { set i 0 } { $i < [llength $plus] } { incr i } {
- set whom [lindex [split $plus] $i]
- set whom [join $whom]
- if {[isop $whom $optools(chan)]} {
- set nochange [lappend nochange $whom]
- } else {
- pushmode $optools(chan) +o $whom
- if {[isvoice $whom $optools(chan)]} {
- pushmode $optools(chan) -v $whom
- }
- }
- }
- if {$nochange ne ""} {
- set nochange [join $nochange]
- puthelp "NOTICE $nick :$script(logo) @ detectada para: $nochange"
- }
- flushmode $optools(chan)
- }
- }
- "deop" {
- set reg yes; set nick [lindex [split $arg] 1]
- if {[matchattr [nick2hand $nick] m]} {
- set nochange ""
- set protected ""
- if {[llength [split $whom]] eq 0 } { set plus $nick } else { set plus $whom }
- for { set i 0 } { $i < [llength $plus] } { incr i } {
- set whom [lindex [split $plus] $i]
- set whom [join $whom]
- if {[isop $whom $optools(chan)]} {
- if {([isbotnick $whom]) || ([matchattr $whom b])} {
- set protected [lappend protected $whom]
- } else {
- pushmode $optools(chan) -o $whom
- }
- } else {
- set nochange [lappend nochange $whom]
- }
- }
- if {$nochange ne ""} {
- set nochange [join $nochange]
- puthelp "NOTICE $nick :$script(logo) @ nao foi detectada para: $nochange"
- }
- if {$protected ne ""} {
- set protected [join $protected]
- puthelp "NOTICE $nick :$script(logo) E que tal tentares antes: -o Rob_ ? Deve ser bem mais fácil! ($protected)"
- }
- flushmode $optools(chan)
- }
- }
- "voice" {
- set reg yes; set nick [lindex [split $arg] 1]
- if {[matchattr [nick2hand $nick] o]} {
- set nochange ""
- if {[llength [split $whom]] eq 0 } { set plus $nick } else { set plus $whom }
- for { set i 0 } { $i < [llength $plus] } { incr i } {
- set whom [lindex [split $plus] $i]
- set whom [join $whom]
- if {[isvoice $whom $optools(chan)]} {
- set nochange [lappend nochange $whom]
- } else {
- pushmode $optools(chan) +v $whom
- }
- }
- if {$nochange ne ""} {
- set nochange [join $nochange]
- puthelp "NOTICE $nick :$script(logo) voice detectado para: $nochange"
- }
- flushmode $optools(chan)
- }
- }
- "devoice" {
- set reg yes; set nick [lindex [split $arg] 1]
- if {[matchattr [nick2hand $nick] o]} {
- set nochange ""
- if {[llength [split $whom]] eq 0 } { set plus $nick } else { set plus $whom }
- for { set i 0 } { $i < [llength $plus] } { incr i } {
- set whom [lindex [split $plus] $i]
- set whom [join $whom]
- if {[isvoice $whom $optools(chan)]} {
- pushmode $optools(chan) -v $whom
- } else {
- set nochange [lappend nochange $whom]
- }
- }
- if {$nochange ne ""} {
- set nochange [join $nochange]
- puthelp "NOTICE $nick :$script(logo) voice nao foi detectado para: $nochange"
- }
- flushmode $optools(chan)
- }
- }
- "kick" {
- set reg yes; set nick [lindex [split $arg] 1]
- if {![matchattr $whom o]} {
- if {[isbotnick $whom] || [matchattr $whom b]} {
- puthelp "NOTICE $nick :$script(logo) Porque não vais tentar kickar o Rob_? Deve ser bem mais fácil!"
- } else {
- if {$reason eq ""} {set reason "porta-te bem!"}
- putkick $optools(chan) $whom "[b]([b]$nick[b])[b][u]:[u] $reason"
- }
- } else { puthelp "NOTICE $nick :$script(logo) o nick [b]$whom[b] é de um Utilizador Protegido!"; return 0 }
- }
- "ban" {
- set reg yes; set nick [lindex [split $arg] 1]
- if {([isbotnick $whom])} {
- puthelp "NOTICE $nick :$script(logo) Porque não vais tentar banir o Rob_? Deve ser bem mais fácil!"
- return 0
- }
- if {[onchan $whom $optools(chan)]} {
- if {([matchattr $whom m] || [matchchanattr $whom o $optools(chan)] || [matchattr $whom b]) || [isop $whom $optools(chan)] } {
- puthelp "NOTICE $nick :$script(logo) o nick [b]$whom[b] é de um Utilizador Protegido!"
- return 0
- }
- if {$reason eq ""} {
- set reason "[b]([b]$nick[b])[b][u]:[u] Para a próxima, porta-te bem!"
- }
- set bmask [uhost:mask $whom $host $script(bantype)]
- puthelp "NOTICE $nick :$script(logo) [b]$whom[b] foi banido do canal! ([b]$bmask[b])"
- ban:proc:new $whom $host $optools(chan) $script(bantype) $reason
- } else {
- puthelp "NOTICE $nick :$script(logo) [b]$whom[b] Não está no canal!"
- }
- }
- "unban" {
- set reg yes; set nick [lindex [split $arg] 1]
- if {[string match "*!*@*" [lindex $host 0]]} {
- unban:proc no $host $optools(chan)
- } else { unban:host $host $optools(chan) }
- }
- "topic" {
- set reg yes; set nick [lindex [split $arg] 1]
- putserv "TOPIC $optools(chan) :$topic"
- }
- "idlemode" {
- set reg yes
- }
- "pass" {
- set reg yes; set nick [lindex [split $arg] 1]
- *msg:pass $nick $host $nick $pswd
- }
- }
- }
- proc raw:313 {from key arg} {
- global idle whois reg
- switch [lindex $whois 0] {
- "idlemode" {
- set whois no
- }
- }
- }
- proc raw:314 {from key arg} {
- global whois ident unick optools
- switch [lindex $whois 0] {
- "whowas" {
- set ident [lindex [split $arg] 2]
- set whois no
- unban:proc $unick $ident $optools(chan)
- }
- }
- }
- proc raw:317 {from key arg} {
- global idle whois reg awaymode script
- switch [lindex $whois 0] {
- "idlemode" {
- set nick [lindex $arg 1]
- set idlearg [lindex $arg 2]
- set minutesidle [expr {$idlearg / 60}]
- foreach chan [channels] {
- if {[channel get $chan noidle] && [onchan $nick $chan]} {
- if {($minutesidle > $idle(time)) && ([isop $nick $chan] || [isvoice $nick $chan])} {
- pushmode $chan -o $nick
- pushmode $chan -v $nick
- putcmdlog "$script(logo) -o-v $nick $chan (IDLE)"
- }
- if {![isw $nick $chan L]} { ; # Flag para utilizadores que nao querem ser reOpados.
- if {($minutesidle < $idle(time)) && ![isop $nick $chan] && ![isvoice $nick $chan] && ($reg eq "yes") && ($awaymode eq "off")} {
- if {[isw $nick $chan o]} {
- pushmode $chan +o $nick
- pushmode $chan -v $nick
- putcmdlog "$script(logo) +o-v $nick $chan (IDLE)"
- }
- if {[isw $nick $chan v] && ![isw $nick $chan o]} {
- pushmode $chan +v $nick
- putcmdlog "$script(logo) +v $chan $nick (IDLE)"
- }
- }
- }
- flushmode $chan
- set awaymode off
- }
- }
- }
- }
- }
- proc raw:318 {from key arg} {
- global reg whois script
- set nick [lindex $arg 1]
- set identify "/NickServ IDENTIFY password"
- if {$reg ne "yes"} {
- switch [lindex $whois 0] {
- "up" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "middle" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "op" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "deop" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "voice" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "devoice" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "kick" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "ban" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "unban" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "topic" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- "pass" {
- puthelp "NOTICE $nick :$script(logo) $identify"
- }
- }
- return 0
- }
- }
- proc raw:352 {from key arg} {
- global away script
- if {$away(enable) eq "1"} {
- set nick [lindex $arg 5]
- set chan [lindex $arg 1]
- if {![isbotnick $nick] && ![matchattr $nick $away(antiaway)]} {
- if {[string match *G@* [lindex $arg 6]]||[string match *G+* [lindex $arg 6]]} {
- switch [lindex $away(users) 0] {
- "ops" {
- if {[isop $nick $chan]} {
- putcmdlog "$script(logo) -o $nick $chan (AWAY)"
- pushmode $chan) -o $nick
- }
- }
- "voices" {
- if {[isvoice $nick $chan]} {
- putcmdlog "$script(logo) -v $nick $chan (AWAY)"
- pushmode $chan -v $nick
- }
- }
- "both" {
- if {[isop $nick $chan]} {
- putcmdlog "$script(logo) -o $nick $chan (AWAY)"
- pushmode $chan -o $nick
- }
- if {[isvoice $nick $chan]} {
- putcmdlog "$script(logo) -o $nick $chan (AWAY)"
- pushmode $chan -v $nick
- }
- }
- flushmode $chan
- }
- }
- }
- }
- }
- proc raw:369 {from key arg} {
- global whois ident whom script optools unick
- switch [lindex $whois 0] {
- "whowas" {
- if { [string tolower $unick] eq "last" } {
- unban:last $optools(chan)
- } else {
- puthelp "NOTICE $whom :$script(logo) o nick indicado nao existe ou ja abandonou o servidor ha demasiado tempo."
- }
- set whois no
- }
- }
- }
- proc raw:600 { from key arg } {
- global script services isvalid
- set onnick [lindex $arg 1]
- set nickhost [lindex $arg 3]
- if { $nickhost eq $services(host) } {
- set services(on) "yes"
- set isvalid(off) off
- unset isvalid
- putlog "$script(logo) servicos regressaram."
- }
- }
- proc raw:601 { from key arg } {
- global script services
- set onnick [lindex $arg 1]
- set nickhost [lindex $arg 3]
- if { $nickhost eq $services(host) } {
- set services(on) "no"
- putlog "$script(logo) detectado netsplit dos servicos."
- }
- }
- proc raw:604 { from key arg } {
- global script services isvalid
- set onnick [lindex $arg 1]
- set nickhost [lindex $arg 3]
- if { $nickhost eq $services(host) } {
- set services(on) "yes"
- set isvalid(off) off
- unset isvalid
- putlog "$script(logo) servicos Online"
- }
- }
- proc raw:605 { from key arg } {
- global script services isvalid
- set onnick [lindex $arg 1]
- set nickhost [lindex $arg 3]
- if { $onnick eq $services(nick) } {
- set services(on) "no"
- putlog "$script(logo) servicos Offline."
- }
- }
- #Binds
- bind evnt - init-server watch:services ;# Watch - Activar quando inicia o server.
- bind msg - id msg:isid
- unbind msg - pass *msg:pass
- bind msg - pass secure:msg:pass
- #Procs
- proc watch:services { type } {
- global services
- set services(on) "no"
- putserv "WATCH +$services(nick)"
- }
- proc msg:isid { nick uhost hand arg } {
- global isvalid script
- set ulogin [lindex [split $arg] 0]
- set upass [lindex [split $arg] 1]
- if {[validuser $hand]} {
- if {[llength [split $arg]] ne 2 } {
- puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
- return
- }
- if {![validuser $ulogin ]} {
- puthelp "NOTICE $nick :$script(logo) Login invalido"
- return
- }
- if {[passwdok $hand ""]} {
- putserv "NOTICE $nick :$script(logo) $ulogin sem password definida."
- return
- }
- if {[passwdok $hand $upass]} {
- if {![isid $nick]} {
- set isvalid([split $nick]) $uhost
- puthelp "NOTICE $nick :$script(logo) Login [b]$hand[b] validado com sucesso"
- } else {
- puthelp "NOTICE $nick :$script(logo) Login [b]$hand[b] ja foi validado anteriormente"
- }
- } else {
- puthelp "NOTICE $nick :$script(logo) password errada"
- }
- } else {
- puthelp "NOTICE $nick :$script(logo) utilizador desconhecido, contacte um administrador do canal para obter ajuda."
- }
- }
- proc isid { nick } {
- global isvalid
- if {[string compare $nick $::botnick] eq 0} {
- return 1
- }
- if {[info exists isvalid($nick)]} {
- return 1
- }
- return 0
- }
- proc secure:msg:pass { nick uhost hand arg } {
- global script reg whois services pswd host
- if {$services(on) eq "yes"} {
- set whois pass
- set reg no
- set pswd [lindex $arg 0]
- set host $uhost
- go:whois $nick
- } else {
- puthelp "NOTICE $nick :$script(logo) servicos indisponiveis, por favor tente mais tarde!"
- }
- }
- }
- ### -=). Strip Codes .(=- Script Auxiliar -=). PROCS:
- if { $sub(strip) eq "1" } {
- #Procs
- proc strip:codes {a} {
- regsub -all -- {\002} $a "" a
- regsub -all -- {\003([0-9][0-9]?(,[0-9][0-9]?)?)?} $a "" a
- regsub -all -- {\017} $a "" a
- regsub -all -- {\026} $a "" a
- regsub -all -- {\037} $a "" a
- regsub -all -- {\.} $a " " a
- regsub -all -- {\!} $a " " a
- regsub -all -- {\,} $a " " a
- regsub -all -- {\?} $a " " a
- regsub -all -- {\:} $a " " a
- regsub -all -- {\;} $a " " a
- return $a
- }
- }
- ### -=(. HelpServ .)=- BINDS/PROCS:
- if { $helpserv(enable) eq 1 } {
- #Binds
- bind join - "$helpserv(chan) guest*!*@*" join:helpserv
- bind msgm - "*mud*pass*" msg:mudpass:helpserv
- #Procs
- proc join:helpserv {nick uhost hand args} {
- global helpserv guest
- puthelp "PRIVMSG $nick :Forma [b]simples[b] de registar um [b]nick[b] (papel e caneta pode ser útil)"
- puthelp "PRIVMSG $nick :1º Escolher\: /nickserv info [b]nick[b] (só o poderá registar se aparecer\: [b]nick[b] nao esta' registado)"
- puthelp "PRIVMSG $nick :2º Mudar de nick\: /nick [b]nick[b]."
- puthelp "PRIVMSG $nick :3º Registar\: /nickserv register [b]password[b] [b]email[b]. Consulte o seu email para concluir o processo."
- puthelp "PRIVMSG $nick :4º Da próxima vez terás que o identificar\: /nickserv identify [b]password[b]."
- puthelp "PRIVMSG $nick :Para mais informações vai a [b]www.pthelp.org[b] ou faz [b]/join #PThelp.[b]"
- set guest $nick
- if { $helpserv(ban) eq "1" } {
- puthelp "PRIVMSG $nick :O Canal $helpserv(chan) proibe a entrada de Users com o nick Guest* ... tem [b]$helpserv(time)[b] minutos para mudar de nick."
- timer $helpserv(time) timer:helpserv
- }
- }
- proc timer:helpserv {} {
- global helpserv guest script
- if {[onchan $guest $helpserv(chan)]} {
- set reason "$script(logo) Os [b]$helpserv(time)[b] minutos que te demos para registar\/mudar o nick acabaram, mais ajuda\: [b]/helpserv regnick[b] ou [b]/join #PThelp[b]"
- set reason [join [lrange [split $reason] 0 end]]
- ban:proc:new $guest $guest $helpserv(chan) 1 $reason
- }
- }
- proc msg:mudpass:helpserv {nick uhost hand args} {
- puthelp "PRIVMSG $nick :Para mudar a password do seu [b]nick[b] faça\: /nickserv set password [b]novapass[b]"
- }
- # Mensagem de carregamento.
- if { ![info exists helpserv(on)] } {
- putlog "-- $script(logo) HelpServ - Activado!"
- set helpserv(on) 1
- } else {
- set loaded(HelpServ) ""
- }
- }
- ### -=(. LimitOps .)=- BINDS/PROCS:
- if { $limit(enable) eq "1" } {
- # Variaveis especificas do modulo.
- setudef flag limitops
- #Binds
- bind mode - "* +o" mode:ops
- #Procs
- proc mode:ops {nick uhost hand chan mode oped} {
- global limit script services
- if {$services(on) eq "no"} {
- return 0
- }
- if {[channel get $chan limitops]} {
- set ops 0
- foreach lnick [chanlist $chan] {
- if {[isw $lnick $chan b]} {
- } elseif {[isop $lnick $chan] && ![isbotnick $lnick] } {
- incr ops
- }
- }
- if { ($ops > $limit(ops)) && (![isw $oped $chan b]) && (![isbotnick $oped]) } {
- putcmdlog "$script(logo) -o $oped $chan (Limit)"
- pushmode $chan -o $oped
- flushmode $chan
- if {[string tolower $nick] eq [string tolower $services(nick)]} {
- puthelp "NOTICE $oped :$script(logo) O canal está Limitado a [b]$limit(ops)[b] Operadores!"
- } else {
- puthelp "NOTICE $nick :$script(logo) O canal está Limitado a [b]$limit(ops)[b] Operadores!"
- }
- }
- }
- }
- # Mensagem de carregamento.
- if { ![info exists limit(on)] } {
- putlog "-- $script(logo) LimitOps - Activado!"
- set limit(on) 1
- } else {
- set loaded(LimitOps) ""
- }
- }
- ### -=(. CTCP .)=- BINDS/PROCS:
- if { $ctcp(enable) eq "1" } {
- #
- set ctcplist {
- "mIRC32 v5.91 K.Mardam-Bey"
- "mIRC v7.32 Khaled Mardam-Bey"
- "mIRC v7.32 Khaled Mardam-Bey"
- "irssi-0.8.17-head - Linux 3.13.0-24-generic x86_64 : Keep it to yourself!"
- "irssi v0.8.15 - running on Linux x86_64"
- "irssi v0.8.16 - running on FreeBSD amd64"
- "irssi v0.8.17 - running on FreeBSD i386"
- "ZNC 0.206+deb2 - http://znc.in"
- "Textual IRC Client: www.textualapp.com Ñ v5.0.1"
- "xchat 2.8.8 Linux 3.14-kali1-amd64 \[x86_64/1.89GHz/SMP\]"
- "mIRCoondas v1.0"
- "WeeChat 1.0.1 (Sep 28 2015)"
- "IRC for Android v2.1.18"
- "BitchX-1.0c19+ by panasync - Linux 2.4.7-10 : Keep it to yourself!"
- }
- #Binds
- bind dcc n ctcp dcc:ctcp
- bind ctcp - version ctcp:reply
- bind ctcp - finger ctcp:reply
- bind ctcp - userinfo ctcp:reply
- #Procs
- proc dcc:ctcp {hand idx arg} {
- global ctcp-version ctcp-finger ctcp-userinfo
- set reply [lindex [split $arg] 0]
- putcmdlog "#$hand# ctcp $arg"
- if {$reply eq ""} {
- putidx $idx "[b]([b]ctcp[b])[b][u]:[u] Replies Actuais\:"
- putidx $idx "[b]([b]ctcp[b])[b][u]:[u] finger : [b]${ctcp-finger}[b]"
- putidx $idx "[b]([b]ctcp[b])[b][u]:[u] userinfo : [b]${ctcp-userinfo}[b]"
- putidx $idx "[b]([b]ctcp[b])[b][u]:[u] version : [b]${ctcp-version}[b]"
- putidx $idx "[b]([b]ctcp[b])[b][u]:[u] Comando: ctcp \[userinfo|finger|version \[reply\]\]"
- } else {
- switch -exact -- [string tolower $reply] {
- "finger" {
- set ctcp-finger [join [lrange [split $arg] 1 end]]
- putidx $idx "[b]([b]ctcp[b])[b][u]:[u] ctcp-finger alterado para [b]\"${ctcp-finger}\"[b]"
- }
- "userinfo" {
- set ctcp-userinfo [join [lrange [split $arg] 1 end]]
- putidx $idx "[b]([b]ctcp[b])[b][u]:[u] ctcp-userinfo alterado para [b]\"${ctcp-userinfo}\"[b]"
- }
- "version" {
- set ctcp-version [join [lrange [split $arg] 1 end]]
- putidx $idx "[b]([b]ctcp[b])[b][u]:[u] ctcp-version alterado para [b]\"${ctcp-version}\"[b]"
- }
- "default" {
- putidx $idx "[b]([b]ctcp[b])[b][u]:[u] Comando: ctcp \[userinfo|finger|version \[reply\]\]"
- }
- }
- }
- }
- if {[string match "*eggdrop*" ${ctcp-version}] eq 1} {
- set ctcprand [lindex $ctcplist [rand [llength $ctcplist]]]
- set ctcp-version $ctcprand
- set ctcp-finger $ctcprand
- set ctcp-userinfo $ctcprand
- }
- proc ctcp:reply {nick uhost hand dest keyword text} {
- global ctcplist ctcp-version ctcp-finger ctcp-userinfo
- set ctcprand [lindex $ctcplist [rand [llength $ctcplist]]]
- switch -exact -- [string tolower $keyword] {
- "version" {
- set ctcp-version $ctcprand
- }
- "finger" {
- set ctcp-finger $ctcprand
- }
- "userinfo" {
- set ctcp-userinfo $ctcprand
- }
- "default" { return 0 }
- }
- }
- # Mensagem de carregamento.
- if { ![info exists ctcp(on)] } {
- putlog "-- $script(logo) CTCP - Activado!"
- set ctcp(on) 1
- } else {
- set loaded(CTCP) ""
- }
- }
- ### -=(. Caps-Lock .)=- BINDS/PROCS:
- if { $caps(enable) eq "1" } {
- # Variaveis especificas do modulo.
- setudef flag nocaps
- set caps(interval) 60
- # Binds
- bind pubm - * pubm:caps
- bind ctcp - ACTION act:caps
- bind notc - * notc:caps
- # Procs
- proc pubm:caps {nick uhost hand chan text} {
- global caps
- if {![matchattr $hand f] || ![isop $nick $chan] || ![isvoice $nick $chan]||[isw $nick $chan o]} {
- set caps(upper) 0
- set caps(space) 0
- set caps(chars) [string length $text]
- if {$caps(chars) > 10} {
- foreach i [split $text {}] {
- if {[string match \[A-Z\] $i]} {
- incr caps(upper)
- }
- if {$i eq " "} {
- incr caps(space)
- }
- }
- if {$caps(upper) >= 30} {
- set caps(total) [expr {100 * $caps(upper) / ($caps(chars) - $caps(space))}]
- if {$caps(total) > $caps(percent)} {
- ban:proc:caps $nick $uhost $hand $chan $caps(total)
- }
- }
- }
- }
- }
- proc ban:proc:caps {nick uhost hand chan args} {
- global caps script
- if {[channel get $chan nocaps]} {
- if {[validuser "1$chan"] eq 0} {
- adduser "1$chan"
- chattr "1$chan" +B-fhpvom
- setuser "1$chan" PASS chantools
- setuser "1$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
- }
- if {[validuser "2$chan"] eq 0} {
- adduser "2$chan"
- chattr "2$chan" +B-fhpvom
- setuser "2$chan" PASS chantools
- setuser "2$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
- }
- foreach capstimer [timers] {
- if {[string equal -nocase clear:hosts [lindex $capstimer 1]]} {
- killtimer [lindex $capstimer 2]
- break
- }
- }
- set host [uhost:mask $nick $uhost 4]
- set nmask "${nick}!*@*"
- set caps(kicktotal) [string tolower $args]
- set uchan [nick2hand $nick $chan]
- set cat 0
- if {[matchattr $uchan B]} {
- if {[string match -nocase "*$host*" [getuser "1$chan" HOSTS]] eq 1 && [getuser "1$chan" HOSTS] ne ""} {
- set cat 1
- }
- if {[string match -nocase "*$host*" [getuser "2$chan" HOSTS]] eq 1 && [getuser "2$chan" HOSTS] ne ""} {
- set cat 2
- }
- switch $cat {
- "0" {
- setuser "1$chan" HOSTS $host
- setuser "1$chan" HOSTS $nmask
- putkick $chan $nick "[b]([b]$caps(kicktotal)%[b])[b][u]:[u] $caps(kick) [b]\[1 de 3\][b]"
- }
- "1" {
- setuser "2$chan" HOSTS $host
- setuser "2$chan" HOSTS $nmask
- delhost "1$chan" $host
- delhost "1$chan" $nmask
- putkick $chan $nick "[b]([b]$caps(kicktotal)%[b])[b][u]:[u] $caps(kick) [b]\[2 de 3\][b]"
- }
- "2" {
- delhost "2$chan" $host
- delhost "2$chan" $nmask
- set reason "[b]([b]$caps(kicktotal)%[b])[b][u]:[u] $caps(kick) [b]\[3 de 3\][b]"
- set reason [join [lrange [split $reason] 0 end]]
- ban:proc:new $nick $uhost $chan $script(bantype) $reason
- }
- }
- } else {
- setuser "1$chan" HOSTS $host
- setuser "1$chan" HOSTS $nmask
- putkick $chan $nick "[b]([b]$caps(kicktotal)%[b])[b][u]:[u] $caps(kick) [b]\[1 de 3\][b]"
- }
- timer $caps(interval) clear:hosts
- }
- }
- proc act:caps {nick uhost hand chan key text} {
- if {[string tolower $chan] ne [string tolower $::botnick]} {
- pubm:caps $nick $uhost $hand $chan $text
- }
- }
- proc notc:caps {nick uhost hand args chan} {
- if {[string tolower $chan] ne [string tolower $::botnick]} {
- set tchan [lindex [split $chan "@"] 1]
- if {($tchan ne "") && ([channel get $tchan nocaps] eq "1")} {
- pubm:caps $nick $uhost $hand $tchan $args
- } else {
- pubm:caps $nick $uhost $hand $chan $args
- }
- }
- }
- if { ![info exists caps(on)] } {
- putlog "-- $script(logo) Caps-Lock - Activado!"
- set caps(on) 1
- } else {
- set loaded(Caps-Lock) ""
- }
- }
- ### -=(. BAN System .)=- PROCS:
- setudef int moon-kcount
- proc putkick {chan nick arg} {
- if {[botonchan $chan] && [botisop $chan]} {
- set nick [split $nick ,]
- foreach nick $nick {
- putquick "kick $chan $nick :$arg --- (kick \244[channel get $chan moon-kcount])"
- }
- }
- }
- bind kick - "*" get:kick
- proc get:kick {nick uhost hand chan target reason} {
- if {[isbotnick $nick]} {
- set kcount [channel get $chan moon-kcount]
- if {$kcount eq ""} {
- set kcount 0
- } else {
- incr kcount
- }
- channel set $chan moon-kcount $kcount
- }
- }
- proc uhost:mask { nick uhost args } {
- switch $args {
- 1 { set umask "${nick}!*@*" }
- 2 { set umask "*!*@[lindex [split $uhost @] 1]" }
- 3 { set umask "*$nick*!*@[lindex [split $uhost "@"] 1]" }
- 4 { set umask "*!*[lindex [split $uhost "@"] 0]@[lindex [split $uhost "@"] 1]" }
- return $umask
- }
- }
- proc ban:proc:new {nick uhost chan btype reason} {
- global script
- set bmask [uhost:mask $nick $uhost $btype]
- if {[channel get $chan enforcebans]} {
- newchanban $chan $bmask $::botnick $reason 0
- } else {
- pushmode $chan +b $bmask
- flushmode $chan
- putkick $chan $nick $reason
- }
- }
- set unick ""
- set ident ""
- proc unban:host {nick chan} {
- global script unick ident optools
- set unick $nick
- set optools(chan) $chan
- putserv "USERHOST $::botnick $nick"
- }
- proc unban:proc {nick uhost chan} {
- global script unick whom
- set ubans 0
- foreach record [banlist $chan] {
- set remove [string tolower [lindex [split $record] 0]]
- if {([string match -nocase "$nick!*@*" $remove]) && ($nick ne "no")} {
- killchanban $chan $remove
- incr ubans
- }
- if {[string match -nocase "*$uhost*" $remove]} {
- killchanban $chan $remove
- incr ubans
- }
- }
- foreach record [chanbans $chan] {
- set remove [lindex [split $record] 0]
- if {([string match -nocase "$nick!*@*" $remove ]) && ($nick ne "no")} {
- pushmode $chan -b $remove
- incr ubans
- }
- if {[string match -nocase "*$uhost*" $remove ]} {
- pushmode $chan -b $remove
- incr ubans
- }
- }
- flushmode $chan
- if { $ubans eq "0" } { puthelp "NOTICE $whom :$script(logo) Nenhum ban removido" }
- if { $ubans > "0" } { puthelp "NOTICE $whom :$script(logo) $ubans removidos"}
- }
- proc unban:last {chan} {
- global whom script
- set ubans 0
- foreach record [lreverse [chanbans $chan]] {
- incr ubans
- set remove [lindex [split $record] 0]
- if {$ubans eq "1"} {
- pushmode $chan -b $remove
- killchanban $chan $remove
- puthelp "NOTICE $whom :$script(logo) o ban mais recente foi removido \[Banlist Canal\]"
- }
- }
- foreach record [banlist $chan] {
- incr ubans
- set remove [string tolower [lindex [split $record] 0]]
- if {$ubans eq "1"} {
- killchanban $chan $remove
- puthelp "NOTICE $whom :$script(logo) o ban mais recente foi removido \[Banlist BOT\]"
- }
- }
- if { $ubans eq "0" } { puthelp "NOTICE $whom :$script(logo) Nenhum ban removido" }
- }
- proc clear:hosts { } {
- foreach chan [channels] {
- if {[channel get $chan nobadwords]||[channel get $chan nocaps]} {
- if {[validuser "1$chan"] eq 1} {
- setuser "1$chan" HOSTS
- }
- if {[validuser "2$chan"] eq 1} {
- setuser "2$chan" HOSTS
- }
- }
- }
- }
- proc isw {nick chan flag} {
- set iswcheck 0
- if {[matchattr [nick2hand $nick $chan] $flag|$flag $chan]} {
- incr iswcheck
- }
- if {[matchattr [nick2hand $nick] $flag]} {
- incr iswcheck
- }
- if { $iswcheck eq 0 } {
- return 0
- } else {
- return 1
- }
- }
- proc go:whois {nick} {
- putserv "WHOIS $nick $nick"
- }
- ### -=(. Ajuda .)=- BINDS\PROCS:
- #Binds
- bind msg - !ajuda msg:ajuda
- #Procs
- proc msg:ajuda { nick uhost hand text } {
- global script optools addops onjoin bw
- if {([llength $text] < 1)} {
- puthelp "PRIVMSG $nick :$script(logo) $script(version) $script(logo)"
- if {[matchattr $hand p]} {
- puthelp "PRIVMSG $nick :$script(logo) Comando: !ajuda [b](script)[b] - Scripts activos aos quais tem acesso:"
- if {($optools(enable)eq"1")&&([matchattr $hand $optools(flag)])} {
- puthelp "PRIVMSG $nick :$script(logo) -=(. [b]Optools[b] .)=- !ajuda optools"
- }
- if {($bw(enable)eq"1")&&([matchattr $hand $bw(flag)])} {
- puthelp "PRIVMSG $nick :$script(logo) -=(. [b]BadWords[b] .)=- !ajuda bw"
- }
- if {($onjoin(enable)eq"1")&&([matchattr $hand $onjoin(flag)])} {
- puthelp "PRIVMSG $nick :$script(logo) -=(. [b]OnJoin[b] .)=- !ajuda onjoin"
- }
- if {($addops(enable)eq"1")&&([matchattr $hand $addops(flag)])} {
- puthelp "PRIVMSG $nick :$script(logo) -=(. [b]AddOps[b] .)=- !ajuda addops"
- }
- }
- }
- switch [lindex $text 0] {
- "optools" {
- if {($optools(enable)eq"1")&&([matchattr $hand $optools(flag)])} {
- puthelp "PRIVMSG $nick : $script(logo) -=(. [b]Optools[b] .)=- Comandos\:"
- puthelp "PRIVMSG $nick : $script(logo) [b]!up[b] (Op) [b]!down[b] (deOp) [b]+o <nick>[b] (Opar) [b]-o <nick>[b] (deOpar)"
- puthelp "PRIVMSG $nick : $script(logo) [b]!middle[b] (Voice) [b]+v <nick>[b] (Voiçar) [b]-v <nick>[b] (deVoiçar)"
- puthelp "PRIVMSG $nick : $script(logo) [b]!kick <nick> <razão>[b] (Kickar) [b]+b <nick> <razão>[b] (Banir) [b]-b <<nick/host>[b] (desBanir)"
- puthelp "PRIVMSG $nick : $script(logo) [b]!topic <texto>[b] (Alterar o tópico do canal)"
- puthelp "PRIVMSG $nick : $script(logo) existem tb os comandos [b]!k !b !t[b] para kick, ban e topic respectivamente"
- }
- }
- "onjoin" {
- if {($addops(enable)eq"1")&&([matchattr $hand $onjoin(flag)])} {
- puthelp "PRIVMSG $nick :$script(logo) -=(. [b]OnJoin[b] .)=- Comandos\:"
- puthelp "PRIVMSG $nick :$script(logo) \[Public\][b]:[b] Adicionar\: !onjoin add [u]off[u] [b]frase[b]"
- puthelp "PRIVMSG $nick :$script(logo) \[nota\][b]\:[b] a opção \"off\" serve para ocultar -\> $script(logo)"
- puthelp "PRIVMSG $nick :$script(logo) \[Public\][b]:[b] Remover\: !onjoin del [b]número[b]|all"
- puthelp "PRIVMSG $nick :$script(logo) \[nota\][b]\:[b] Corresponde ao número da frase."
- }
- }
- "bw" {
- if {($bw(enable)eq"1")&&([matchattr $hand $bw(flag)])} {
- puthelp "PRIVMSG $nick :$script(logo) -=(. [b]BadWords[b] .)=- Comandos\:"
- puthelp "PRIVMSG $nick :$script(logo) Adicionar\: /msg $::botnick !bw add [b]password[b] \[palavra\]"
- puthelp "PRIVMSG $nick :$script(logo) Remover\: /msg $::botnick !bw del [b]password[b] \[palavra\]"
- puthelp "PRIVMSG $nick :$script(logo) Lista\: /msg $::botnick !bw list [b]password[b]"
- puthelp "PRIVMSG $nick :$script(logo) \[nota\][b]\:[b] deve usar a password de identificação ao Eggdrop"
- }
- }
- "addops" {
- if {($addops(enable)eq"1")&&([matchattr $hand $addops(flag)])} {
- puthelp "PRIVMSG $nick :$script(logo) -=(. [b]AddOps[b] .)=- Comandos\:"
- if {($addops(chanserv)eq"1")} {
- puthelp "PRIVMSG $nick :$script(logo) Adicionar\: /msg $::botnick addop [b]password[b] \[nick\] \[nível\]"
- } else {
- puthelp "PRIVMSG $nick :$script(logo) Adicionar\: /msg $::botnick addop [b]password[b] \[nick\]"
- }
- puthelp "PRIVMSG $nick :$script(logo) Remover\: /msg $::botnick delop [b]password[b] \[nick\]"
- puthelp "PRIVMSG $nick :$script(logo) \[nota\][b]\:[b] deve usar a password de identificação ao Eggdrop"
- }
- }
- }
- }
- ### -=(. Status .)=- BINDS\PROCS:
- #Binds
- bind dcc n chantools dcc:chantools
- #Procs
- proc dcc:chantools { hand idx arg } {
- global ctcp-version ctcp-finger ctcp-userinfo antipub onjoin optools
- global addops helpserv ctcp limit idle away bw script caps
- switch [lindex [string tolower $arg] 0] {
- "" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]Status[b] .)=- \:\: \[0/1\] - Activo/Inactivo"
- putidx $idx "$script(logo) -=(. [b]Optools[b] .)=- [b]$optools(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]OnJoin[b] .)=- [b]$onjoin(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]Anti-Pub[b] .)=- [b]$antipub(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]BadWords[b] .)=- [b]$bw(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]Anti-Idle[b] .)=- [b]$idle(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]Anti-Away[b] .)=- [b]$away(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]AddOps[b] .)=- [b]$addops(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]Caps-Lock[b] .)=- [b]$caps(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]HelpServ[b] .)=- [b]$helpserv(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]LimitOps[b] .)=- [b]$limit(enable)[b]"
- putidx $idx "$script(logo) -=(. [b]CTCP[b] .)=- [b]$ctcp(enable)[b]"
- putidx $idx "$script(logo) Mais informações\: .chantools <script>"
- }
- "optools" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]Optools[b] .)=-"
- putidx $idx "$script(logo) Flag necessária para usar\: \"[b]$optools(flag)[b]\""
- }
- "onjoin" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]OnJoin[b] .)=-"
- putidx $idx "$script(logo) Canal/Canais\: [b]$onjoin(chan)[b]"
- putidx $idx "$script(logo) Flag necessária para usar\: \"[b]$onjoin(flag)[b]\""
- putidx $idx "$script(logo) Localização da Base de Dados\: \"[b]$onjoin(db)[b]\""
- putidx $idx "$script(logo) Tipo de OnJoin\: [b]$onjoin(type)[b]"
- }
- "anti-pub" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]Anti-Pub[b] .)=-"
- putidx $idx "$script(logo) Mensagem de kick\: [b]$antipub(kick)[b]"
- }
- "badwords" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]BadWords[b] .)=-"
- putidx $idx "$script(logo) Base de dados de palavras: [b]$bw(db)[b]; Flag necessaria de acesso: [b]$bw(flag)[b]"
- putidx $idx "$script(logo) Mensagem de kick\: [b]$bw(kick)[b]"
- }
- "anti-idle" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]Anti-Idle[b] .)=-"
- putidx $idx "$script(logo) Intervalo de tempo para verificar o Idle\: [b]$idle(interval)[b] minutos"
- putidx $idx "$script(logo) Máximo de tempo idle permitido no Canal\: [b]$idle(time)[b] minutos"
- putidx $idx "$script(logo) Utilizadores aos quais se aplica\: [b]$idle(users)[b] \:\: \[ops/voices/both/all\]"
- }
- "anti-away" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]Anti-Away[b] .)=-"
- putidx $idx "$script(logo) Intervalo de tempo para verificar o Away\: [b]$away(time)[b] minutos"
- putidx $idx "$script(logo) Utilizadores aos quais se aplica\: [b]$away(users)[b] \:\: \[ops/voices/both\]"
- }
- "addops" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]AddOps[b] .)=-"
- putidx $idx "$script(logo) Canal\: [b]$addops(chan)[b]"
- putidx $idx "$script(logo) Flag necessária para usar\: \"[b]$addops(flag)[b]\""
- putidx $idx "$script(logo) Flags que o Utilizador receberá\: \"[b]$addops(dflags)[b]\""
- putidx $idx "$script(logo) Opção de registo ChanServ (PTnet)\: [b]$addops(chanserv)[b] \:\: \[0/1\] - Activo/Inactivo"
- }
- "caps-lock" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]Caps-Lock[b] .)=-"
- putidx $idx "$script(logo) Percentagem maxima de maiusculas permitida: [b]$caps(percent)%[b]"
- putidx $idx "$script(logo) Mensagem de kick\: [b]$caps(kick)[b]"
- }
- "helpserv" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]HelpServ[b] .)=-"
- putidx $idx "$script(logo) Canal\: [b]$helpserv(chan)[b]"
- putidx $idx "$script(logo) Opção de Ban ao Nick\: [b]$helpserv(ban)[b] \:\: \[0/1\] - Activo/Inactivo"
- putidx $idx "$script(logo) Período de tempo para o Guest mudar de nick\: [b]$helpserv(time)[b] minutos"
- }
- "limitops" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) -=(. [b]LimitOps[b] .)=-"
- putidx $idx "$script(logo) Limite\: [b]$limit(ops)[b] Operadores"
- }
- "ctcp" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) Replies Actuais\:"
- putidx $idx "$script(logo) finger : [b]${ctcp-finger}[b]"
- putidx $idx "$script(logo) userinfo : [b]${ctcp-userinfo}[b]"
- putidx $idx "$script(logo) version : [b]${ctcp-version}[b]"
- }
- "default" {
- putcmdlog "#$hand# chantools $arg"
- putidx $idx "$script(logo) .chantools <script>"
- }
- }
- }
- if {[set loadedtext [join [lsort [array names loaded]] ", "]] ne ""} {
- putlog "-- $script(logo) Componentes carregados: $loadedtext"
- }
- #EOF!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement