Advertisement
Guest User

Untitled

a guest
Feb 6th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 77.05 KB | None | 0 0
  1. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  2. # ____ _ _____ _ ____ _ #
  3. # / ___| |__ __ _ _ _|_ _|__ ___ | |___ __ _|___ \ / | #
  4. # | | | '_ \ / _` | '_ \| |/ _ \ / _ \| / __| \ \ / / __) | | | #
  5. # | |___| | | | (_| | | | | | (_) | (_) | \__ \ \ V / / __/ _| | #
  6. # \____|_| |_|\__,_|_| |_|_|\___/ \___/|_|___/ \_/ |_____(_)_| #
  7. # #
  8. # Moonspell www.pthelp.org moon@pthelp.org #
  9. # #
  10. # Script desenvolvido por Filipe Silva. #
  11. # Bugs, sugestões, opiniões, comentarios: enviem para moon@pthelp.org #
  12. # #
  13. # partyline: .chantools #
  14. # msg: !ajuda #
  15. # #
  16. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  17. # -=(. Optools .)=- # Comandos de Operador, totalmente Seguro, apenas Nicks #
  18. #-=-=-=-=-=-=-=-=-=-=-=# registados o Podem usar. Para escolher os canais deve #
  19. set optools(enable) 1; # fazer na partyline: .chanset <#canal> +tools #
  20. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  21. # Define a Flag necessaria para usar o Script.
  22. set optools(flag) "o"
  23.  
  24. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  25. # -=(. OnJoin .)=- # Script de boas vindas, a quem entra no canal e anuncios #
  26. set onjoin(enable) 1; # Onjoin. #
  27. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  28. # Ficheiro Onde serao gravadas as Mensagens Onjoin.
  29. set onjoin(db) "text/onjoin.db"
  30.  
  31. # Canal ou Canais em que pretende usar o Script! (separar por espaços)
  32. set onjoin(chan) "#mirc"
  33.  
  34. # [notc/msg] - Notice/Mensagem - Tipo de Onjoin!
  35. set onjoin(type) "notc"
  36.  
  37. # Define a Flag necessaria para usar o Script.
  38. set onjoin(flag) "m"
  39.  
  40. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  41. # -=(. Anti-Pub .)=- # Script Anti-Pub, simples e eficaz, bane publicidade a #
  42. #-=-=-=-=-=-=-=-=-=-=-=# outros Canais. Para que o canal seja verificado pelo #
  43. set antipub(enable) 1; # script faca na partyline: .chanset <#canal> +nochanpub #
  44. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  45. # Defina a sua frase de kick!
  46. set antipub(kick) "Publicidade nao permitida"
  47.  
  48. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  49. # -=(. BadWords .)=- # Script bastante simples, para kickar/banir Asneiras. #
  50. #-=-=-=-=-=-=-=-=-=-=-=# Para que o canal seja verificado pelo script deve #
  51. set bw(enable) 1; # fazer na partyline: .chanset <#canal> +nobadwords #
  52. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  53. # Defina a sua frase de kick!
  54. set bw(kick) "Temos que respeitar os mandamentos do canal!"
  55.  
  56. # Flag necessaria para alterar a lista de palavras.
  57. set bw(flag) "o|o"
  58.  
  59. # Ficheiro Onde serao gravadas as Palavras interditas.
  60. set bw(db) "text/badwords.db"
  61.  
  62. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  63. # -=(. Caps-Lock .)=- # Script para kick excesso Caps-Lock #
  64. #-=-=-=-=-=-=-=-=-=-=-=-=-# Para que o canal seja verificado pelo script deve #
  65. set caps(enable) 1; # fazer na partyline: .chanset <#canal> +nocaps #
  66. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  67. # Defina a sua frase de kick!
  68. set caps(kick) "Maiusculas em excesso significa gritar!!!"
  69.  
  70. # Percentagem m‡xima de caracteres em maiœsculas.
  71. set caps(percent) 70
  72.  
  73. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  74. # -=(. Anti-Idle .)=- # Script Anti-Idle, Funciona para Idle Global, (raw 317) #
  75. #-=-=-=-=-=-=-=-=-=-=-=# Verifica primeiro o idle no Canal. Para escolher canais #
  76. set idle(enable) 1; # sem Idle fazer na partyline: .chanset <#canal> +noidle #
  77. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  78. # Intervalo de tempo para verificar o Idle! (minutos)
  79. set idle(interval) "2"
  80.  
  81. # Maximo de tempo idle permitido no Canal! (minutos)
  82. set idle(time) "20"
  83.  
  84. # [ops/voices/both/all] - Utilizadores aos quais se aplicará o Script.
  85. set idle(users) "all"
  86.  
  87. # Flag para excluir utilizadores da verificacao de Idle.
  88. set idle(antiidle) "C"
  89.  
  90. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  91. # -=(. Anti-Away .)=- # Script Anti-away, (raw 352 & Action) . Para escolher #
  92. #-=-=-=-=-=-=-=-=-=-=-=# canais sem operadores away basta fazer na partyline: #
  93. set away(enable) 0; # .chanset <#canal> +noaway #
  94. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  95. # Intervalo de tempo para verificar o Away! (minutos)
  96. set away(time) "2"
  97.  
  98. # [ops/voices/both] - Utilizadores aos quais se aplicará o Script.
  99. set away(users) "both"
  100.  
  101. # Flag para excluir utilizadores da verificacao de away.
  102. set away(antiaway) "C"
  103.  
  104. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  105. # -=(. AddOps .)=- # Script que facilita adicionar users automaticamente #
  106. set addops(enable) 1; # no ChanServ e Eggdrop ... #
  107. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  108. # Canal onde pretende usar o Script!
  109. set addops(chan) "#mirc"
  110.  
  111. # Define a Flag necessária para usar o Script.
  112. set addops(flag) "m"
  113.  
  114. # Define as Flags que o Utilizador receberá
  115. set addops(dflags) "o"
  116.  
  117. # [0/1] - Inactivo/Activo - Opcao ChanServ (registo na access list - PTnet)
  118. set addops(chanserv) 0
  119.  
  120. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  121. # -=(. HelpServ .)=- # Script de ajuda a Guests, apenas necessario para canais #
  122. set helpserv(enable) 0;# sem Secure Mode (PTnet). Ninguem nasce ensinado! #
  123. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  124. # Canal onde pretende usar o Script!
  125. set helpserv(chan) "#mirc"
  126.  
  127. # [0/1] - Ligar/Desligar - Opcao de Ban!
  128. set helpserv(ban) "0"
  129.  
  130. # Periodo de tempo que o Guest tera para mudar de nick antes de ser Banido!
  131. set helpserv(time) "5"
  132.  
  133. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  134. # -=(. LimitOps .)=- # Script para Limitar o Numero de Opados num determinado #
  135. #-=-=-=-=-=-=-=-=-=-=-=# canal. (As Oplandias estao fora de moda.) #
  136. set limit(enable) 0; # para adicionar canais: .chanset <#canal> +limitops #
  137. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  138. # Numero Maximo de Operadores (Bots correctamente definidos (+b) nao contam)
  139. set limit(ops) 5
  140.  
  141. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  142. # -=(. CTCP .)=- # Script que permite alterar os CTCP replies do Eggdrop #
  143. set ctcp(enable) 1; # #
  144. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  145.  
  146. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  147. # -=(. uHost Mask .)=- # Escolher o tipo de ban usado em todos os scripts #
  148. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  149. set script(bantype) 4; # #
  150. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=# #
  151. # 1) nick!*@* #
  152. # 2) *!*@some.domain.com #
  153. # 3) *nick*!*@some.domain.com #
  154. # 4) *!*ident@some.domain.com #
  155. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  156.  
  157. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  158. # -=(. FAQ .)=- # Respostas as possiveis duvidas que possam surgir #
  159. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  160. # P: Para que serve este Script ? #
  161. # R: Este script, e a compilacao de varios Scripts com funcoes variadas #
  162. # cada script tem uma breve descricao no respectivo cabecalho. #
  163. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  164. # P: O que e uma Flag? #
  165. # R: Flag e o nome dado ao estatuto(s) que cada Utilizador do Eggdrop tem, para #
  166. # mais informacoes sobre cada uma delas faz (.help whois) na PartyLine do bot.#
  167. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  168. # P: O que quer dizer Idle ? #
  169. # R: Idle e o tempo de inactividade de um cliente em relacao ao seu servidor, #
  170. # ou seja, um utilizador que nao envia nenhuma Informacao durante "X" tempo, #
  171. # esse "X" corresponde ao Idle. #
  172. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  173. # P: Eu tenho uma duvida diferente, onde posso obter ajuda ? #
  174. # R: Nesse caso, podera sempre pedir ajuda no canal #Eggdrop (irc.ptnet.org), e #
  175. # #Egg (irc.brasnet.org), canais pertencentes ao GUPE (Grupo de Utilizadores #
  176. # Portugueses de Eggdrops), ou directamente comigo. #
  177. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  178. # Copyright © 1997-2015 by Filipe Silva - Moonspell <moon@pthelp.org>. #
  179. # #
  180. # Permission to use, copy, modify, and/or distribute this software for any #
  181. # purpose with or without fee is hereby granted, provided that the above #
  182. # copyright notice and this permission notice appear in all copies. #
  183. # #
  184. # THE SOFTWARE IS PROVIDED ÒAS ISÓ AND MOONSPELL DISCLAIMS ALL WARRANTIES WITH #
  185. # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY #
  186. # AND FITNESS. IN NO EVENT SHALL MOONSPELL BE LIABLE FOR ANY SPECIAL, DIRECT, #
  187. # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM #
  188. # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR #
  189. # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR #
  190. # PERFORMANCE OF THIS SOFTWARE. #
  191. # #
  192. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  193. ### Nao alterar nada a partir daqui...
  194. #
  195. proc u {} {return };# underline code
  196. proc r {} {return };# reverse code
  197. proc b {} {return };# bold code
  198. proc c {} {return };# color code
  199. proc o {} {return };# reset attributes code
  200. #
  201. set script(logo) [join [lrange [split "[b]([b]ChanTools[b])[b][u]:[u]"] 0 end]]
  202. set script(version) "v2.1.1b"
  203. set script(copyright) "(c) 1997-2015 Moonspell <moon@pthelp.org>"
  204.  
  205. putlog "## $script(logo) $script(version) $script(copyright) - Activo!"
  206.  
  207. bind chon - * ct:chon
  208.  
  209. proc ct:chon {hand idx} {
  210. global script
  211. if {[matchattr $hand mnt]} {
  212. putidx $idx " "
  213. putidx $idx "## $script(logo) $script(version) $script(copyright) - Activo!"
  214. putidx $idx " "
  215. }
  216. }
  217.  
  218. set sub(strip) 0
  219. set sub(raw) 0
  220.  
  221. ### -=(. Optools .)=- BINDS/PROCS:
  222.  
  223. if { $optools(enable) eq "1" } {
  224.  
  225. # Variaveis especificas do modulo.
  226.  
  227. setudef flag tools
  228. set sub(raw) 1
  229.  
  230. #Binds
  231. bind pub $optools(flag) !up pub:up
  232. bind pub $optools(flag) !down pub:down
  233. bind pub $optools(flag) !middle pub:middle
  234. #bind pub $optools(flag) +o pub:op
  235. #bind pub $optools(flag) !op pub:op
  236. #bind pub $optools(flag) -o pub:deop
  237. #bind pub $optools(flag) !deop pub:deop
  238. #bind pub $optools(flag) +v pub:voice
  239. bind pub $optools(flag) !voice pub:voice
  240. #bind pub $optools(flag) -v pub:devoice
  241. bind pub $optools(flag) !devoice pub:devoice
  242. #bind pub $optools(flag) !kick pub:kick
  243. #bind pub $optools(flag) !k pub:kick
  244. #bind pub $optools(flag) +b pub:ban
  245. #bind pub $optools(flag) !ban pub:ban
  246. #bind pub $optools(flag) !b pub:ban
  247. #bind pub $optools(flag) -b pub:unban
  248. #bind pub $optools(flag) !unban pub:unban
  249. #bind pub $optools(flag) !ub pub:unban
  250. #bind pub $optools(flag) !topic pub:topic
  251. #bind pub $optools(flag) !t pub:topic
  252.  
  253. #Procs
  254.  
  255. proc pub:up {nick uhost hand chan text} {
  256. global whois optools services script
  257. if {[channel get $chan tools]} {
  258. if {$services(on) eq "no"} {
  259. if {![isid $nick]} {
  260. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  261. return 0
  262. } else {
  263. set whois up
  264. set optools(chan) $chan
  265. raw:307 from 307 "$::botnick $nick"
  266. }
  267. } else {
  268. set whois up
  269. set optools(chan) $chan
  270. set reg no
  271. go:whois $nick
  272. }
  273. }
  274. }
  275.  
  276. proc pub:middle {nick uhost hand chan text} {
  277. global whois optools services script
  278. if {[channel get $chan tools]} {
  279. if {$services(on) eq "no"} {
  280. if {![isid $nick]} {
  281. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  282. return 0
  283. } else {
  284. set whois middle
  285. set optools(chan) $chan
  286. raw:307 from 307 "$::botnick $nick"
  287. }
  288. } else {
  289. set whois middle
  290. set optools(chan) $chan
  291. set reg no
  292. go:whois $nick
  293. }
  294. }
  295. }
  296.  
  297. proc pub:down {nick uhost hand chan text} {
  298. if {[channel get $chan tools]} {
  299. pushmode $chan -v $nick
  300. pushmode $chan -o $nick
  301. flushmode $chan
  302. }
  303. }
  304.  
  305. proc pub:op {nick uhost hand chan text} {
  306. global whois whom optools services script
  307. if {[channel get $chan tools]} {
  308. if {$services(on) eq "no"} {
  309. if {![isid $nick]} {
  310. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  311. return 0
  312. } else {
  313. set whom [lrange [split $text] 0 end]
  314. set whois op
  315. set optools(chan) $chan
  316. raw:307 from 307 "$::botnick $nick"
  317. }
  318. } else {
  319. set whom $text
  320. set whois op
  321. set optools(chan) $chan
  322. set reg no
  323. go:whois $nick
  324. }
  325. }
  326. }
  327.  
  328. proc pub:deop {nick uhost hand chan text} {
  329. global whois whom optools services script
  330. if {[channel get $chan tools]} {
  331. if {$services(on) eq "no"} {
  332. if {![isid $nick]} {
  333. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  334. return 0
  335. } else {
  336. set whom [lrange [split $text] 0 end]
  337. set whois deop
  338. set optools(chan) $chan
  339. raw:307 from 307 "$::botnick $nick"
  340. }
  341. } else {
  342. set whom $text
  343. set whois deop
  344. set optools(chan) $chan
  345. set reg no
  346. go:whois $nick
  347. }
  348. }
  349. }
  350.  
  351. proc pub:voice {nick uhost hand chan text} {
  352. global whois whom optools services script
  353. if {[channel get $chan tools]} {
  354. if {$services(on) eq "no"} {
  355. if {![isid $nick]} {
  356. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  357. return 0
  358. } else {
  359. set whom [lrange [split $text] 0 end]
  360. set whois voice
  361. set optools(chan) $chan
  362. raw:307 from 307 "$::botnick $nick"
  363. }
  364. } else {
  365. set whom $text
  366. set whois voice
  367. set optools(chan) $chan
  368. set reg no
  369. go:whois $nick
  370. }
  371. }
  372. }
  373.  
  374. proc pub:devoice {nick uhost hand chan text} {
  375. global whois whom optools services script
  376. if {[channel get $chan tools]} {
  377. if {$services(on) eq "no"} {
  378. if {![isid $nick]} {
  379. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  380. return 0
  381. } else {
  382. set whom [lrange [split $text] 0 end]
  383. set whois devoice
  384. set optools(chan) $chan
  385. raw:307 from 307 "$::botnick $nick"
  386. }
  387. } else {
  388. set whom $text
  389. set whois devoice
  390. set optools(chan) $chan
  391. set reg no
  392. go:whois $nick
  393. }
  394. }
  395. }
  396.  
  397. proc pub:kick {nick uhost hand chan text} {
  398. global whois whom reason optools services script
  399. if {[channel get $chan tools]} {
  400. if {$services(on) eq "no"} {
  401. if {![isid $nick]} {
  402. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  403. return 0
  404. } else {
  405. set whom [lindex [split $text] 0]
  406. set reason [join [lrange [split $text] 1 end]]
  407. set whois kick
  408. set optools(chan) $chan
  409. raw:307 from 307 "$::botnick $nick"
  410. }
  411. } else {
  412. set whom [lindex [split $text] 0]
  413. set reason [join [lrange [split $text] 1 end]]
  414. set whois kick
  415. set optools(chan) $chan
  416. set reg no
  417. go:whois $nick
  418. }
  419. }
  420. }
  421.  
  422. proc pub:ban {nick uhost hand chan text} {
  423. global whois host reason whom optools services script
  424. if {[channel get $chan tools]} {
  425. if {$services(on) eq "no"} {
  426. if {![isid $nick]} {
  427. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  428. return 0
  429. } else {
  430. set whom [lindex [split $text] 0]
  431. if {$whom ne ""} {
  432. set host [getchanhost $whom $chan]
  433. set reason [lrange $text 1 end]
  434. set whois ban
  435. set optools(chan) $chan
  436. raw:307 from 307 "$::botnick $nick"
  437. } else {
  438. puthelp "NOTICE $nick :$script(logo) indique o nick que pretende banir"
  439. }
  440. }
  441. } else {
  442. set whom [lindex [split $text] 0]
  443. if {$whom ne ""} {
  444. set host [getchanhost $whom $chan]
  445. set reason [lrange $text 1 end]
  446. set whois ban
  447. set optools(chan) $chan
  448. set reg no
  449. go:whois $nick
  450. } else {
  451. puthelp "NOTICE $nick :$script(logo) indique o nick que pretende banir"
  452. }
  453. }
  454. }
  455. }
  456.  
  457. proc pub:unban {nick uhost hand chan text} {
  458. global whois host optools whom script services
  459. if {[channel get $chan tools]} {
  460. if {$services(on) eq "no"} {
  461. if {![isid $nick]} {
  462. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  463. return 0
  464. } else {
  465. set host [lindex [split $text] 0]
  466. if {$host ne ""} {
  467. set whois unban
  468. set optools(chan) $chan
  469. set whom $nick
  470. raw:307 from 307 "$::botnick $nick"
  471. } else {
  472. puthelp "NOTICE $nick :$script(logo) indique o nick ou host que pretende desbanir"
  473. }
  474. }
  475. } else {
  476. set host [lindex [split $text] 0]
  477. if {$host ne ""} {
  478. set whois unban
  479. set optools(chan) $chan
  480. set whom $nick
  481. set reg no
  482. go:whois $nick
  483. } else {
  484. puthelp "NOTICE $nick :$script(logo) indique o nick ou host que pretende desbanir"
  485. }
  486. }
  487. }
  488. }
  489.  
  490. proc pub:topic {nick uhost hand chan text} {
  491. global whois reg topic optools script services
  492. if {[channel get $chan tools]} {
  493. if {$services(on) eq "no"} {
  494. if {![isid $nick]} {
  495. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  496. return 0
  497. } else {
  498. set topic [join [lrange [split $text] 0 end]]
  499. set whois topic
  500. set optools(chan) $chan
  501. raw:307 from 307 "$::botnick $nick"
  502. }
  503. } else {
  504. set topic [join [lrange [split $text] 0 end]]
  505. set whois topic
  506. set optools(chan) $chan
  507. set reg no
  508. go:whois $nick
  509. }
  510. }
  511. }
  512.  
  513. # Mensagem de carregamento.
  514.  
  515. if { ![info exists optools(on)] } {
  516. putlog "-- $script(logo) Optools - Activado!"
  517. set optools(on) 1
  518. } else {
  519. set loaded(Optools) ""
  520. }
  521.  
  522. }
  523.  
  524. ### -=(. OnJoin .}=- BINDS\PROCS:
  525.  
  526. if { $onjoin(enable) eq "1" } {
  527.  
  528. #Binds
  529. bind pub $onjoin(flag) !onjoin pub:set:onjoin
  530. bind join * * join:get:onjoin
  531.  
  532. #Procs
  533. proc pub:set:onjoin {nick uhost hand chan arg} {
  534. global onjoin script
  535. if {([llength $arg] < 2)} {
  536. puthelp "NOTICE $nick :$script(logo) \002Comando\002\037:\037 !onjoin add|del"
  537. return 0
  538. }
  539. switch [lindex $arg 0] {
  540. "add" {
  541. if {![file exists $onjoin(db)]} {
  542. file mkdir [lindex [split $onjoin(db) /] 0]
  543. }
  544. set msgjoin [join [lrange [split $arg] 1 end]]
  545. set join [open $onjoin(db) a+]
  546. fconfigure $join -translation binary
  547. puts $join $msgjoin
  548. close $join
  549. puthelp "NOTICE $nick :$script(logo) Linha de OnJoin \"$msgjoin\" adicionada com sucesso!"
  550. }
  551. "del" {
  552. if {![file exists $onjoin(db)]} {
  553. puthelp "NOTICE $nick :$script(logo) Não Existem OnJoin definidas."
  554. return 0
  555. }
  556. set del [lindex [split $arg] 1]
  557. if {$del eq "all"} {
  558. exec rm $onjoin(db)
  559. puthelp "NOTICE $nick :$script(logo) Todas as OnJoin foram apagadas!"
  560. return 0
  561. }
  562. set join [open $onjoin(db) r];set joinn [open $onjoin(db).new w]
  563. set count "0"
  564. set alter "0"
  565. while {![eof $join]} {
  566. set curjoin [gets $join]
  567. if {$curjoin ne ""} {
  568. incr count
  569. if {$count ne $del} {
  570. puts $joinn $curjoin
  571. } else {
  572. set alter "1"
  573. }
  574. }
  575. }
  576. close $join
  577. close $joinn
  578. exec mv $onjoin(db).new $onjoin(db)
  579. if {$alter eq "1"} {
  580. if {$count eq "1"} {exec rm $onjoin(db)}
  581. puthelp "NOTICE $nick :$script(logo) Apagada a OnJoin número \002$del\002."
  582. } else {
  583. puthelp "NOTICE $nick :$script(logo) Não é possivel apagar a OnJoin."
  584. }
  585. }
  586. }
  587. }
  588.  
  589. proc join:get:onjoin { nick uhost hand chan } {
  590. global onjoin script
  591. if {(([lsearch -exact [string tolower $onjoin(chan)] [string tolower $chan]] ne -1)||($onjoin(chan) eq "*"))&&(![matchattr $hand b])&&(![isbotnick $nick])} {
  592. if {![file exists $onjoin(db)]} {
  593. return 0
  594. } else {
  595. set join [open $onjoin(db) r]
  596. while {![eof $join]} {
  597. set msgjoin [gets $join]
  598. if {$msgjoin ne ""} {
  599. set msgjoin [join [lrange [split $msgjoin] 0 end]]
  600. switch [string tolower $onjoin(type)] {
  601. "notc" {
  602. if {([lindex $msgjoin 0] eq "off") } {
  603. set msgjoin [join [lrange [split $msgjoin] 1 end]]
  604. puthelp "NOTICE $nick :$msgjoin"
  605. } else {
  606. puthelp "NOTICE $nick :$script(logo) $msgjoin"
  607. }
  608. }
  609. "msg" {
  610. if {([lindex $msgjoin 0] eq "off") } {
  611. set msgjoin [join [lrange [split $msgjoin] 1 end]]
  612. puthelp "PRIVMSG $nick :$msgjoin"
  613. } else {
  614. puthelp "PRIVMSG $nick :$script(logo) $msgjoin"
  615. }
  616. }
  617. }
  618. }
  619. }
  620. close $join
  621. }
  622. }
  623. }
  624.  
  625. # Mensagem de carregamento.
  626.  
  627. if { ![info exists onjoin(on)] } {
  628. putlog "-- $script(logo) OnJoin - Activado!"
  629. set onjoin(on) 1
  630. } else {
  631. set loaded(OnJoin) ""
  632. }
  633.  
  634. }
  635.  
  636. ### -=(. Anti-Pub .)=- BINDS/PROCS:
  637.  
  638. if { $antipub(enable) eq "1" } {
  639.  
  640. # Variaveis especificas do modulo.
  641.  
  642. setudef flag nochanpub
  643. set sub(strip) 1
  644. set antipub(interval) 60
  645.  
  646. # Binds
  647. bind pubm - "* *#*" chan:pub
  648. bind notc - * notc:pub
  649. bind ctcp - ACTION act:pub
  650.  
  651. # Procs
  652. proc chan:pub {nick uhost hand chan arg} {
  653. global antipub script
  654. set arg [strip:codes $arg]
  655. if {([regexp "#\[a-zA-Z0-9\]+" $arg])&&([channel get $chan nochanpub])} {
  656. set pattern [lindex [string range $arg [string first # $arg] end ] 0]
  657. if {[string match -nocase *[string tolower $pattern] [string tolower $chan]] eq "1"} {
  658. foreach word [split $arg] {
  659. if {[string match [string tolower "*#*"] $word]} {
  660. append words "$word "
  661. }
  662. }
  663. foreach bad [split $words] {
  664. if {![string match -nocase *[string tolower $bad]* [string tolower $chan]] eq "1"} {
  665. if {![matchattr $hand f|f $chan]||![isop $nick $chan]} {
  666. ban:proc:antipub $nick $uhost $hand $chan $arg
  667. }
  668. }
  669. }
  670. } elseif {[matchattr $hand f|f $chan]} {
  671. } elseif {[isop $nick $chan]} {
  672. } else {
  673. ban:proc:antipub $nick $uhost $hand $chan $arg
  674. }
  675. }
  676. }
  677.  
  678. proc ban:proc:antipub {nick uhost hand chan args} {
  679. global antipub script
  680. if {[validuser "1$chan"] eq 0} {
  681. adduser "1$chan"
  682. chattr "1$chan" +B-fhpvom
  683. setuser "1$chan" PASS chantools
  684. setuser "1$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
  685. }
  686. if {[validuser "2$chan"] eq 0} {
  687. adduser "2$chan"
  688. chattr "2$chan" +B-fhpvom
  689. setuser "2$chan" PASS chantools
  690. setuser "2$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
  691. }
  692. foreach antipubtimer [timers] {
  693. if {[string equal -nocase clear:hosts [lindex $antipubtimer 1]]} {
  694. killtimer [lindex $antipubtimer 2]
  695. break
  696. }
  697. }
  698. set host [uhost:mask $nick $uhost 4]
  699. set nmask "${nick}!*@*"
  700. set uchan [nick2hand $nick $chan]
  701. set cat 0
  702. if {[matchattr $uchan B]} {
  703. if {[string match -nocase "*$host*" [getuser "1$chan" HOSTS]] eq 1 && [getuser "1$chan" HOSTS] ne ""} {
  704. set cat 1
  705. }
  706. if {[string match -nocase "*$host*" [getuser "2$chan" HOSTS]] eq 1 && [getuser "2$chan" HOSTS] ne ""} {
  707. set cat 2
  708. }
  709. switch $cat {
  710. "0" {
  711. setuser "1$chan" HOSTS $host
  712. setuser "1$chan" HOSTS $nmask
  713. putkick $chan $nick "$antipub(kick) [b]\[1 de 3\][b]"
  714. }
  715. "1" {
  716. setuser "2$chan" HOSTS $host
  717. setuser "2$chan" HOSTS $nmask
  718. delhost "1$chan" $host
  719. delhost "1$chan" $nmask
  720. putkick $chan $nick "$antipub(kick) [b]\[2 de 3\][b]"
  721. }
  722. "2" {
  723. delhost "2$chan" $host
  724. delhost "2$chan" $nmask
  725. set reason "$antipub(kick) [b]\[3 de 3\][b]"
  726. set reason [join [lrange [split $reason] 0 end]]
  727. ban:proc:new $nick $uhost $chan $script(bantype) $reason
  728. }
  729. }
  730. } else {
  731. setuser "1$chan" HOSTS $host
  732. setuser "1$chan" HOSTS $nmask
  733. putkick $chan $nick "$antipub(kick) [b]\[1 de 3\][b]"
  734. }
  735. timer $antipub(interval) clear:hosts
  736. }
  737.  
  738. proc notc:pub {nick uhost hand args chan} {
  739. if {[string tolower $chan] ne [string tolower $::botnick]} {
  740. if {[string match "*#*" [string tolower $args]]} {
  741. chan:pub $nick $uhost $hand $chan $args
  742. }
  743. }
  744. }
  745.  
  746. proc act:pub {nick uhost hand chan key args} {
  747. if {[string tolower $chan] ne [string tolower $::botnick]} {
  748. if {[string match "*#*" [string tolower $args]]} {
  749. chan:pub $nick $uhost $hand $chan $args
  750. }
  751. }
  752. }
  753.  
  754. # Mensagem de carregamento.
  755.  
  756. if { ![info exists antipub(on)] } {
  757. putlog "-- $script(logo) Anti-Pub - Activado!"
  758. set antipub(on) 1
  759. } else {
  760. set loaded(Anti-Pub) ""
  761. }
  762.  
  763. }
  764.  
  765. ### -=(. BadWords .)=- LISTA/BINDS/PROCS:
  766.  
  767. if { $bw(enable) eq "1" } {
  768.  
  769. # Variaveis especificas do modulo.
  770.  
  771. setudef flag nobadwords
  772. set sub(strip) 1
  773. set bw_array() ""
  774. set bw_count 0
  775. set bw(interval) 60
  776.  
  777. # Binds
  778. bind pubm - * pubm:bw
  779. bind ctcp - ACTION act:bw
  780. bind notc - * notc:bw
  781. bind msg * !bw msg:bw:options
  782. bind dcc $bw(flag) bw dcc:bw:options
  783.  
  784. # Memory
  785. if { [file exists $bw(db)] } {
  786. set fd [open $bw(db) r]
  787. while { ![eof $fd] } {
  788. set bw_array($bw_count) [gets $fd]
  789. incr bw_count
  790. }
  791. close $fd
  792. }
  793.  
  794. # Procs
  795. proc dcc:bw:options {hand idx arg} {
  796. global script bw bw_array bw_count
  797. putcmdlog "#$hand# bw $arg"
  798. set reply [lindex [split $arg] 0]
  799. if {$reply eq ""} {
  800. putidx $idx "$script(logo) [b]comando[b][u]:[u] .bw add/del/list \[palavra\]"
  801. } else {
  802. switch [string tolower [lindex $arg 0]] {
  803. "add" {
  804. if {([llength $arg] < 2)} {
  805. putidx $idx "$script(logo) [b]comando[b][u]:[u] .bw add <palavra>"
  806. return 0
  807. }
  808. set arg [string tolower [join [lrange [split $arg] 1 end]]]
  809. for {set i 0} {$i < $bw_count} {incr i} {
  810. if { $arg eq $bw_array($i) } {
  811. putidx $idx "$script(logo) [b]palavra[b][u]:[u] '$arg' ja existe"
  812. return 0
  813. }
  814. }
  815. set bw_array($bw_count) "$arg"
  816. incr bw_count
  817. putidx $idx "$script(logo) [b]adicionada[b][u]:[u] '$arg'"
  818. bw:writedb
  819. return 0
  820. }
  821. "del" {
  822. if {([llength $arg] < 2)} {
  823. putidx $idx "$script(logo) [b]comando[b][u]:[u] .bw del <palavra>"
  824. return 0
  825. }
  826. set arg [string tolower [join [lrange [split $arg] 1 end]]]
  827. set bw(deleted) "no"
  828. for {set i 0} {$i < $bw_count} {incr i} {
  829. if { $arg eq $bw_array($i) } {
  830. set bw_array($i) ""
  831. putidx $idx "$script(logo) [b]eliminada[b][u]:[u] '$arg'"
  832. set bw(deleted) "yes"
  833. }
  834. }
  835. if { $bw(deleted) eq "no" } {
  836. putidx $idx "$script(logo) [b]palavra[b][u]:[u] '$arg' nao existe"
  837. }
  838. bw:writedb
  839. return 0
  840. }
  841. "list" {
  842. set bw_txforb ""
  843. set bw_countwords 0
  844. for {set i 0} {$i < $bw_count} {incr i} {
  845. if { $bw_array($i) ne "" } {
  846. set bw_txforb "$bw_txforb $bw_array($i)"
  847. incr bw_countwords
  848. }
  849. }
  850. if { $bw_countwords eq 0 } {
  851. putidx $idx "$script(logo) <Lista vazia>"
  852. } else {
  853. putidx $idx "$script(logo) [b]palavras[b][u]:[u] $bw_txforb"
  854. }
  855. return 0
  856. }
  857. }
  858. }
  859. }
  860.  
  861. proc msg:bw:options {nick uhost hand arg} {
  862. global script bw bw_array bw_count
  863. if {[passwdok $nick [lindex $arg 1]] && [matchattr $hand $bw(flag)]} {
  864. switch [string tolower [lindex $arg 0]] {
  865. "add" {
  866. if {([llength $arg] < 3)} {
  867. puthelp "PRIVMSG $nick :$script(logo) [b]comando[b][u]:[u] !bw add <password> <palavra>"
  868. return 0
  869. }
  870. set arg [string tolower [join [lrange [split $arg] 2 end]]]
  871. putcmdlog "$script(logo) $nick ($uhost) usou !bw add (palavra : '$arg')"
  872. for {set i 0} {$i < $bw_count} {incr i} {
  873. if { $arg eq $bw_array($i) } {
  874. puthelp "PRIVMSG $nick :$script(logo) [b]palavra[b][u]:[u] '$arg' ja existe"
  875. return 0
  876. }
  877. }
  878. set bw_array($bw_count) "$arg"
  879. incr bw_count
  880. puthelp "PRIVMSG $nick :$script(logo) [b]adicionada[b][u]:[u] '$arg'"
  881. bw:writedb
  882. return 0
  883. }
  884. "del" {
  885. if {([llength $arg] < 3)} {
  886. puthelp "PRIVMSG $nick :$script(logo) [b]comando[b][u]:[u] !bw del <password> <palavra>"
  887. return 0
  888. }
  889. set arg [string tolower [join [lrange [split $arg] 2 end]]]
  890. set bw(deleted) "no"
  891. putcmdlog "$script(logo) $nick ($uhost) usou !bw del (palavra : '$arg')"
  892. for {set i 0} {$i < $bw_count} {incr i} {
  893. if { $arg eq $bw_array($i) } {
  894. set bw_array($i) ""
  895. puthelp "PRIVMSG $nick :$script(logo) [b]eliminada[b][u]:[u] '$arg'"
  896. set bw(deleted) "yes"
  897. }
  898. }
  899. if { $bw(deleted) eq "no" } {
  900. puthelp "PRIVMSG $nick :$script(logo) [b]palavra[b][u]:[u] '$arg' nao existe"
  901. }
  902. bw:writedb
  903. return 0
  904. }
  905. "list" {
  906. putcmdlog "$script(logo) $nick ($uhost) usou !list"
  907. set bw_txforb ""
  908. set bw_countwords 0
  909. for {set i 0} {$i < $bw_count} {incr i} {
  910. if { $bw_array($i) ne "" } {
  911. set bw_txforb "$bw_txforb $bw_array($i)"
  912. incr bw_countwords
  913. }
  914. }
  915. if { $bw_countwords eq 0 } {
  916. puthelp "PRIVMSG $nick :$script(logo) <Lista vazia>"
  917. } else {
  918. puthelp "PRIVMSG $nick :$script(logo) [b]palavras[b][u]:[u] $bw_txforb"
  919. }
  920. return 0
  921. }
  922. }
  923. } else {
  924. puthelp "PRIVMSG $nick :$script(logo) [b]comando[b][u]:[u] !bw <add/del/list> <password> \[palavra\]"
  925. }
  926. }
  927.  
  928. proc pubm:bw {nick uhost hand chan args} {
  929. global bw bw_array bw_count
  930. if {[channel get $chan nobadwords]} {
  931. if { ([isop $nick $chan])||([isw $nick $chan o]) } {
  932. return 0
  933. }
  934. set args [join $args]
  935. set args [strip:codes $args]
  936. for {set i 0} {$i < $bw_count} {incr i} {
  937. if { $bw_array($i) ne "" } {
  938. set badw [join $bw_array($i)]
  939. if {[string match [string tolower $badw] [string tolower $args]]} {
  940. ban:proc:bw $nick $uhost $hand $chan $badw
  941. }
  942. }
  943. }
  944. }
  945. }
  946.  
  947. proc ban:proc:bw {nick uhost hand chan args} {
  948. global bw script
  949. if {[validuser "1$chan"] eq 0} {
  950. adduser "1$chan"
  951. chattr "1$chan" +B-fhpvom
  952. setuser "1$chan" PASS chantools
  953. setuser "1$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
  954. }
  955. if {[validuser "2$chan"] eq 0} {
  956. adduser "2$chan"
  957. chattr "2$chan" +B-fhpvom
  958. setuser "2$chan" PASS chantools
  959. setuser "2$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
  960. }
  961. foreach bwtimer [timers] {
  962. if {[string equal -nocase clear:hosts [lindex $bwtimer 1]]} {
  963. killtimer [lindex $bwtimer 2]
  964. break
  965. }
  966. }
  967. set host [uhost:mask $nick $uhost 4]
  968. set nmask "${nick}!*@*"
  969. set badw [string tolower $args]
  970. set badw [regsub -all {\{|\}} $badw ""]
  971. set uchan [nick2hand $nick $chan]
  972. set cat 0
  973. if {[matchattr $uchan B]} {
  974. if {[string match -nocase "*$host*" [getuser "1$chan" HOSTS]] eq 1 && [getuser "1$chan" HOSTS] ne ""} {
  975. set cat 1
  976. }
  977. if {[string match -nocase "*$host*" [getuser "2$chan" HOSTS]] eq 1 && [getuser "2$chan" HOSTS] ne ""} {
  978. set cat 2
  979. }
  980. switch $cat {
  981. "0" {
  982. setuser "1$chan" HOSTS $host
  983. setuser "1$chan" HOSTS $nmask
  984. putkick $chan $nick "$bw(kick) ($badw) [b]\[1 de 3\][b]"
  985. }
  986. "1" {
  987. setuser "2$chan" HOSTS $host
  988. setuser "2$chan" HOSTS $nmask
  989. delhost "1$chan" $host
  990. delhost "1$chan" $nmask
  991. putkick $chan $nick "$bw(kick) ($badw) [b]\[2 de 3\][b]"
  992. }
  993. "2" {
  994. delhost "2$chan" $host
  995. delhost "2$chan" $nmask
  996. set reason "$bw(kick) [b]\[3 de 3\][b]"
  997. set reason [join [lrange [split $reason] 0 end]]
  998. ban:proc:new $nick $uhost $chan $script(bantype) $reason
  999. }
  1000. }
  1001. } else {
  1002. setuser "1$chan" HOSTS $host
  1003. setuser "1$chan" HOSTS $nmask
  1004. putkick $chan $nick "$bw(kick) ($badw) [b]\[1 de 3\][b]"
  1005. }
  1006. timer $bw(interval) clear:hosts
  1007. }
  1008.  
  1009. proc act:bw {nick uhost hand chan key args} {
  1010. if {[string tolower $chan] ne [string tolower $::botnick]} {
  1011. pubm:bw $nick $uhost $hand $chan $args
  1012. }
  1013. }
  1014.  
  1015. proc notc:bw {nick uhost hand args chan} {
  1016. if {[string tolower $chan] ne [string tolower $::botnick]} {
  1017. set tchan [lindex [split $chan "@"] 1]
  1018. if {($tchan ne "") && ([channel get $tchan nobadwords] eq "1")} {
  1019. pubm:bw $nick $uhost $hand $tchan $args
  1020. } else {
  1021. pubm:bw $nick $uhost $hand $chan $args
  1022. }
  1023. }
  1024. }
  1025.  
  1026. proc bw:writedb {} {
  1027. global bw_array bw_count bw
  1028. if {![file exists $bw(db)]} {
  1029. file mkdir [lindex [split $bw(db) /] 0]
  1030. }
  1031. set fd [open $bw(db) w]
  1032. fconfigure $fd -translation binary
  1033. for {set i 0} {$i < $bw_count} {incr i} {
  1034. if { $bw_array($i) ne "" } {
  1035. puts $fd "$bw_array($i)"
  1036. }
  1037. }
  1038. close $fd
  1039. return 0
  1040. }
  1041.  
  1042. # Mensagem de carregamento.
  1043.  
  1044. if { ![info exists bw(on)] } {
  1045. putlog "-- $script(logo) BadWords - Activado!"
  1046. set bw(on) 1
  1047. } else {
  1048. set loaded(BadWords) ""
  1049. }
  1050.  
  1051. }
  1052.  
  1053. ### -=(. Anti-Idle .)=- PROCS:
  1054.  
  1055. if { $idle(enable) eq "1" } {
  1056.  
  1057. # Variaveis especificas do modulo.
  1058.  
  1059. setudef flag noidle
  1060. set sub(raw) 1
  1061.  
  1062. #Procs
  1063.  
  1064. proc idle:check { } {
  1065. global idle whois services
  1066. set whois idlemode
  1067. if {$services(on) eq "no"} {
  1068. return 0
  1069. }
  1070. foreach chan [channels] {
  1071. if {[channel get $chan noidle]} {
  1072. set idle(ujoin) [getchanjoin $::botnick $chan]
  1073. set curTime [unixtime]
  1074. set idle(join) [expr {$curTime - $idle(ujoin)}]
  1075. set idle(times) [expr {$idle(time) * 60}]
  1076. foreach nick [chanlist $chan] {
  1077. if {![isw $nick $chan b] && ![isw $nick $chan $idle(antiidle)] && ![isbotnick $nick]} {
  1078. switch [lindex $idle(users) 0] {
  1079. "ops" {
  1080. if {[isop $nick $chan]} {
  1081. if {([getchanidle $nick $chan]>$idle(time))||$idle(times) > $idle(join)} {
  1082. go:whois $nick
  1083. }
  1084. }
  1085. }
  1086. "voices" {
  1087. if {[isvoice $nick $chan]} {
  1088. if {([getchanidle $nick $chan]>$idle(time))||$idle(times) > $idle(join)} {
  1089. go:whois $nick
  1090. }
  1091. }
  1092. }
  1093. "both" {
  1094. if {[isop $nick $chan] || [isvoice $nick $chan]} {
  1095. if {([getchanidle $nick $chan]>$idle(time))||$idle(times) > $idle(join)} {
  1096. go:whois $nick
  1097. }
  1098. }
  1099. }
  1100. "all" {
  1101. if {[isop $nick $chan] || [isvoice $nick $chan]} {
  1102. if {([getchanidle $nick $chan]>$idle(time))||$idle(times) > $idle(join)} {
  1103. go:whois $nick
  1104. }
  1105. }
  1106. if {([isw $nick $chan o]) && ![isop $nick $chan] || ([isw $nick $chan v]) && ![isw $nick $chan o] && ![isvoice $nick $chan] && ![isop $nick $chan]} {
  1107. go:whois $nick
  1108. }
  1109. }
  1110. }
  1111. }
  1112. }
  1113. }
  1114. }
  1115. if {![string match "*idle:check*" [timers]]} {
  1116. timer $idle(interval) idle:check
  1117. }
  1118. }
  1119.  
  1120. if {![string match "*idle:check*" [timers]]} {
  1121. timer $idle(interval) idle:check
  1122. }
  1123.  
  1124. # Mensagem de carregamento.
  1125.  
  1126. if { ![info exists idle(on)] } {
  1127. putlog "-- $script(logo) Anti-Idle - Activado!"
  1128. set idle(on) 1
  1129. } else {
  1130. set loaded(Anti-Idle) ""
  1131. }
  1132.  
  1133.  
  1134. }
  1135.  
  1136. ### -=(. Anti-Away .)=- BINDS/PROCS:
  1137.  
  1138. if { $away(enable) eq "1" } {
  1139.  
  1140. # Variaveis especificas do modulo.
  1141.  
  1142. setudef flag noaway
  1143. set sub(raw) 1
  1144.  
  1145. #Binds
  1146. bind ctcp - ACTION act:away
  1147.  
  1148. #Procs
  1149. proc act:away {nick uhost hand chan key arg} {
  1150. global away services
  1151. if {$services(on) eq "no"||![channel get $chan noaway]} {
  1152. return 0
  1153. }
  1154. if {[string tolower $chan] ne [string tolower $::botnick]} {
  1155. if {[isop $nick $chan] && ![isw $nick $chan $away(antiaway)]} {
  1156. if {[string match "*away*" $arg] && ![string match "*back" $arg] && ![string match "*voltou*" $arg]} {
  1157. putserv "WHO $chan"
  1158. }
  1159. }
  1160. }
  1161. }
  1162.  
  1163. if {![string match "*away:demode*" [timers]]} {
  1164. timer $away(time) away:demode
  1165. }
  1166.  
  1167. proc away:demode {} {
  1168. global away services
  1169. if {![string match "*away:demode*" [timers]]} {
  1170. timer $away(time) away:demode
  1171. }
  1172. if {$services(on) eq "yes"} {
  1173. foreach chan [channels] {
  1174. if {[channel get $chan noaway]} {
  1175. putserv "WHO $chan"
  1176. }
  1177. }
  1178. }
  1179. }
  1180.  
  1181. # Mensagem de carregamento.
  1182.  
  1183. if { ![info exists away(on)] } {
  1184. putlog "-- $script(logo) Anti-Away - Activado!"
  1185. set away(on) 1
  1186. } else {
  1187. set loaded(Anti-Away) ""
  1188. }
  1189.  
  1190. }
  1191.  
  1192. # -=(. AddOps .)=- BINDS/PROCS:
  1193.  
  1194. if { $addops(enable) eq "1" } {
  1195.  
  1196. #Binds
  1197.  
  1198. bind msg $addops(flag) addop msg:addop
  1199. bind msg $addops(flag) delop msg:delop
  1200.  
  1201. #Procs
  1202.  
  1203. proc msg:addop {nick uhost hand text} {
  1204. global addops script
  1205. set usernick [lindex [split $text] 1]
  1206. set nivel [lindex $text 2]
  1207. set host "*!*[lindex [split $uhost "@"] 0]*@[lindex [split $uhost "@"] 1]"
  1208. set addops(option) "$addops(chanserv)"
  1209. if {([llength $text] >= 2)} {
  1210. if {[validuser $usernick]} {
  1211. set addops(option) "valid"
  1212. }
  1213. if {![passwdok $nick [lindex $text 0]]} {
  1214. set addops(option) "badpw"
  1215. }
  1216. } else {
  1217. set addops(option) "help$addops(chanserv)"
  1218. }
  1219. switch [lindex $addops(option) 0] {
  1220. "0" {
  1221. adduser $usernick $usernick!*@*
  1222. chattr $usernick +$addops(dflags)
  1223. puthelp "PRIVMSG $nick :$script(logo) [b]$usernick[b] Foi Adicionado à lista do canal [b]$addops(chan)[b] com acesso aos meus comandos."
  1224. }
  1225. "1" {
  1226. set nivelt "[regexp -all {^[1-9]$|^1[0-4]$} $nivel nivelt]"
  1227. if {$nivelt ne "1"} {
  1228. puthelp "PRIVMSG $nick :$script(logo) /msg $::botnick addop password \[nick\] [b]\[nivel 1 a 14\][b]"
  1229. } else {
  1230. adduser $usernick $usernick!*@*
  1231. chattr $usernick +$addops(dflags)
  1232. putserv "chanserv access $addops(chan) add $usernick $nivel"
  1233. 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."
  1234. }
  1235. }
  1236. "help0" {
  1237. puthelp "PRIVMSG $nick :$script(logo) /msg $::botnick addop password \[nick\]"
  1238. }
  1239. "help1" {
  1240. puthelp "PRIVMSG $nick :$script(logo) /msg $::botnick addop password \[nick\] \[nivel\]"
  1241. }
  1242. "valid" {
  1243. puthelp "PRIVMSG $nick :$script(logo) [b]$usernick[b] ja existe na minha Lista."
  1244. }
  1245. "badpw" {
  1246. puthelp "PRIVMSG $nick :$script(logo) password errada!"
  1247. }
  1248. }
  1249. }
  1250.  
  1251. proc msg:delop {nick host hand text} {
  1252. global addops script
  1253. set usernick [lindex [split $text] 1]
  1254. if {$text eq "" || [string tolower $text] eq "help"} {
  1255. puthelp "PRIVMSG $nick :$script(logo) /msg $::botnick delop password \[nick\]"
  1256. return;
  1257. }
  1258. if {![passwdok $nick [lindex $text 0]]} {
  1259. puthelp "PRIVMSG $nick :$script(logo) password errada!"
  1260. return 0;
  1261. } else {
  1262. if {![validuser $usernick]} { puthelp "PRIVMSG $nick :$script(logo) [b]$usernick[b] nao existe na minha Lista.";return 0 }
  1263. deluser $usernick
  1264. 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."
  1265. if { $addops(chanserv) eq "1" } { putserv "chanserv access $addops(chan) del $usernick" }
  1266. }
  1267. }
  1268.  
  1269. # Mensagem de carregamento.
  1270.  
  1271. if { ![info exists addops(on)] } {
  1272. putlog "-- $script(logo) AddOps - Activado!"
  1273. set addops(on) 1
  1274. } else {
  1275. set loaded(AddOps) ""
  1276. }
  1277.  
  1278.  
  1279. }
  1280.  
  1281. ### -=). Raws .(=- Script Auxiliar -=). BINDS/PROCS:
  1282.  
  1283. if { $sub(raw) eq "1" } {
  1284.  
  1285. set reg no
  1286. set whois no
  1287. set awaymode no
  1288. set services(nick) "ChanServ"
  1289. set services(host) "PTnet.org"
  1290.  
  1291. #Binds
  1292.  
  1293. bind raw - "301" raw:301 ;# Whois - Away Mode
  1294. bind raw - "302" raw:302 ;# Userhost
  1295. bind raw - "307" raw:307 ;# Whois - registado nickserv
  1296. bind raw - "313" raw:313 ;# Whois - IRC Operator
  1297. bind raw - "314" raw:314 ;# Whowas
  1298. bind raw - "317" raw:317 ;# Whois - Idle Time
  1299. bind raw - "318" raw:318 ;# Whois - /End
  1300. bind raw - "352" raw:352 ;# Who - Away Mode
  1301. bind raw - "369" raw:369 ;# Whowas - /End
  1302. bind raw - "600" raw:600 ;# Watch - Online
  1303. bind raw - "601" raw:601 ;# Watch - Offline
  1304. bind raw - "604" raw:604 ;# Watch Online List/Add
  1305. bind raw - "605" raw:605 ;# Watch Offline List/Add
  1306.  
  1307. #Procs
  1308.  
  1309. proc raw:301 {from key arg} {
  1310. global whois awaymode
  1311. switch [lindex $whois 0] {
  1312. "idlemode" {
  1313. set awaymode yes
  1314. }
  1315. }
  1316. }
  1317.  
  1318. proc raw:302 {from key arg} {
  1319. global script unick whois ident optools
  1320. if {[lindex [split $arg] 2] ne "" } {
  1321. set arg [lindex [split $arg "@"] 1]
  1322. set host [lindex [split $arg "="] 1]
  1323. if {[lindex [split $host "+"] 1] ne ""} {
  1324. set ident [lindex [split $host "+"] 1]
  1325. unban:proc $unick $ident $optools(chan)
  1326. } else {
  1327. set ident [lindex [split $host "-"] 1]
  1328. unban:proc $unick $ident $optools(chan)
  1329. }
  1330. } else {
  1331. set whois whowas
  1332. putserv "WHOWAS $unick"
  1333. }
  1334. }
  1335.  
  1336. proc raw:307 {from key arg} {
  1337. global whois reg script topic
  1338. global optools whom reason host pswd
  1339. switch [lindex $whois 0] {
  1340. "up" {
  1341. set reg yes; set nick [lindex [split $arg] 1]
  1342. if {[matchattr [nick2hand $nick] o]} {
  1343. pushmode $optools(chan) +o $nick
  1344. pushmode $optools(chan) -v $nick
  1345. flushmode $optools(chan)
  1346. }
  1347. }
  1348. "middle" {
  1349. set reg yes; set nick [lindex [split $arg] 1]
  1350. pushmode $optools(chan) +v $nick
  1351. pushmode $optools(chan) -o $nick
  1352. flushmode $optools(chan)
  1353. }
  1354. "op" {
  1355. set reg yes; set nick [lindex [split $arg] 1]
  1356. if {[matchattr [nick2hand $nick] m]} {
  1357. set nochange ""
  1358. if {[llength [split $whom]] eq 0 } { set plus $nick } else { set plus $whom }
  1359. for { set i 0 } { $i < [llength $plus] } { incr i } {
  1360. set whom [lindex [split $plus] $i]
  1361. set whom [join $whom]
  1362. if {[isop $whom $optools(chan)]} {
  1363. set nochange [lappend nochange $whom]
  1364. } else {
  1365. pushmode $optools(chan) +o $whom
  1366. if {[isvoice $whom $optools(chan)]} {
  1367. pushmode $optools(chan) -v $whom
  1368. }
  1369. }
  1370. }
  1371. if {$nochange ne ""} {
  1372. set nochange [join $nochange]
  1373. puthelp "NOTICE $nick :$script(logo) @ detectada para: $nochange"
  1374. }
  1375. flushmode $optools(chan)
  1376. }
  1377. }
  1378. "deop" {
  1379. set reg yes; set nick [lindex [split $arg] 1]
  1380. if {[matchattr [nick2hand $nick] m]} {
  1381. set nochange ""
  1382. set protected ""
  1383. if {[llength [split $whom]] eq 0 } { set plus $nick } else { set plus $whom }
  1384. for { set i 0 } { $i < [llength $plus] } { incr i } {
  1385. set whom [lindex [split $plus] $i]
  1386. set whom [join $whom]
  1387. if {[isop $whom $optools(chan)]} {
  1388. if {([isbotnick $whom]) || ([matchattr $whom b])} {
  1389. set protected [lappend protected $whom]
  1390. } else {
  1391. pushmode $optools(chan) -o $whom
  1392. }
  1393. } else {
  1394. set nochange [lappend nochange $whom]
  1395. }
  1396. }
  1397. if {$nochange ne ""} {
  1398. set nochange [join $nochange]
  1399. puthelp "NOTICE $nick :$script(logo) @ nao foi detectada para: $nochange"
  1400. }
  1401. if {$protected ne ""} {
  1402. set protected [join $protected]
  1403. puthelp "NOTICE $nick :$script(logo) E que tal tentares antes: -o Rob_ ? Deve ser bem mais fácil! ($protected)"
  1404. }
  1405. flushmode $optools(chan)
  1406. }
  1407. }
  1408. "voice" {
  1409. set reg yes; set nick [lindex [split $arg] 1]
  1410. if {[matchattr [nick2hand $nick] o]} {
  1411. set nochange ""
  1412. if {[llength [split $whom]] eq 0 } { set plus $nick } else { set plus $whom }
  1413. for { set i 0 } { $i < [llength $plus] } { incr i } {
  1414. set whom [lindex [split $plus] $i]
  1415. set whom [join $whom]
  1416. if {[isvoice $whom $optools(chan)]} {
  1417. set nochange [lappend nochange $whom]
  1418. } else {
  1419. pushmode $optools(chan) +v $whom
  1420. }
  1421. }
  1422. if {$nochange ne ""} {
  1423. set nochange [join $nochange]
  1424. puthelp "NOTICE $nick :$script(logo) voice detectado para: $nochange"
  1425. }
  1426. flushmode $optools(chan)
  1427. }
  1428. }
  1429. "devoice" {
  1430. set reg yes; set nick [lindex [split $arg] 1]
  1431. if {[matchattr [nick2hand $nick] o]} {
  1432. set nochange ""
  1433. if {[llength [split $whom]] eq 0 } { set plus $nick } else { set plus $whom }
  1434. for { set i 0 } { $i < [llength $plus] } { incr i } {
  1435. set whom [lindex [split $plus] $i]
  1436. set whom [join $whom]
  1437. if {[isvoice $whom $optools(chan)]} {
  1438. pushmode $optools(chan) -v $whom
  1439. } else {
  1440. set nochange [lappend nochange $whom]
  1441. }
  1442. }
  1443. if {$nochange ne ""} {
  1444. set nochange [join $nochange]
  1445. puthelp "NOTICE $nick :$script(logo) voice nao foi detectado para: $nochange"
  1446. }
  1447. flushmode $optools(chan)
  1448. }
  1449. }
  1450. "kick" {
  1451. set reg yes; set nick [lindex [split $arg] 1]
  1452. if {![matchattr $whom o]} {
  1453. if {[isbotnick $whom] || [matchattr $whom b]} {
  1454. puthelp "NOTICE $nick :$script(logo) Porque não vais tentar kickar o Rob_? Deve ser bem mais fácil!"
  1455. } else {
  1456. if {$reason eq ""} {set reason "porta-te bem!"}
  1457. putkick $optools(chan) $whom "[b]([b]$nick[b])[b][u]:[u] $reason"
  1458. }
  1459. } else { puthelp "NOTICE $nick :$script(logo) o nick [b]$whom[b] é de um Utilizador Protegido!"; return 0 }
  1460. }
  1461. "ban" {
  1462. set reg yes; set nick [lindex [split $arg] 1]
  1463. if {([isbotnick $whom])} {
  1464. puthelp "NOTICE $nick :$script(logo) Porque não vais tentar banir o Rob_? Deve ser bem mais fácil!"
  1465. return 0
  1466. }
  1467. if {[onchan $whom $optools(chan)]} {
  1468. if {([matchattr $whom m] || [matchchanattr $whom o $optools(chan)] || [matchattr $whom b]) || [isop $whom $optools(chan)] } {
  1469. puthelp "NOTICE $nick :$script(logo) o nick [b]$whom[b] é de um Utilizador Protegido!"
  1470. return 0
  1471. }
  1472. if {$reason eq ""} {
  1473. set reason "[b]([b]$nick[b])[b][u]:[u] Para a próxima, porta-te bem!"
  1474. }
  1475. set bmask [uhost:mask $whom $host $script(bantype)]
  1476. puthelp "NOTICE $nick :$script(logo) [b]$whom[b] foi banido do canal! ([b]$bmask[b])"
  1477. ban:proc:new $whom $host $optools(chan) $script(bantype) $reason
  1478. } else {
  1479. puthelp "NOTICE $nick :$script(logo) [b]$whom[b] Não está no canal!"
  1480. }
  1481. }
  1482. "unban" {
  1483. set reg yes; set nick [lindex [split $arg] 1]
  1484. if {[string match "*!*@*" [lindex $host 0]]} {
  1485. unban:proc no $host $optools(chan)
  1486. } else { unban:host $host $optools(chan) }
  1487. }
  1488. "topic" {
  1489. set reg yes; set nick [lindex [split $arg] 1]
  1490. putserv "TOPIC $optools(chan) :$topic"
  1491. }
  1492. "idlemode" {
  1493. set reg yes
  1494. }
  1495. "pass" {
  1496. set reg yes; set nick [lindex [split $arg] 1]
  1497. *msg:pass $nick $host $nick $pswd
  1498. }
  1499. }
  1500. }
  1501.  
  1502. proc raw:313 {from key arg} {
  1503. global idle whois reg
  1504. switch [lindex $whois 0] {
  1505. "idlemode" {
  1506. set whois no
  1507. }
  1508. }
  1509. }
  1510.  
  1511. proc raw:314 {from key arg} {
  1512. global whois ident unick optools
  1513. switch [lindex $whois 0] {
  1514. "whowas" {
  1515. set ident [lindex [split $arg] 2]
  1516. set whois no
  1517. unban:proc $unick $ident $optools(chan)
  1518. }
  1519. }
  1520. }
  1521.  
  1522. proc raw:317 {from key arg} {
  1523. global idle whois reg awaymode script
  1524. switch [lindex $whois 0] {
  1525. "idlemode" {
  1526. set nick [lindex $arg 1]
  1527. set idlearg [lindex $arg 2]
  1528. set minutesidle [expr {$idlearg / 60}]
  1529. foreach chan [channels] {
  1530. if {[channel get $chan noidle] && [onchan $nick $chan]} {
  1531. if {($minutesidle > $idle(time)) && ([isop $nick $chan] || [isvoice $nick $chan])} {
  1532. pushmode $chan -o $nick
  1533. pushmode $chan -v $nick
  1534. putcmdlog "$script(logo) -o-v $nick $chan (IDLE)"
  1535. }
  1536. if {![isw $nick $chan L]} { ; # Flag para utilizadores que nao querem ser reOpados.
  1537. if {($minutesidle < $idle(time)) && ![isop $nick $chan] && ![isvoice $nick $chan] && ($reg eq "yes") && ($awaymode eq "off")} {
  1538. if {[isw $nick $chan o]} {
  1539. pushmode $chan +o $nick
  1540. pushmode $chan -v $nick
  1541. putcmdlog "$script(logo) +o-v $nick $chan (IDLE)"
  1542. }
  1543. if {[isw $nick $chan v] && ![isw $nick $chan o]} {
  1544. pushmode $chan +v $nick
  1545. putcmdlog "$script(logo) +v $chan $nick (IDLE)"
  1546. }
  1547. }
  1548. }
  1549. flushmode $chan
  1550. set awaymode off
  1551. }
  1552. }
  1553. }
  1554. }
  1555. }
  1556.  
  1557. proc raw:318 {from key arg} {
  1558. global reg whois script
  1559. set nick [lindex $arg 1]
  1560. set identify "/NickServ IDENTIFY password"
  1561. if {$reg ne "yes"} {
  1562. switch [lindex $whois 0] {
  1563. "up" {
  1564. puthelp "NOTICE $nick :$script(logo) $identify"
  1565. }
  1566. "middle" {
  1567. puthelp "NOTICE $nick :$script(logo) $identify"
  1568. }
  1569. "op" {
  1570. puthelp "NOTICE $nick :$script(logo) $identify"
  1571. }
  1572. "deop" {
  1573. puthelp "NOTICE $nick :$script(logo) $identify"
  1574. }
  1575. "voice" {
  1576. puthelp "NOTICE $nick :$script(logo) $identify"
  1577. }
  1578. "devoice" {
  1579. puthelp "NOTICE $nick :$script(logo) $identify"
  1580. }
  1581. "kick" {
  1582. puthelp "NOTICE $nick :$script(logo) $identify"
  1583. }
  1584. "ban" {
  1585. puthelp "NOTICE $nick :$script(logo) $identify"
  1586. }
  1587. "unban" {
  1588. puthelp "NOTICE $nick :$script(logo) $identify"
  1589. }
  1590. "topic" {
  1591. puthelp "NOTICE $nick :$script(logo) $identify"
  1592. }
  1593. "pass" {
  1594. puthelp "NOTICE $nick :$script(logo) $identify"
  1595. }
  1596. }
  1597. return 0
  1598. }
  1599. }
  1600.  
  1601. proc raw:352 {from key arg} {
  1602. global away script
  1603. if {$away(enable) eq "1"} {
  1604. set nick [lindex $arg 5]
  1605. set chan [lindex $arg 1]
  1606. if {![isbotnick $nick] && ![matchattr $nick $away(antiaway)]} {
  1607. if {[string match *G@* [lindex $arg 6]]||[string match *G+* [lindex $arg 6]]} {
  1608. switch [lindex $away(users) 0] {
  1609. "ops" {
  1610. if {[isop $nick $chan]} {
  1611. putcmdlog "$script(logo) -o $nick $chan (AWAY)"
  1612. pushmode $chan) -o $nick
  1613. }
  1614. }
  1615. "voices" {
  1616. if {[isvoice $nick $chan]} {
  1617. putcmdlog "$script(logo) -v $nick $chan (AWAY)"
  1618. pushmode $chan -v $nick
  1619. }
  1620. }
  1621. "both" {
  1622. if {[isop $nick $chan]} {
  1623. putcmdlog "$script(logo) -o $nick $chan (AWAY)"
  1624. pushmode $chan -o $nick
  1625. }
  1626. if {[isvoice $nick $chan]} {
  1627. putcmdlog "$script(logo) -o $nick $chan (AWAY)"
  1628. pushmode $chan -v $nick
  1629. }
  1630. }
  1631. flushmode $chan
  1632. }
  1633. }
  1634. }
  1635. }
  1636. }
  1637.  
  1638.  
  1639. proc raw:369 {from key arg} {
  1640. global whois ident whom script optools unick
  1641. switch [lindex $whois 0] {
  1642. "whowas" {
  1643. if { [string tolower $unick] eq "last" } {
  1644. unban:last $optools(chan)
  1645. } else {
  1646. puthelp "NOTICE $whom :$script(logo) o nick indicado nao existe ou ja abandonou o servidor ha demasiado tempo."
  1647. }
  1648. set whois no
  1649. }
  1650. }
  1651. }
  1652.  
  1653. proc raw:600 { from key arg } {
  1654. global script services isvalid
  1655. set onnick [lindex $arg 1]
  1656. set nickhost [lindex $arg 3]
  1657. if { $nickhost eq $services(host) } {
  1658. set services(on) "yes"
  1659. set isvalid(off) off
  1660. unset isvalid
  1661. putlog "$script(logo) servicos regressaram."
  1662. }
  1663. }
  1664.  
  1665. proc raw:601 { from key arg } {
  1666. global script services
  1667. set onnick [lindex $arg 1]
  1668. set nickhost [lindex $arg 3]
  1669. if { $nickhost eq $services(host) } {
  1670. set services(on) "no"
  1671. putlog "$script(logo) detectado netsplit dos servicos."
  1672. }
  1673. }
  1674.  
  1675. proc raw:604 { from key arg } {
  1676. global script services isvalid
  1677. set onnick [lindex $arg 1]
  1678. set nickhost [lindex $arg 3]
  1679. if { $nickhost eq $services(host) } {
  1680. set services(on) "yes"
  1681. set isvalid(off) off
  1682. unset isvalid
  1683. putlog "$script(logo) servicos Online"
  1684. }
  1685. }
  1686.  
  1687. proc raw:605 { from key arg } {
  1688. global script services isvalid
  1689. set onnick [lindex $arg 1]
  1690. set nickhost [lindex $arg 3]
  1691. if { $onnick eq $services(nick) } {
  1692. set services(on) "no"
  1693. putlog "$script(logo) servicos Offline."
  1694. }
  1695. }
  1696.  
  1697. #Binds
  1698.  
  1699. bind evnt - init-server watch:services ;# Watch - Activar quando inicia o server.
  1700. bind msg - id msg:isid
  1701. unbind msg - pass *msg:pass
  1702. bind msg - pass secure:msg:pass
  1703.  
  1704. #Procs
  1705.  
  1706. proc watch:services { type } {
  1707. global services
  1708. set services(on) "no"
  1709. putserv "WATCH +$services(nick)"
  1710. }
  1711.  
  1712. proc msg:isid { nick uhost hand arg } {
  1713. global isvalid script
  1714. set ulogin [lindex [split $arg] 0]
  1715. set upass [lindex [split $arg] 1]
  1716. if {[validuser $hand]} {
  1717. if {[llength [split $arg]] ne 2 } {
  1718. puthelp "NOTICE $nick :$script(logo) /msg $::botnick [b]id[b] <login> <password>"
  1719. return
  1720. }
  1721. if {![validuser $ulogin ]} {
  1722. puthelp "NOTICE $nick :$script(logo) Login invalido"
  1723. return
  1724. }
  1725. if {[passwdok $hand ""]} {
  1726. putserv "NOTICE $nick :$script(logo) $ulogin sem password definida."
  1727. return
  1728. }
  1729. if {[passwdok $hand $upass]} {
  1730. if {![isid $nick]} {
  1731. set isvalid([split $nick]) $uhost
  1732. puthelp "NOTICE $nick :$script(logo) Login [b]$hand[b] validado com sucesso"
  1733. } else {
  1734. puthelp "NOTICE $nick :$script(logo) Login [b]$hand[b] ja foi validado anteriormente"
  1735. }
  1736. } else {
  1737. puthelp "NOTICE $nick :$script(logo) password errada"
  1738. }
  1739. } else {
  1740. puthelp "NOTICE $nick :$script(logo) utilizador desconhecido, contacte um administrador do canal para obter ajuda."
  1741. }
  1742. }
  1743.  
  1744.  
  1745. proc isid { nick } {
  1746. global isvalid
  1747. if {[string compare $nick $::botnick] eq 0} {
  1748. return 1
  1749. }
  1750. if {[info exists isvalid($nick)]} {
  1751. return 1
  1752. }
  1753. return 0
  1754. }
  1755.  
  1756. proc secure:msg:pass { nick uhost hand arg } {
  1757. global script reg whois services pswd host
  1758. if {$services(on) eq "yes"} {
  1759. set whois pass
  1760. set reg no
  1761. set pswd [lindex $arg 0]
  1762. set host $uhost
  1763. go:whois $nick
  1764. } else {
  1765. puthelp "NOTICE $nick :$script(logo) servicos indisponiveis, por favor tente mais tarde!"
  1766. }
  1767. }
  1768.  
  1769.  
  1770. }
  1771. ### -=). Strip Codes .(=- Script Auxiliar -=). PROCS:
  1772.  
  1773. if { $sub(strip) eq "1" } {
  1774.  
  1775. #Procs
  1776.  
  1777. proc strip:codes {a} {
  1778. regsub -all -- {\002} $a "" a
  1779. regsub -all -- {\003([0-9][0-9]?(,[0-9][0-9]?)?)?} $a "" a
  1780. regsub -all -- {\017} $a "" a
  1781. regsub -all -- {\026} $a "" a
  1782. regsub -all -- {\037} $a "" a
  1783. regsub -all -- {\.} $a " " a
  1784. regsub -all -- {\!} $a " " a
  1785. regsub -all -- {\,} $a " " a
  1786. regsub -all -- {\?} $a " " a
  1787. regsub -all -- {\:} $a " " a
  1788. regsub -all -- {\;} $a " " a
  1789. return $a
  1790. }
  1791. }
  1792.  
  1793. ### -=(. HelpServ .)=- BINDS/PROCS:
  1794.  
  1795. if { $helpserv(enable) eq 1 } {
  1796.  
  1797. #Binds
  1798.  
  1799. bind join - "$helpserv(chan) guest*!*@*" join:helpserv
  1800. bind msgm - "*mud*pass*" msg:mudpass:helpserv
  1801.  
  1802. #Procs
  1803.  
  1804. proc join:helpserv {nick uhost hand args} {
  1805. global helpserv guest
  1806. puthelp "PRIVMSG $nick :Forma [b]simples[b] de registar um [b]nick[b] (papel e caneta pode ser útil)"
  1807. puthelp "PRIVMSG $nick :1º Escolher\: /nickserv info [b]nick[b] (só o poderá registar se aparecer\: [b]nick[b] nao esta' registado)"
  1808. puthelp "PRIVMSG $nick :2º Mudar de nick\: /nick [b]nick[b]."
  1809. puthelp "PRIVMSG $nick :3º Registar\: /nickserv register [b]password[b] [b]email[b]. Consulte o seu email para concluir o processo."
  1810. puthelp "PRIVMSG $nick :4º Da próxima vez terás que o identificar\: /nickserv identify [b]password[b]."
  1811. puthelp "PRIVMSG $nick :Para mais informações vai a [b]www.pthelp.org[b] ou faz [b]/join #PThelp.[b]"
  1812. set guest $nick
  1813. if { $helpserv(ban) eq "1" } {
  1814. 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."
  1815. timer $helpserv(time) timer:helpserv
  1816. }
  1817. }
  1818.  
  1819. proc timer:helpserv {} {
  1820. global helpserv guest script
  1821. if {[onchan $guest $helpserv(chan)]} {
  1822. 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]"
  1823. set reason [join [lrange [split $reason] 0 end]]
  1824. ban:proc:new $guest $guest $helpserv(chan) 1 $reason
  1825. }
  1826. }
  1827.  
  1828. proc msg:mudpass:helpserv {nick uhost hand args} {
  1829. puthelp "PRIVMSG $nick :Para mudar a password do seu [b]nick[b] faça\: /nickserv set password [b]novapass[b]"
  1830. }
  1831.  
  1832. # Mensagem de carregamento.
  1833.  
  1834. if { ![info exists helpserv(on)] } {
  1835. putlog "-- $script(logo) HelpServ - Activado!"
  1836. set helpserv(on) 1
  1837. } else {
  1838. set loaded(HelpServ) ""
  1839. }
  1840.  
  1841.  
  1842. }
  1843.  
  1844. ### -=(. LimitOps .)=- BINDS/PROCS:
  1845.  
  1846. if { $limit(enable) eq "1" } {
  1847.  
  1848. # Variaveis especificas do modulo.
  1849.  
  1850. setudef flag limitops
  1851.  
  1852. #Binds
  1853.  
  1854. bind mode - "* +o" mode:ops
  1855.  
  1856. #Procs
  1857.  
  1858. proc mode:ops {nick uhost hand chan mode oped} {
  1859. global limit script services
  1860. if {$services(on) eq "no"} {
  1861. return 0
  1862. }
  1863. if {[channel get $chan limitops]} {
  1864. set ops 0
  1865. foreach lnick [chanlist $chan] {
  1866. if {[isw $lnick $chan b]} {
  1867. } elseif {[isop $lnick $chan] && ![isbotnick $lnick] } {
  1868. incr ops
  1869. }
  1870. }
  1871. if { ($ops > $limit(ops)) && (![isw $oped $chan b]) && (![isbotnick $oped]) } {
  1872. putcmdlog "$script(logo) -o $oped $chan (Limit)"
  1873. pushmode $chan -o $oped
  1874. flushmode $chan
  1875. if {[string tolower $nick] eq [string tolower $services(nick)]} {
  1876. puthelp "NOTICE $oped :$script(logo) O canal está Limitado a [b]$limit(ops)[b] Operadores!"
  1877. } else {
  1878. puthelp "NOTICE $nick :$script(logo) O canal está Limitado a [b]$limit(ops)[b] Operadores!"
  1879. }
  1880. }
  1881. }
  1882. }
  1883.  
  1884. # Mensagem de carregamento.
  1885.  
  1886. if { ![info exists limit(on)] } {
  1887. putlog "-- $script(logo) LimitOps - Activado!"
  1888. set limit(on) 1
  1889. } else {
  1890. set loaded(LimitOps) ""
  1891. }
  1892.  
  1893.  
  1894. }
  1895.  
  1896. ### -=(. CTCP .)=- BINDS/PROCS:
  1897.  
  1898. if { $ctcp(enable) eq "1" } {
  1899.  
  1900. #
  1901. set ctcplist {
  1902. "mIRC32 v5.91 K.Mardam-Bey"
  1903. "mIRC v7.32 Khaled Mardam-Bey"
  1904. "mIRC v7.32 Khaled Mardam-Bey"
  1905. "irssi-0.8.17-head - Linux 3.13.0-24-generic x86_64 : Keep it to yourself!"
  1906. "irssi v0.8.15 - running on Linux x86_64"
  1907. "irssi v0.8.16 - running on FreeBSD amd64"
  1908. "irssi v0.8.17 - running on FreeBSD i386"
  1909. "ZNC 0.206+deb2 - http://znc.in"
  1910. "Textual IRC Client: www.textualapp.com Ñ v5.0.1"
  1911. "xchat 2.8.8 Linux 3.14-kali1-amd64 \[x86_64/1.89GHz/SMP\]"
  1912. "mIRCoondas v1.0"
  1913. "WeeChat 1.0.1 (Sep 28 2015)"
  1914. "IRC for Android v2.1.18"
  1915. "BitchX-1.0c19+ by panasync - Linux 2.4.7-10 : Keep it to yourself!"
  1916. }
  1917.  
  1918. #Binds
  1919.  
  1920. bind dcc n ctcp dcc:ctcp
  1921. bind ctcp - version ctcp:reply
  1922. bind ctcp - finger ctcp:reply
  1923. bind ctcp - userinfo ctcp:reply
  1924.  
  1925. #Procs
  1926.  
  1927. proc dcc:ctcp {hand idx arg} {
  1928. global ctcp-version ctcp-finger ctcp-userinfo
  1929. set reply [lindex [split $arg] 0]
  1930. putcmdlog "#$hand# ctcp $arg"
  1931. if {$reply eq ""} {
  1932. putidx $idx "[b]([b]ctcp[b])[b][u]:[u] Replies Actuais\:"
  1933. putidx $idx "[b]([b]ctcp[b])[b][u]:[u] finger : [b]${ctcp-finger}[b]"
  1934. putidx $idx "[b]([b]ctcp[b])[b][u]:[u] userinfo : [b]${ctcp-userinfo}[b]"
  1935. putidx $idx "[b]([b]ctcp[b])[b][u]:[u] version : [b]${ctcp-version}[b]"
  1936. putidx $idx "[b]([b]ctcp[b])[b][u]:[u] Comando: ctcp \[userinfo|finger|version \[reply\]\]"
  1937. } else {
  1938. switch -exact -- [string tolower $reply] {
  1939. "finger" {
  1940. set ctcp-finger [join [lrange [split $arg] 1 end]]
  1941. putidx $idx "[b]([b]ctcp[b])[b][u]:[u] ctcp-finger alterado para [b]\"${ctcp-finger}\"[b]"
  1942. }
  1943. "userinfo" {
  1944. set ctcp-userinfo [join [lrange [split $arg] 1 end]]
  1945. putidx $idx "[b]([b]ctcp[b])[b][u]:[u] ctcp-userinfo alterado para [b]\"${ctcp-userinfo}\"[b]"
  1946. }
  1947. "version" {
  1948. set ctcp-version [join [lrange [split $arg] 1 end]]
  1949. putidx $idx "[b]([b]ctcp[b])[b][u]:[u] ctcp-version alterado para [b]\"${ctcp-version}\"[b]"
  1950. }
  1951. "default" {
  1952. putidx $idx "[b]([b]ctcp[b])[b][u]:[u] Comando: ctcp \[userinfo|finger|version \[reply\]\]"
  1953. }
  1954. }
  1955. }
  1956. }
  1957.  
  1958. if {[string match "*eggdrop*" ${ctcp-version}] eq 1} {
  1959. set ctcprand [lindex $ctcplist [rand [llength $ctcplist]]]
  1960. set ctcp-version $ctcprand
  1961. set ctcp-finger $ctcprand
  1962. set ctcp-userinfo $ctcprand
  1963. }
  1964.  
  1965. proc ctcp:reply {nick uhost hand dest keyword text} {
  1966. global ctcplist ctcp-version ctcp-finger ctcp-userinfo
  1967. set ctcprand [lindex $ctcplist [rand [llength $ctcplist]]]
  1968. switch -exact -- [string tolower $keyword] {
  1969. "version" {
  1970. set ctcp-version $ctcprand
  1971. }
  1972. "finger" {
  1973. set ctcp-finger $ctcprand
  1974. }
  1975. "userinfo" {
  1976. set ctcp-userinfo $ctcprand
  1977. }
  1978. "default" { return 0 }
  1979. }
  1980. }
  1981.  
  1982.  
  1983. # Mensagem de carregamento.
  1984.  
  1985. if { ![info exists ctcp(on)] } {
  1986. putlog "-- $script(logo) CTCP - Activado!"
  1987. set ctcp(on) 1
  1988. } else {
  1989. set loaded(CTCP) ""
  1990. }
  1991.  
  1992. }
  1993.  
  1994. ### -=(. Caps-Lock .)=- BINDS/PROCS:
  1995.  
  1996. if { $caps(enable) eq "1" } {
  1997.  
  1998. # Variaveis especificas do modulo.
  1999.  
  2000. setudef flag nocaps
  2001. set caps(interval) 60
  2002.  
  2003. # Binds
  2004.  
  2005. bind pubm - * pubm:caps
  2006. bind ctcp - ACTION act:caps
  2007. bind notc - * notc:caps
  2008.  
  2009. # Procs
  2010.  
  2011. proc pubm:caps {nick uhost hand chan text} {
  2012. global caps
  2013. if {![matchattr $hand f] || ![isop $nick $chan] || ![isvoice $nick $chan]||[isw $nick $chan o]} {
  2014. set caps(upper) 0
  2015. set caps(space) 0
  2016. set caps(chars) [string length $text]
  2017. if {$caps(chars) > 10} {
  2018. foreach i [split $text {}] {
  2019. if {[string match \[A-Z\] $i]} {
  2020. incr caps(upper)
  2021. }
  2022. if {$i eq " "} {
  2023. incr caps(space)
  2024. }
  2025. }
  2026. if {$caps(upper) >= 30} {
  2027. set caps(total) [expr {100 * $caps(upper) / ($caps(chars) - $caps(space))}]
  2028. if {$caps(total) > $caps(percent)} {
  2029. ban:proc:caps $nick $uhost $hand $chan $caps(total)
  2030. }
  2031. }
  2032. }
  2033. }
  2034. }
  2035.  
  2036. proc ban:proc:caps {nick uhost hand chan args} {
  2037. global caps script
  2038. if {[channel get $chan nocaps]} {
  2039. if {[validuser "1$chan"] eq 0} {
  2040. adduser "1$chan"
  2041. chattr "1$chan" +B-fhpvom
  2042. setuser "1$chan" PASS chantools
  2043. setuser "1$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
  2044. }
  2045. if {[validuser "2$chan"] eq 0} {
  2046. adduser "2$chan"
  2047. chattr "2$chan" +B-fhpvom
  2048. setuser "2$chan" PASS chantools
  2049. setuser "2$chan" INFO "$script(logo) :::: DO NOT DELETE !!!"
  2050. }
  2051. foreach capstimer [timers] {
  2052. if {[string equal -nocase clear:hosts [lindex $capstimer 1]]} {
  2053. killtimer [lindex $capstimer 2]
  2054. break
  2055. }
  2056. }
  2057. set host [uhost:mask $nick $uhost 4]
  2058. set nmask "${nick}!*@*"
  2059. set caps(kicktotal) [string tolower $args]
  2060. set uchan [nick2hand $nick $chan]
  2061. set cat 0
  2062. if {[matchattr $uchan B]} {
  2063. if {[string match -nocase "*$host*" [getuser "1$chan" HOSTS]] eq 1 && [getuser "1$chan" HOSTS] ne ""} {
  2064. set cat 1
  2065. }
  2066. if {[string match -nocase "*$host*" [getuser "2$chan" HOSTS]] eq 1 && [getuser "2$chan" HOSTS] ne ""} {
  2067. set cat 2
  2068. }
  2069. switch $cat {
  2070. "0" {
  2071. setuser "1$chan" HOSTS $host
  2072. setuser "1$chan" HOSTS $nmask
  2073. putkick $chan $nick "[b]([b]$caps(kicktotal)%[b])[b][u]:[u] $caps(kick) [b]\[1 de 3\][b]"
  2074. }
  2075. "1" {
  2076. setuser "2$chan" HOSTS $host
  2077. setuser "2$chan" HOSTS $nmask
  2078. delhost "1$chan" $host
  2079. delhost "1$chan" $nmask
  2080. putkick $chan $nick "[b]([b]$caps(kicktotal)%[b])[b][u]:[u] $caps(kick) [b]\[2 de 3\][b]"
  2081. }
  2082. "2" {
  2083. delhost "2$chan" $host
  2084. delhost "2$chan" $nmask
  2085. set reason "[b]([b]$caps(kicktotal)%[b])[b][u]:[u] $caps(kick) [b]\[3 de 3\][b]"
  2086. set reason [join [lrange [split $reason] 0 end]]
  2087. ban:proc:new $nick $uhost $chan $script(bantype) $reason
  2088. }
  2089. }
  2090. } else {
  2091. setuser "1$chan" HOSTS $host
  2092. setuser "1$chan" HOSTS $nmask
  2093. putkick $chan $nick "[b]([b]$caps(kicktotal)%[b])[b][u]:[u] $caps(kick) [b]\[1 de 3\][b]"
  2094. }
  2095. timer $caps(interval) clear:hosts
  2096. }
  2097. }
  2098.  
  2099. proc act:caps {nick uhost hand chan key text} {
  2100. if {[string tolower $chan] ne [string tolower $::botnick]} {
  2101. pubm:caps $nick $uhost $hand $chan $text
  2102. }
  2103. }
  2104.  
  2105. proc notc:caps {nick uhost hand args chan} {
  2106. if {[string tolower $chan] ne [string tolower $::botnick]} {
  2107. set tchan [lindex [split $chan "@"] 1]
  2108. if {($tchan ne "") && ([channel get $tchan nocaps] eq "1")} {
  2109. pubm:caps $nick $uhost $hand $tchan $args
  2110. } else {
  2111. pubm:caps $nick $uhost $hand $chan $args
  2112. }
  2113. }
  2114. }
  2115.  
  2116. if { ![info exists caps(on)] } {
  2117. putlog "-- $script(logo) Caps-Lock - Activado!"
  2118. set caps(on) 1
  2119. } else {
  2120. set loaded(Caps-Lock) ""
  2121. }
  2122.  
  2123. }
  2124.  
  2125. ### -=(. BAN System .)=- PROCS:
  2126.  
  2127. setudef int moon-kcount
  2128.  
  2129. proc putkick {chan nick arg} {
  2130. if {[botonchan $chan] && [botisop $chan]} {
  2131. set nick [split $nick ,]
  2132. foreach nick $nick {
  2133. putquick "kick $chan $nick :$arg --- (kick \244[channel get $chan moon-kcount])"
  2134. }
  2135. }
  2136. }
  2137.  
  2138. bind kick - "*" get:kick
  2139. proc get:kick {nick uhost hand chan target reason} {
  2140. if {[isbotnick $nick]} {
  2141. set kcount [channel get $chan moon-kcount]
  2142. if {$kcount eq ""} {
  2143. set kcount 0
  2144. } else {
  2145. incr kcount
  2146. }
  2147. channel set $chan moon-kcount $kcount
  2148. }
  2149. }
  2150.  
  2151. proc uhost:mask { nick uhost args } {
  2152. switch $args {
  2153. 1 { set umask "${nick}!*@*" }
  2154. 2 { set umask "*!*@[lindex [split $uhost @] 1]" }
  2155. 3 { set umask "*$nick*!*@[lindex [split $uhost "@"] 1]" }
  2156. 4 { set umask "*!*[lindex [split $uhost "@"] 0]@[lindex [split $uhost "@"] 1]" }
  2157. return $umask
  2158. }
  2159. }
  2160.  
  2161. proc ban:proc:new {nick uhost chan btype reason} {
  2162. global script
  2163. set bmask [uhost:mask $nick $uhost $btype]
  2164. if {[channel get $chan enforcebans]} {
  2165. newchanban $chan $bmask $::botnick $reason 0
  2166. } else {
  2167. pushmode $chan +b $bmask
  2168. flushmode $chan
  2169. putkick $chan $nick $reason
  2170. }
  2171. }
  2172.  
  2173. set unick ""
  2174. set ident ""
  2175.  
  2176. proc unban:host {nick chan} {
  2177. global script unick ident optools
  2178. set unick $nick
  2179. set optools(chan) $chan
  2180. putserv "USERHOST $::botnick $nick"
  2181. }
  2182.  
  2183. proc unban:proc {nick uhost chan} {
  2184. global script unick whom
  2185. set ubans 0
  2186. foreach record [banlist $chan] {
  2187. set remove [string tolower [lindex [split $record] 0]]
  2188. if {([string match -nocase "$nick!*@*" $remove]) && ($nick ne "no")} {
  2189. killchanban $chan $remove
  2190. incr ubans
  2191. }
  2192. if {[string match -nocase "*$uhost*" $remove]} {
  2193. killchanban $chan $remove
  2194. incr ubans
  2195. }
  2196. }
  2197. foreach record [chanbans $chan] {
  2198. set remove [lindex [split $record] 0]
  2199. if {([string match -nocase "$nick!*@*" $remove ]) && ($nick ne "no")} {
  2200. pushmode $chan -b $remove
  2201. incr ubans
  2202. }
  2203. if {[string match -nocase "*$uhost*" $remove ]} {
  2204. pushmode $chan -b $remove
  2205. incr ubans
  2206. }
  2207. }
  2208. flushmode $chan
  2209. if { $ubans eq "0" } { puthelp "NOTICE $whom :$script(logo) Nenhum ban removido" }
  2210. if { $ubans > "0" } { puthelp "NOTICE $whom :$script(logo) $ubans removidos"}
  2211. }
  2212.  
  2213. proc unban:last {chan} {
  2214. global whom script
  2215. set ubans 0
  2216. foreach record [lreverse [chanbans $chan]] {
  2217. incr ubans
  2218. set remove [lindex [split $record] 0]
  2219. if {$ubans eq "1"} {
  2220. pushmode $chan -b $remove
  2221. killchanban $chan $remove
  2222. puthelp "NOTICE $whom :$script(logo) o ban mais recente foi removido \[Banlist Canal\]"
  2223. }
  2224. }
  2225. foreach record [banlist $chan] {
  2226. incr ubans
  2227. set remove [string tolower [lindex [split $record] 0]]
  2228. if {$ubans eq "1"} {
  2229. killchanban $chan $remove
  2230. puthelp "NOTICE $whom :$script(logo) o ban mais recente foi removido \[Banlist BOT\]"
  2231. }
  2232. }
  2233. if { $ubans eq "0" } { puthelp "NOTICE $whom :$script(logo) Nenhum ban removido" }
  2234. }
  2235.  
  2236. proc clear:hosts { } {
  2237. foreach chan [channels] {
  2238. if {[channel get $chan nobadwords]||[channel get $chan nocaps]} {
  2239. if {[validuser "1$chan"] eq 1} {
  2240. setuser "1$chan" HOSTS
  2241. }
  2242. if {[validuser "2$chan"] eq 1} {
  2243. setuser "2$chan" HOSTS
  2244. }
  2245. }
  2246. }
  2247. }
  2248.  
  2249. proc isw {nick chan flag} {
  2250. set iswcheck 0
  2251. if {[matchattr [nick2hand $nick $chan] $flag|$flag $chan]} {
  2252. incr iswcheck
  2253. }
  2254. if {[matchattr [nick2hand $nick] $flag]} {
  2255. incr iswcheck
  2256. }
  2257. if { $iswcheck eq 0 } {
  2258. return 0
  2259. } else {
  2260. return 1
  2261. }
  2262. }
  2263.  
  2264. proc go:whois {nick} {
  2265. putserv "WHOIS $nick $nick"
  2266. }
  2267.  
  2268.  
  2269. ### -=(. Ajuda .)=- BINDS\PROCS:
  2270.  
  2271. #Binds
  2272. bind msg - !ajuda msg:ajuda
  2273.  
  2274. #Procs
  2275. proc msg:ajuda { nick uhost hand text } {
  2276. global script optools addops onjoin bw
  2277. if {([llength $text] < 1)} {
  2278. puthelp "PRIVMSG $nick :$script(logo) $script(version) $script(logo)"
  2279. if {[matchattr $hand p]} {
  2280. puthelp "PRIVMSG $nick :$script(logo) Comando: !ajuda [b](script)[b] - Scripts activos aos quais tem acesso:"
  2281. if {($optools(enable)eq"1")&&([matchattr $hand $optools(flag)])} {
  2282. puthelp "PRIVMSG $nick :$script(logo) -=(. [b]Optools[b] .)=- !ajuda optools"
  2283. }
  2284. if {($bw(enable)eq"1")&&([matchattr $hand $bw(flag)])} {
  2285. puthelp "PRIVMSG $nick :$script(logo) -=(. [b]BadWords[b] .)=- !ajuda bw"
  2286. }
  2287. if {($onjoin(enable)eq"1")&&([matchattr $hand $onjoin(flag)])} {
  2288. puthelp "PRIVMSG $nick :$script(logo) -=(. [b]OnJoin[b] .)=- !ajuda onjoin"
  2289. }
  2290. if {($addops(enable)eq"1")&&([matchattr $hand $addops(flag)])} {
  2291. puthelp "PRIVMSG $nick :$script(logo) -=(. [b]AddOps[b] .)=- !ajuda addops"
  2292. }
  2293. }
  2294. }
  2295. switch [lindex $text 0] {
  2296. "optools" {
  2297. if {($optools(enable)eq"1")&&([matchattr $hand $optools(flag)])} {
  2298. puthelp "PRIVMSG $nick : $script(logo) -=(. [b]Optools[b] .)=- Comandos\:"
  2299. puthelp "PRIVMSG $nick : $script(logo) [b]!up[b] (Op) [b]!down[b] (deOp) [b]+o <nick>[b] (Opar) [b]-o <nick>[b] (deOpar)"
  2300. puthelp "PRIVMSG $nick : $script(logo) [b]!middle[b] (Voice) [b]+v <nick>[b] (Voiçar) [b]-v <nick>[b] (deVoiçar)"
  2301. 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)"
  2302. puthelp "PRIVMSG $nick : $script(logo) [b]!topic <texto>[b] (Alterar o tópico do canal)"
  2303. puthelp "PRIVMSG $nick : $script(logo) existem tb os comandos [b]!k !b !t[b] para kick, ban e topic respectivamente"
  2304. }
  2305. }
  2306. "onjoin" {
  2307. if {($addops(enable)eq"1")&&([matchattr $hand $onjoin(flag)])} {
  2308. puthelp "PRIVMSG $nick :$script(logo) -=(. [b]OnJoin[b] .)=- Comandos\:"
  2309. puthelp "PRIVMSG $nick :$script(logo) \[Public\][b]:[b] Adicionar\: !onjoin add [u]off[u] [b]frase[b]"
  2310. puthelp "PRIVMSG $nick :$script(logo) \[nota\][b]\:[b] a opção \"off\" serve para ocultar -\> $script(logo)"
  2311. puthelp "PRIVMSG $nick :$script(logo) \[Public\][b]:[b] Remover\: !onjoin del [b]número[b]|all"
  2312. puthelp "PRIVMSG $nick :$script(logo) \[nota\][b]\:[b] Corresponde ao número da frase."
  2313. }
  2314. }
  2315. "bw" {
  2316. if {($bw(enable)eq"1")&&([matchattr $hand $bw(flag)])} {
  2317. puthelp "PRIVMSG $nick :$script(logo) -=(. [b]BadWords[b] .)=- Comandos\:"
  2318. puthelp "PRIVMSG $nick :$script(logo) Adicionar\: /msg $::botnick !bw add [b]password[b] \[palavra\]"
  2319. puthelp "PRIVMSG $nick :$script(logo) Remover\: /msg $::botnick !bw del [b]password[b] \[palavra\]"
  2320. puthelp "PRIVMSG $nick :$script(logo) Lista\: /msg $::botnick !bw list [b]password[b]"
  2321. puthelp "PRIVMSG $nick :$script(logo) \[nota\][b]\:[b] deve usar a password de identificação ao Eggdrop"
  2322. }
  2323. }
  2324. "addops" {
  2325. if {($addops(enable)eq"1")&&([matchattr $hand $addops(flag)])} {
  2326. puthelp "PRIVMSG $nick :$script(logo) -=(. [b]AddOps[b] .)=- Comandos\:"
  2327. if {($addops(chanserv)eq"1")} {
  2328. puthelp "PRIVMSG $nick :$script(logo) Adicionar\: /msg $::botnick addop [b]password[b] \[nick\] \[nível\]"
  2329. } else {
  2330. puthelp "PRIVMSG $nick :$script(logo) Adicionar\: /msg $::botnick addop [b]password[b] \[nick\]"
  2331. }
  2332. puthelp "PRIVMSG $nick :$script(logo) Remover\: /msg $::botnick delop [b]password[b] \[nick\]"
  2333. puthelp "PRIVMSG $nick :$script(logo) \[nota\][b]\:[b] deve usar a password de identificação ao Eggdrop"
  2334. }
  2335. }
  2336. }
  2337. }
  2338.  
  2339. ### -=(. Status .)=- BINDS\PROCS:
  2340.  
  2341. #Binds
  2342. bind dcc n chantools dcc:chantools
  2343.  
  2344. #Procs
  2345. proc dcc:chantools { hand idx arg } {
  2346. global ctcp-version ctcp-finger ctcp-userinfo antipub onjoin optools
  2347. global addops helpserv ctcp limit idle away bw script caps
  2348. switch [lindex [string tolower $arg] 0] {
  2349. "" {
  2350. putcmdlog "#$hand# chantools $arg"
  2351. putidx $idx "$script(logo) -=(. [b]Status[b] .)=- \:\: \[0/1\] - Activo/Inactivo"
  2352. putidx $idx "$script(logo) -=(. [b]Optools[b] .)=- [b]$optools(enable)[b]"
  2353. putidx $idx "$script(logo) -=(. [b]OnJoin[b] .)=- [b]$onjoin(enable)[b]"
  2354. putidx $idx "$script(logo) -=(. [b]Anti-Pub[b] .)=- [b]$antipub(enable)[b]"
  2355. putidx $idx "$script(logo) -=(. [b]BadWords[b] .)=- [b]$bw(enable)[b]"
  2356. putidx $idx "$script(logo) -=(. [b]Anti-Idle[b] .)=- [b]$idle(enable)[b]"
  2357. putidx $idx "$script(logo) -=(. [b]Anti-Away[b] .)=- [b]$away(enable)[b]"
  2358. putidx $idx "$script(logo) -=(. [b]AddOps[b] .)=- [b]$addops(enable)[b]"
  2359. putidx $idx "$script(logo) -=(. [b]Caps-Lock[b] .)=- [b]$caps(enable)[b]"
  2360. putidx $idx "$script(logo) -=(. [b]HelpServ[b] .)=- [b]$helpserv(enable)[b]"
  2361. putidx $idx "$script(logo) -=(. [b]LimitOps[b] .)=- [b]$limit(enable)[b]"
  2362. putidx $idx "$script(logo) -=(. [b]CTCP[b] .)=- [b]$ctcp(enable)[b]"
  2363. putidx $idx "$script(logo) Mais informações\: .chantools <script>"
  2364. }
  2365. "optools" {
  2366. putcmdlog "#$hand# chantools $arg"
  2367. putidx $idx "$script(logo) -=(. [b]Optools[b] .)=-"
  2368. putidx $idx "$script(logo) Flag necessária para usar\: \"[b]$optools(flag)[b]\""
  2369. }
  2370. "onjoin" {
  2371. putcmdlog "#$hand# chantools $arg"
  2372. putidx $idx "$script(logo) -=(. [b]OnJoin[b] .)=-"
  2373. putidx $idx "$script(logo) Canal/Canais\: [b]$onjoin(chan)[b]"
  2374. putidx $idx "$script(logo) Flag necessária para usar\: \"[b]$onjoin(flag)[b]\""
  2375. putidx $idx "$script(logo) Localização da Base de Dados\: \"[b]$onjoin(db)[b]\""
  2376. putidx $idx "$script(logo) Tipo de OnJoin\: [b]$onjoin(type)[b]"
  2377. }
  2378. "anti-pub" {
  2379. putcmdlog "#$hand# chantools $arg"
  2380. putidx $idx "$script(logo) -=(. [b]Anti-Pub[b] .)=-"
  2381. putidx $idx "$script(logo) Mensagem de kick\: [b]$antipub(kick)[b]"
  2382. }
  2383. "badwords" {
  2384. putcmdlog "#$hand# chantools $arg"
  2385. putidx $idx "$script(logo) -=(. [b]BadWords[b] .)=-"
  2386. putidx $idx "$script(logo) Base de dados de palavras: [b]$bw(db)[b]; Flag necessaria de acesso: [b]$bw(flag)[b]"
  2387. putidx $idx "$script(logo) Mensagem de kick\: [b]$bw(kick)[b]"
  2388. }
  2389. "anti-idle" {
  2390. putcmdlog "#$hand# chantools $arg"
  2391. putidx $idx "$script(logo) -=(. [b]Anti-Idle[b] .)=-"
  2392. putidx $idx "$script(logo) Intervalo de tempo para verificar o Idle\: [b]$idle(interval)[b] minutos"
  2393. putidx $idx "$script(logo) Máximo de tempo idle permitido no Canal\: [b]$idle(time)[b] minutos"
  2394. putidx $idx "$script(logo) Utilizadores aos quais se aplica\: [b]$idle(users)[b] \:\: \[ops/voices/both/all\]"
  2395. }
  2396. "anti-away" {
  2397. putcmdlog "#$hand# chantools $arg"
  2398. putidx $idx "$script(logo) -=(. [b]Anti-Away[b] .)=-"
  2399. putidx $idx "$script(logo) Intervalo de tempo para verificar o Away\: [b]$away(time)[b] minutos"
  2400. putidx $idx "$script(logo) Utilizadores aos quais se aplica\: [b]$away(users)[b] \:\: \[ops/voices/both\]"
  2401. }
  2402. "addops" {
  2403. putcmdlog "#$hand# chantools $arg"
  2404. putidx $idx "$script(logo) -=(. [b]AddOps[b] .)=-"
  2405. putidx $idx "$script(logo) Canal\: [b]$addops(chan)[b]"
  2406. putidx $idx "$script(logo) Flag necessária para usar\: \"[b]$addops(flag)[b]\""
  2407. putidx $idx "$script(logo) Flags que o Utilizador receberá\: \"[b]$addops(dflags)[b]\""
  2408. putidx $idx "$script(logo) Opção de registo ChanServ (PTnet)\: [b]$addops(chanserv)[b] \:\: \[0/1\] - Activo/Inactivo"
  2409. }
  2410. "caps-lock" {
  2411. putcmdlog "#$hand# chantools $arg"
  2412. putidx $idx "$script(logo) -=(. [b]Caps-Lock[b] .)=-"
  2413. putidx $idx "$script(logo) Percentagem maxima de maiusculas permitida: [b]$caps(percent)%[b]"
  2414. putidx $idx "$script(logo) Mensagem de kick\: [b]$caps(kick)[b]"
  2415. }
  2416. "helpserv" {
  2417. putcmdlog "#$hand# chantools $arg"
  2418. putidx $idx "$script(logo) -=(. [b]HelpServ[b] .)=-"
  2419. putidx $idx "$script(logo) Canal\: [b]$helpserv(chan)[b]"
  2420. putidx $idx "$script(logo) Opção de Ban ao Nick\: [b]$helpserv(ban)[b] \:\: \[0/1\] - Activo/Inactivo"
  2421. putidx $idx "$script(logo) Período de tempo para o Guest mudar de nick\: [b]$helpserv(time)[b] minutos"
  2422. }
  2423. "limitops" {
  2424. putcmdlog "#$hand# chantools $arg"
  2425. putidx $idx "$script(logo) -=(. [b]LimitOps[b] .)=-"
  2426. putidx $idx "$script(logo) Limite\: [b]$limit(ops)[b] Operadores"
  2427. }
  2428. "ctcp" {
  2429. putcmdlog "#$hand# chantools $arg"
  2430. putidx $idx "$script(logo) Replies Actuais\:"
  2431. putidx $idx "$script(logo) finger : [b]${ctcp-finger}[b]"
  2432. putidx $idx "$script(logo) userinfo : [b]${ctcp-userinfo}[b]"
  2433. putidx $idx "$script(logo) version : [b]${ctcp-version}[b]"
  2434. }
  2435. "default" {
  2436. putcmdlog "#$hand# chantools $arg"
  2437. putidx $idx "$script(logo) .chantools <script>"
  2438. }
  2439. }
  2440. }
  2441.  
  2442. if {[set loadedtext [join [lsort [array names loaded]] ", "]] ne ""} {
  2443. putlog "-- $script(logo) Componentes carregados: $loadedtext"
  2444. }
  2445.  
  2446. #EOF!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement