BT.H.tcl 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  1. #########################################################################
  2. ## BlackTools - The Ultimate Channel Control Script ##
  3. ## One TCL. One smart Eggdrop ##
  4. #########################################################################
  5. ############################# HCMDS TCL #############################
  6. #########################################################################
  7. ## ##
  8. ## BlackTools : http://blacktools.tclscripts.net ##
  9. ## Bugs report : http://www.tclscripts.net/ ##
  10. ## GitHub page : https://github.com/tclscripts/BlackToolS-TCL ##
  11. ## Online Help : irc://irc.undernet.org/tcl-help ##
  12. ## #TCL-HELP / UnderNet ##
  13. ## You can ask in english or romanian ##
  14. ## ##
  15. #########################################################################
  16. proc h:process {nick host hand chan chan1 command type} {
  17. global black botnick config lastbind
  18. if {[matchattr $hand q]} { blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none
  19. return
  20. }
  21. if {[matchattr $hand -|q $chan]} { blacktools:tell $nick $host $hand $chan $chan1 gl.suspend none
  22. return
  23. }
  24. set cmd_status [btcmd:status $chan $hand "h" 0]
  25. if {$cmd_status == "1"} {
  26. return
  27. }
  28. set number [scan $black(antiflood:cmd) %\[^:\]]
  29. set show_cmds ""
  30. set timer [scan $black(antiflood:cmd) %*\[^:\]:%s]
  31. set split_lastbind [split $lastbind ""]
  32. set charbind [lindex $split_lastbind 0]
  33. if {[lsearch -exact $black(cmdchar) $charbind] < 0} {
  34. set charbind ""
  35. }
  36. set replace(%botnick%) $botnick
  37. if {[string equal $lastbind "*"]} { set charbind "" }
  38. if {[string equal -nocase "**" $lastbind]} { set charbind "$botnick " }
  39. set replace(%char%) $charbind
  40. if {[info exists black(flood:activ:$host)]} {
  41. foreach tmr [utimers] {
  42. if {[string match "*black(flood:activ:$host)*" [join [lindex $tmr 1]]]} {
  43. set time [lindex $tmr 0]
  44. }
  45. }
  46. blacktools:tell $nick $host $hand $chan $chan1 h.16 "$time h"
  47. return
  48. }
  49. foreach tmr [utimers] {
  50. if {[string match "*black(floodcmd:$host:$chan)*" [join [lindex $tmr 1]]]} {
  51. killutimer [lindex $tmr 2]
  52. }
  53. }
  54. if {![info exists black(floodcmd:$host:$chan)]} {
  55. set black(floodcmd:$host:$chan) 0
  56. }
  57. incr black(floodcmd:$host:$chan)
  58. utimer $timer [list unset black(floodcmd:$host:$chan)]
  59. if {$black(floodcmd:$host:$chan) == "$number"} {
  60. blacktools:tell $nick $host $hand $chan $chan1 h.16 "30 h"
  61. set black(flood:activ:$host) 1
  62. utimer 30 [list unset black(flood:activ:$host)]
  63. return
  64. }
  65. set replace(%chan%) $chan
  66. set greeting [getuser $hand XTRA BT_WELCOME]
  67. set chanlang [string tolower [setting:get $chan lang]]
  68. if {[matchattr $hand -|V $chan]} {
  69. set access "VOICE"
  70. } elseif {[matchattr $hand -|O $chan]} {
  71. set access "OP"
  72. } elseif {[matchattr $hand -|A $chan]} {
  73. set access "ADMIN"
  74. } elseif {[matchattr $hand -|M $chan]} {
  75. set access "MANAGER"
  76. } elseif {[matchattr $hand n]} {
  77. set access "BOSS"
  78. } elseif {[matchattr $hand m]} {
  79. set access "OWNER"
  80. } elseif {[matchattr $hand o]} {
  81. set access "MASTER"
  82. }
  83. if {$chanlang == ""} { set chanlang "[string tolower $black(default_lang)]" }
  84. if {$greeting == ""} {
  85. set text1 [black:color:set "" $black(say.$chanlang.greeting.1)]
  86. set reply1 [join $text1]
  87. set text2 [black:color:set "" $black(say.$chanlang.greeting.2)]
  88. set reply2 [join $text2]
  89. set text3 [black:color:set "" $black(say.$chanlang.greeting.3)]
  90. set reply3 [join $text3]
  91. set text4 [black:color:set "" $black(say.$chanlang.greeting.4)]
  92. set reply4 [join $text4]
  93. set text5 [black:color:set "" $black(say.$chanlang.greeting.5)]
  94. set reply5 [join $text5]
  95. set text6 [black:color:set "" $black(say.$chanlang.greeting.6)]
  96. set reply6 [join $text6]
  97. putserv "PRIVMSG $nick :[string map [array get replace] $reply1]"
  98. putserv "PRIVMSG $nick :[string map [array get replace] $reply2]"
  99. putserv "PRIVMSG $nick :[string map [array get replace] $reply3]"
  100. putserv "PRIVMSG $nick :[string map [array get replace] $reply4]"
  101. putserv "PRIVMSG $nick :[string map [array get replace] $reply5]"
  102. putserv "PRIVMSG $nick :[string map [array get replace] $reply6]"
  103. setuser $hand XTRA BT_WELCOME 1
  104. return
  105. }
  106. set getlang [string tolower [getuser $hand XTRA OUTPUT_LANG]]
  107. if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
  108. if {$command == ""} {
  109. switch $access {
  110. VOICE {
  111. blacktools:tell $nick $host $hand $chan $chan1 h.5 $black(say.$getlang.level.6)
  112. switch $type {
  113. 0 {
  114. blacktools:tell $nick $host $hand $chan $chan1 h.6 none
  115. }
  116. 1 {
  117. blacktools:tell $nick $host $hand $chan $chan1 h.24 none
  118. }
  119. 2 {
  120. blacktools:tell $nick $host $hand $chan $chan1 h.20 none
  121. }
  122. }
  123. }
  124. OP {
  125. blacktools:tell $nick $host $hand $chan $chan1 h.7 $black(say.$getlang.level.5)
  126. switch $type {
  127. 0 {
  128. blacktools:tell $nick $host $hand $chan $chan1 h.8 none
  129. }
  130. 1 {
  131. blacktools:tell $nick $host $hand $chan $chan1 h.24 none
  132. }
  133. 2 {
  134. blacktools:tell $nick $host $hand $chan $chan1 h.20 none
  135. }
  136. }
  137. }
  138. ADMIN {
  139. blacktools:tell $nick $host $hand $chan $chan1 h.11 $black(say.$getlang.level.4)
  140. switch $type {
  141. 0 {
  142. blacktools:tell $nick $host $hand $chan $chan1 h.12 none
  143. }
  144. 1 {
  145. blacktools:tell $nick $host $hand $chan $chan1 h.23 none
  146. }
  147. 2 {
  148. blacktools:tell $nick $host $hand $chan $chan1 h.19 none
  149. }
  150. }
  151. }
  152. MANAGER {
  153. blacktools:tell $nick $host $hand $chan $chan1 h.13 $black(say.$getlang.level.3)
  154. switch $type {
  155. 0 {
  156. blacktools:tell $nick $host $hand $chan $chan1 h.14 none
  157. }
  158. 1 {
  159. blacktools:tell $nick $host $hand $chan $chan1 h.22 none
  160. }
  161. 2 {
  162. blacktools:tell $nick $host $hand $chan $chan1 h.18 none
  163. }
  164. }
  165. }
  166. OWNER {
  167. blacktools:tell $nick $host $hand $chan $chan1 h.3 $black(say.$getlang.level.2)
  168. switch $type {
  169. 0 {
  170. blacktools:tell $nick $host $hand $chan $chan1 h.4 none
  171. }
  172. 1 {
  173. blacktools:tell $nick $host $hand $chan $chan1 h.21 none
  174. }
  175. 2 {
  176. blacktools:tell $nick $host $hand $chan $chan1 h.17 none
  177. }
  178. }
  179. }
  180. MASTER {
  181. blacktools:tell $nick $host $hand $chan $chan1 h.1 $black(say.$getlang.level.8)
  182. switch $type {
  183. 0 {
  184. blacktools:tell $nick $host $hand $chan $chan1 h.25 none
  185. }
  186. 1 {
  187. blacktools:tell $nick $host $hand $chan $chan1 h.27 none
  188. }
  189. 2 {
  190. blacktools:tell $nick $host $hand $chan $chan1 h.26 none
  191. }
  192. }
  193. }
  194. BOSS {
  195. blacktools:tell $nick $host $hand $chan $chan1 h.1 $black(say.$getlang.level.1)
  196. switch $type {
  197. 0 {
  198. blacktools:tell $nick $host $hand $chan $chan1 h.4 none
  199. }
  200. 1 {
  201. blacktools:tell $nick $host $hand $chan $chan1 h.21 none
  202. }
  203. 2 {
  204. blacktools:tell $nick $host $hand $chan $chan1 h.17 none
  205. }
  206. }
  207. }
  208. }
  209. return
  210. }
  211. switch -exact -- [string tolower $command] {
  212. cmds {
  213. switch $access {
  214. VOICE {
  215. set cmds [string map [array get replace] $black(say.$getlang.cmdsvoice)]
  216. set split_cmds [split $cmds ";"]
  217. foreach cmd $split_cmds {
  218. set thecmd [lindex $cmd 0]
  219. set rest_of [lrange $cmd 1 end]
  220. set status [btcmd:status $chan $hand $thecmd 1]
  221. if {$status == "1"} {
  222. continue
  223. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  224. lappend show_cmds [join $applycmd " "]
  225. }
  226. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  227. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  228. }
  229. }
  230. OP {
  231. set cmds [string map [array get replace] $black(say.$getlang.cmdsop)]
  232. set split_cmds [split $cmds ";"]
  233. foreach cmd $split_cmds {
  234. set thecmd [lindex $cmd 0]
  235. set rest_of [lrange $cmd 1 end]
  236. set status [btcmd:status $chan $hand $thecmd 1]
  237. if {$status == "1"} {
  238. continue
  239. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  240. lappend show_cmds [join $applycmd " "]
  241. }
  242. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  243. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  244. }
  245. }
  246. ADMIN {
  247. set cmds [string map [array get replace] $black(say.$getlang.cmdadmin)]
  248. set split_cmds [split $cmds ";"]
  249. foreach cmd $split_cmds {
  250. set thecmd [lindex $cmd 0]
  251. set rest_of [lrange $cmd 1 end]
  252. set status [btcmd:status $chan $hand $thecmd 1]
  253. if {$status == "1"} {
  254. continue
  255. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  256. lappend show_cmds [join $applycmd " "]
  257. }
  258. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  259. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  260. }
  261. }
  262. MANAGER {
  263. set cmds [string map [array get replace] $black(say.$getlang.cmdmanager)]
  264. set split_cmds [split $cmds ";"]
  265. foreach cmd $split_cmds {
  266. set thecmd [lindex $cmd 0]
  267. set rest_of [lrange $cmd 1 end]
  268. set status [btcmd:status $chan $hand $thecmd 1]
  269. if {$status == "1"} {
  270. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  271. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  272. lappend show_cmds [join $applycmd " "]
  273. }
  274. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  275. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  276. }
  277. }
  278. OWNER {
  279. set cmds [string map [array get replace] $black(say.$getlang.cmdbossowner)]
  280. set split_cmds [split $cmds ";"]
  281. foreach cmd $split_cmds {
  282. set thecmd [lindex $cmd 0]
  283. set rest_of [lrange $cmd 1 end]
  284. set status [btcmd:status $chan $hand $thecmd 1]
  285. if {$status == "1"} {
  286. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  287. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  288. lappend show_cmds [join $applycmd " "]
  289. }
  290. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  291. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  292. }
  293. }
  294. BOSS {
  295. set cmds [string map [array get replace] $black(say.$getlang.cmdbossowner)]
  296. set split_cmds [split $cmds ";"]
  297. foreach cmd $split_cmds {
  298. set thecmd [lindex $cmd 0]
  299. set rest_of [lrange $cmd 1 end]
  300. set status [btcmd:status $chan $hand $thecmd 1]
  301. if {$status == "1"} {
  302. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  303. } else {
  304. set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;"
  305. }
  306. lappend show_cmds [join $applycmd " "]
  307. }
  308. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  309. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  310. }
  311. }
  312. MASTER {
  313. set cmds [string map [array get replace] $black(say.$getlang.cmdmaster)]
  314. set split_cmds [split $cmds ";"]
  315. foreach cmd $split_cmds {
  316. set thecmd [lindex $cmd 0]
  317. set rest_of [lrange $cmd 1 end]
  318. set status [btcmd:status $chan $hand $thecmd 1]
  319. if {$status == "1"} {
  320. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  321. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  322. lappend show_cmds [join $applycmd " "]
  323. }
  324. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  325. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  326. }
  327. }
  328. }
  329. set alias_cmds [blacktools:alias_get $hand $chan]
  330. if {$alias_cmds != 0} {
  331. set text "$black(say.$getlang.alias.7) $alias_cmds"
  332. foreach txt [h:wrap [join $text] 330] {
  333. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  334. }
  335. }
  336. switch $type {
  337. 0 {
  338. blacktools:tell $nick $host $hand $chan $chan1 hcommand.1 none
  339. }
  340. 1 {
  341. blacktools:tell $nick $host $hand $chan $chan1 hcommand.2 none
  342. }
  343. 2 {
  344. blacktools:tell $nick $host $hand $chan $chan1 hcommand.3 none
  345. }
  346. }
  347. }
  348. ban {
  349. switch $access {
  350. VOICE {
  351. set cmds [string map [array get replace] $black(say.$getlang.banvoice)]
  352. set split_cmds [split $cmds ";"]
  353. foreach cmd $split_cmds {
  354. set thecmd [lindex $cmd 0]
  355. set rest_of [lrange $cmd 1 end]
  356. set status [btcmd:status $chan $hand $thecmd 1]
  357. if {$status == "1"} {
  358. continue
  359. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  360. lappend show_cmds [join $applycmd " "]
  361. }
  362. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 450] {
  363. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$txt"
  364. }
  365. }
  366. OP {
  367. set cmds [string map [array get replace] $black(say.$getlang.banop)]
  368. set split_cmds [split $cmds ";"]
  369. foreach cmd $split_cmds {
  370. set thecmd [lindex $cmd 0]
  371. set rest_of [lrange $cmd 1 end]
  372. set status [btcmd:status $chan $hand $thecmd 1]
  373. if {$status == "1"} {
  374. continue
  375. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  376. lappend show_cmds [join $applycmd " "]
  377. }
  378. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 450] {
  379. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$txt"
  380. }
  381. }
  382. ADMIN {
  383. set cmds [string map [array get replace] $black(say.$getlang.banadmin)]
  384. set split_cmds [split $cmds ";"]
  385. foreach cmd $split_cmds {
  386. set thecmd [lindex $cmd 0]
  387. set rest_of [lrange $cmd 1 end]
  388. set status [btcmd:status $chan $hand $thecmd 1]
  389. if {$status == "1"} {
  390. continue
  391. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  392. lappend show_cmds [join $applycmd " "]
  393. }
  394. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 450] {
  395. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$txt"
  396. }
  397. }
  398. MANAGER {
  399. set cmds [string map [array get replace] $black(say.$getlang.banmanager)]
  400. set split_cmds [split $cmds ";"]
  401. foreach cmd $split_cmds {
  402. set thecmd [lindex $cmd 0]
  403. set rest_of [lrange $cmd 1 end]
  404. set status [btcmd:status $chan $hand $thecmd 1]
  405. if {$status == "1"} {
  406. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  407. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  408. lappend show_cmds [join $applycmd " "]
  409. }
  410. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 450] {
  411. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$txt"
  412. }
  413. }
  414. OWNER {
  415. set cmds [string map [array get replace] $black(say.$getlang.banbossowner)]
  416. set split_cmds [split $cmds ";"]
  417. foreach cmd $split_cmds {
  418. set thecmd [lindex $cmd 0]
  419. set rest_of [lrange $cmd 1 end]
  420. set status [btcmd:status $chan $hand $thecmd 1]
  421. if {$status == "1"} {
  422. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  423. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  424. lappend show_cmds [join $applycmd " "]
  425. }
  426. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 440] {
  427. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$txt"
  428. }
  429. }
  430. BOSS {
  431. set cmds [string map [array get replace] $black(say.$getlang.banbossowner)]
  432. set split_cmds [split $cmds ";"]
  433. foreach cmd $split_cmds {
  434. set thecmd [lindex $cmd 0]
  435. set rest_of [lrange $cmd 1 end]
  436. set status [btcmd:status $chan $hand $thecmd 1]
  437. if {$status == "1"} {
  438. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  439. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  440. lappend show_cmds [join $applycmd " "]
  441. }
  442. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 440] {
  443. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$txt"
  444. }
  445. }
  446. MASTER {
  447. set cmds [string map [array get replace] $black(say.$getlang.banmaster)]
  448. set split_cmds [split $cmds ";"]
  449. foreach cmd $split_cmds {
  450. set thecmd [lindex $cmd 0]
  451. set rest_of [lrange $cmd 1 end]
  452. set status [btcmd:status $chan $hand $thecmd 1]
  453. if {$status == "1"} {
  454. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  455. } else { set applycmd "\002$thecmd\002 [join $rest_of] ;" }
  456. lappend show_cmds [join $applycmd " "]
  457. }
  458. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 440] {
  459. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$txt"
  460. }
  461. }
  462. }
  463. switch $type {
  464. 0 {
  465. blacktools:tell $nick $host $hand $chan $chan1 hcommand.1 none
  466. }
  467. 1 {
  468. blacktools:tell $nick $host $hand $chan $chan1 hcommand.2 none
  469. }
  470. 2 {
  471. blacktools:tell $nick $host $hand $chan $chan1 hcommand.3 none
  472. }
  473. }
  474. }
  475. add {
  476. switch $access {
  477. ADMIN {
  478. set cmds [string map [array get replace] $black(say.$getlang.addadmin)]
  479. set split_cmds [split $cmds ";"]
  480. foreach cmd $split_cmds {
  481. set thecmd [lindex $cmd 0]
  482. set rest_of [lrange $cmd 1 end]
  483. set status [btcmd:status $chan $hand $thecmd 1]
  484. if {$status == "1"} {
  485. continue
  486. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  487. lappend show_cmds [join $applycmd " "]
  488. }
  489. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  490. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  491. }
  492. }
  493. MASTER {
  494. set cmds [string map [array get replace] $black(say.$getlang.addmaster)]
  495. set split_cmds [split $cmds ";"]
  496. foreach cmd $split_cmds {
  497. set thecmd [lindex $cmd 0]
  498. set rest_of [lrange $cmd 1 end]
  499. set status [btcmd:status $chan $hand $thecmd 1]
  500. if {$status == "1"} {
  501. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  502. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  503. lappend show_cmds [join $applycmd " "]
  504. }
  505. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  506. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  507. }
  508. }
  509. MANAGER {
  510. set cmds [string map [array get replace] $black(say.$getlang.addmanager)]
  511. set split_cmds [split $cmds ";"]
  512. foreach cmd $split_cmds {
  513. set thecmd [lindex $cmd 0]
  514. set rest_of [lrange $cmd 1 end]
  515. set status [btcmd:status $chan $hand $thecmd 1]
  516. if {$status == "1"} {
  517. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  518. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  519. lappend show_cmds [join $applycmd " "]
  520. }
  521. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  522. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  523. }
  524. }
  525. OWNER {
  526. set cmds [string map [array get replace] $black(say.$getlang.addowner)]
  527. set split_cmds [split $cmds ";"]
  528. foreach cmd $split_cmds {
  529. set thecmd [lindex $cmd 0]
  530. set rest_of [lrange $cmd 1 end]
  531. set status [btcmd:status $chan $hand $thecmd 1]
  532. if {$status == "1"} {
  533. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  534. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  535. lappend show_cmds [join $applycmd " "]
  536. }
  537. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  538. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  539. }
  540. }
  541. BOSS {
  542. set cmds [string map [array get replace] $black(say.$getlang.addbossowner)]
  543. set split_cmds [split $cmds ";"]
  544. foreach cmd $split_cmds {
  545. set thecmd [lindex $cmd 0]
  546. set rest_of [lrange $cmd 1 end]
  547. set status [btcmd:status $chan $hand $thecmd 1]
  548. if {$status == "1"} {
  549. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  550. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  551. lappend show_cmds [join $applycmd " "]
  552. }
  553. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  554. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  555. }
  556. }
  557. }
  558. switch $type {
  559. 0 {
  560. blacktools:tell $nick $host $hand $chan $chan1 hcommand.1 none
  561. }
  562. 1 {
  563. blacktools:tell $nick $host $hand $chan $chan1 hcommand.2 none
  564. }
  565. 2 {
  566. blacktools:tell $nick $host $hand $chan $chan1 hcommand.3 none
  567. }
  568. }
  569. }
  570. manager {
  571. if {$access == "MANAGER"} {
  572. set cmds [string map [array get replace] $black(say.$getlang.hmanager.1)]
  573. set split_cmds [split $cmds ";"]
  574. foreach cmd $split_cmds {
  575. set thecmd [lindex $cmd 0]
  576. set rest_of [lrange $cmd 1 end]
  577. set status [btcmd:status $chan $hand $thecmd 1]
  578. if {$status == "1"} {
  579. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  580. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  581. lappend show_cmds [join $applycmd " "]
  582. }
  583. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  584. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
  585. }
  586. switch $type {
  587. 0 {
  588. blacktools:tell $nick $host $hand $chan $chan1 hcommand.1 none
  589. }
  590. 1 {
  591. blacktools:tell $nick $host $hand $chan $chan1 hcommand.2 none
  592. }
  593. 2 {
  594. blacktools:tell $nick $host $hand $chan $chan1 hcommand.3 none
  595. }
  596. }
  597. }
  598. }
  599. master {
  600. if {$access == "MASTER"} {
  601. set cmds [string map [array get replace] $black(say.$getlang.hmaster.1)]
  602. set split_cmds [split $cmds ";"]
  603. foreach cmd $split_cmds {
  604. set thecmd [lindex $cmd 0]
  605. set rest_of [lrange $cmd 1 end]
  606. set status [btcmd:status $chan $hand $thecmd 1]
  607. if {$status == "1"} {
  608. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  609. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  610. lappend show_cmds [join $applycmd " "]
  611. }
  612. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  613. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$txt"
  614. }
  615. switch $type {
  616. 0 {
  617. blacktools:tell $nick $host $hand $chan $chan1 hcommand.1 none
  618. }
  619. 1 {
  620. blacktools:tell $nick $host $hand $chan $chan1 hcommand.2 none
  621. }
  622. 2 {
  623. blacktools:tell $nick $host $hand $chan $chan1 hcommand.3 none
  624. }
  625. }
  626. }
  627. }
  628. owner {
  629. if {[matchattr $hand nm]} {
  630. set cmds [string map [array get replace] $black(say.$getlang.hbossowner.1)]
  631. set split_cmds [split $cmds ";"]
  632. foreach cmd $split_cmds {
  633. set thecmd [lindex $cmd 0]
  634. set rest_of [lrange $cmd 1 end]
  635. set status [btcmd:status $chan $hand $thecmd 1]
  636. if {$status == "1"} {
  637. set applycmd "\00300,14$thecmd [join $rest_of]\003"
  638. } else { set applycmd "[black:color 1 $hand $thecmd] [black:color 6 $hand [join $rest_of]] ;" }
  639. lappend show_cmds [join $applycmd " "]
  640. }
  641. }
  642. foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
  643. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$txt"
  644. }
  645. switch $type {
  646. 0 {
  647. blacktools:tell $nick $host $hand $chan $chan1 hcommand.1 none
  648. }
  649. 1 {
  650. blacktools:tell $nick $host $hand $chan $chan1 hcommand.2 none
  651. }
  652. 2 {
  653. blacktools:tell $nick $host $hand $chan $chan1 hcommand.3 none
  654. }
  655. }
  656. }
  657. btinfo {
  658. if {[matchattr $hand nmo|M $chan]} {
  659. set btstr_list ""
  660. foreach setting $black(extra_flag) {
  661. if {$setting != ""} {
  662. if {[string equal -nocase $setting "chanlink"]} {
  663. continue
  664. }
  665. if {([string equal -nocase $setting "invisible"] || [string equal -nocase $setting "forward"]) && [matchattr $hand mo|M $chan] && ![matchattr $hand n]} {
  666. continue
  667. }
  668. if {[string equal -nocase $setting "settingsaved"]} {
  669. continue
  670. }
  671. if {[setting:get $chan $setting]} {
  672. lappend btflags +[black:color 2 $hand $setting]
  673. } else {
  674. lappend btflags -[black:color 4 $hand $setting]
  675. }
  676. }
  677. }
  678. foreach setting $black(extra_str) {
  679. if {$setting != ""} {
  680. if {[setting:get $chan $setting] != ""} {
  681. if {![string equal -nocase $setting "joincount"] && ![string equal -nocase $setting "jointime"] && ![string equal -nocase $setting "kickcount"]} {
  682. set str_length [llength [setting:get $chan $setting]]
  683. set text [setting:get $chan $setting]
  684. if {$str_length > 1} {
  685. if {$str_length > 3 } {
  686. set text "[lrange $text 0 3] .."
  687. }
  688. set text \"[join $text]\"
  689. } else { set text [join $text] }
  690. lappend btstr_list [black:color 1 $hand $setting] $text
  691. }
  692. }
  693. }
  694. }
  695. if {$btstr_list == ""} {
  696. set btstr_list "N/A"
  697. }
  698. set btflag_list "$black(say.$getlang.hchaninfo.2) $btflags"
  699. set btstr_list "$black(say.$getlang.hchaninfo.4) $btstr_list"
  700. foreach flag [wordwrap [join $btflag_list] 440] {
  701. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$flag"
  702. }
  703. foreach str [wordwrap [join $btstr_list] 440] {
  704. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$str"
  705. }
  706. switch $type {
  707. 0 {
  708. blacktools:tell $nick $host $hand $chan $chan1 hcommand.4 none
  709. }
  710. 1 {
  711. blacktools:tell $nick $host $hand $chan $chan1 hcommand.5 none
  712. }
  713. 2 {
  714. blacktools:tell $nick $host $hand $chan $chan1 hcommand.6 none
  715. }
  716. }
  717. }
  718. }
  719. chaninfo {
  720. if {[matchattr $hand nmo|M $chan]} {
  721. set flag_list ""
  722. foreach info [channel info $chan] {
  723. if {[regexp {^[+]} $info]} {
  724. lappend flag_list [black:color 2 $hand $info]
  725. }
  726. if {[regexp {^[-]} $info]} {
  727. lappend flag_list [black:color 4 $hand $info]
  728. }
  729. }
  730. set expirebans [setting:get $chan expirebans]
  731. if {$expirebans == ""} {
  732. set expirebans $black(default:bantime)
  733. }
  734. set floodchan [channel get $chan flood-chan]
  735. set floodjoin [channel get $chan flood-join]
  736. set floodkick [channel get $chan flood-kick]
  737. set floodctcp [channel get $chan flood-ctcp]
  738. set floodnick [channel get $chan flood-nick]
  739. set flooddeop [channel get $chan flood-deop]
  740. set chanmode [channel get $chan chanmode]
  741. set floodchan [string map {" " ":"} $floodchan]
  742. set floodjoin [string map {" " ":"} $floodjoin]
  743. set floodkick [string map {" " ":"} $floodkick]
  744. set floodctcp [string map {" " ":"} $floodctcp]
  745. set floodnick [string map {" " ":"} $floodnick]
  746. set flooddeop [string map {" " ":"} $flooddeop]
  747. set eggdrop_flags "[black:color 1 $hand flood-chan] $floodchan [black:color 1 $hand flood-join] $floodjoin [black:color 1 $hand flood-kick] $floodkick [black:color 1 $hand flood-ctcp] $floodctcp [black:color 1 $hand flood-nick] $floodnick [black:color 1 $hand flood-deop] $flooddeop [black:color 1 $hand expirebans] $expirebans [black:color 1 $hand chanmode] $chanmode"
  748. foreach flag [wordwrap $flag_list 400] {
  749. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 " $black(say.$getlang.hchaninfo.1) $flag"
  750. }
  751. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 "$black(say.$getlang.hchaninfo.3) : $eggdrop_flags"
  752. switch $type {
  753. 0 {
  754. blacktools:tell $nick $host $hand $chan $chan1 hcommand.4 none
  755. }
  756. 1 {
  757. blacktools:tell $nick $host $hand $chan $chan1 hcommand.5 none
  758. }
  759. 2 {
  760. blacktools:tell $nick $host $hand $chan $chan1 hcommand.6 none
  761. }
  762. }
  763. }
  764. }
  765. module {
  766. set allmodules "Anunt AutoBroadcast BadChan Idle Limit XTools Xonly Seen VoiceMe VoiceOnMsg CloneScan EGG ChanLink SecureMode Private Greet Leave Count Topic Timer Next TopWords BackChan ReportNick Quote Note Language AutoUpdate Vote Alias TCL"
  767. set manager_module "Anunt BadChan Idle Limit XTools Xonly Seen VoiceMe VoiceOnMsg Clonescan Securemode Private Greet Leave Count Topic Next TopWords BackChan ReportNick Quote Note Language Vote Alias"
  768. set owner_modules "Anunt AutoBroadcast BadChan Idle Limit CloneScan XTools Xonly Seen VoiceMe VoiceOnMsg CloneScan EGG ChanLink SecureMode Private Greet Leave Count Topic Timer Next TopWords BackChan ReportNick Quote Note Language Vote Alias"
  769. set module_output ""
  770. set other_module "Note Quote TopWords Vote Alias"
  771. set master_module "Anunt BadChan Idle Limit XTools Xonly Seen VoiceMe VoiceOnMsg Clonescan Securemode Private Greet Leave Count Topic Next TopWords BackChan ReportNick Quote Note Language Vote Alias"
  772. if {[matchattr $hand n]} {
  773. set current_modules $allmodules
  774. } elseif {[matchattr $hand m]} {
  775. set current_modules $owner_modules
  776. } elseif {[matchattr $hand o]} {
  777. set current_modules $master_module
  778. } elseif {[matchattr $hand -|M $chan]} {
  779. set current_modules $manager_module
  780. } else {
  781. set current_modules $other_module
  782. }
  783. foreach m $current_modules {
  784. if {[string equal -nocase $m "quote"]} {
  785. set m "q"
  786. }
  787. if {[string equal -nocase $m "autobroadcast"]} {
  788. set m "bt"
  789. }
  790. set cmd_status [btcmd:status $chan $hand $m 1]
  791. if {[string equal -nocase $m "Topic"]} {
  792. set m "AutoTopic"
  793. }
  794. if {[string equal -nocase $m "q"]} {
  795. set m "Quote"
  796. }
  797. if {[string equal -nocase $m "bt"]} {
  798. set m "AutoBroadcast"
  799. }
  800. if {$cmd_status == "1"} {
  801. set m "\0034$m\003"
  802. }
  803. switch [string tolower [color:filter $m]] {
  804. count {
  805. if {[setting:get $chan greet]} {
  806. set read_msg ""
  807. set file [open $black(join_file) r]
  808. while {[gets $file line] != -1} {
  809. set read_modul [lindex [split $line] 0]
  810. set read_chan [lindex [split $line] 1]
  811. set enc_chan [encoding convertfrom utf-8 $read_chan]
  812. if {[string equal -nocase $read_modul "greet"] && [string equal -nocase $chan $enc_chan]} {
  813. set read_msg [lrange [split $line] 2 end]
  814. set getgreet [encoding convertfrom utf-8 $read_msg]
  815. }
  816. }
  817. close $file
  818. if {[lsearch -exact [color:filter $read_msg] "%count%"] > -1} {
  819. lappend module_output "[black:color 2 $hand $m]\[+\]"
  820. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  821. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  822. }
  823. anunt {
  824. if {[setting:get $chan anunt]} {
  825. lappend module_output "[black:color 2 $hand $m]\[+\] ;"
  826. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  827. }
  828. quote {
  829. if {[setting:get $chan quote]} {
  830. lappend module_output "[black:color 2 $hand $m]\[+\] ;"
  831. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  832. }
  833. note {
  834. if {[setting:get $chan note]} {
  835. lappend module_output "[black:color 2 $hand $m]\[+\] ;"
  836. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  837. }
  838. chanlink {
  839. if {[link:status $chan] == "1"} {
  840. lappend module_output "[black:color 2 $hand $m]\[+\] ;"
  841. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"
  842. }
  843. }
  844. autobroadcast {
  845. set found_module 0
  846. foreach tmr [timers] {
  847. if {[string match "*broadcastpublic:show*" [join [lindex $tmr 1]]]} {
  848. lappend module_output "[black:color 2 $hand $m]\[+\]"
  849. set found_module 1
  850. }
  851. }
  852. if {$found_module == "0"} {
  853. lappend module_output "[black:color 4 $hand $m]\[-\]"
  854. }
  855. }
  856. badchan {
  857. if {[setting:get $chan antibadchan]} {
  858. lappend module_output "[black:color 2 $hand $m]\[+\]"
  859. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  860. }
  861. idle {
  862. set idle_type ""
  863. if {[setting:get $chan idleop]} {
  864. lappend idle_type "@"
  865. }
  866. if {[setting:get $chan idlevoice]} {
  867. lappend idle_type "+"
  868. }
  869. if {[setting:get $chan idlehalfop]} {
  870. lappend idle_type "%"
  871. }
  872. if {$idle_type == ""} {
  873. set idle_type ""
  874. }
  875. lappend module_output "[black:color 1 $hand $m]\[$idle_type\]"
  876. }
  877. limit {
  878. if {[setting:get $chan limit]} {
  879. lappend module_output "[black:color 2 $hand $m]\[+\]"
  880. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  881. }
  882. clonescan {
  883. if {[setting:get $chan clonescan]} {
  884. lappend module_output "[black:color 2 $hand $m]\[+\]"
  885. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  886. }
  887. xtools {
  888. if {[setting:get $chan xtools]} {
  889. lappend module_output "[black:color 2 $hand $m]\[+\] ;"
  890. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  891. }
  892. xonly {
  893. if {[setting:get $chan xonly]} {
  894. lappend module_output "[black:color 2 $hand $m]\[+\] ;"
  895. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  896. }
  897. seen {
  898. if {[setting:get $chan seen]} {
  899. lappend module_output "[black:color 2 $hand $m]\[+\]"
  900. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  901. }
  902. voiceme {
  903. if {[setting:get $chan voiceme]} {
  904. lappend module_output "[black:color 2 $hand $m]\[+\]"
  905. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  906. }
  907. voiceonmsg {
  908. if {[setting:get $chan voiceonmsg]} {
  909. lappend module_output "[black:color 2 $hand $m]\[+\]"
  910. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  911. }
  912. egg {
  913. lappend module_output "[black:color 1 $hand $m]\[\]"
  914. }
  915. autoupdate {
  916. if {$black(update_type) == 0} {
  917. lappend module_output "[black:color 2 $hand $m]\[+\]"
  918. } else {
  919. lappend module_output "[black:color 1 $hand $m]\[-\]"
  920. }
  921. }
  922. tcl {
  923. lappend module_output "[black:color 1 $hand $m]\[\]"
  924. }
  925. alias {
  926. lappend module_output "[black:color 1 $hand $m]\[\]"
  927. }
  928. note {
  929. if {[setting:get $chan note]} {
  930. lappend module_output "[black:color 2 $hand $m]\[+\]"
  931. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  932. }
  933. securemode {
  934. if {[setting:get $chan securemode]} {
  935. lappend module_output "[black:color 2 $hand $m]\[+\]"
  936. } else { lappend module_output "[black:color 4 $hand $m]\[-\]" }
  937. }
  938. vote {
  939. if {[setting:get $chan vote]} {
  940. lappend module_output "[black:color 2 $hand $m]\[+\]"
  941. } else { lappend module_output "[black:color 4 $hand $m]\[-\]" }
  942. }
  943. private {
  944. if {[setting:get $chan private]} {
  945. lappend module_output "[black:color 2 $hand $m]\[+\]"
  946. } else { lappend module_output "[black:color 4 $hand $m]\[-\]" }
  947. }
  948. greet {
  949. if {[setting:get $chan greet]} {
  950. lappend module_output "[black:color 2 $hand $m]\[+\]"
  951. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  952. }
  953. leave {
  954. if {[setting:get $chan leave]} {
  955. lappend module_output "[black:color 2 $hand $m]\[+\]"
  956. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  957. }
  958. autotopic {
  959. if {[setting:get $chan autotopic]} {
  960. lappend module_output "[black:color 2 $hand $m]\[+\]"
  961. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  962. }
  963. timer {
  964. lappend module_output "[black:color 1 $hand $m]\[\]"
  965. }
  966. topwords {
  967. if {[setting:get $chan topwords]} {
  968. lappend module_output "[black:color 2 $hand $m]\[+\]"
  969. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  970. }
  971. next {
  972. if {[setting:get $chan next]} {
  973. lappend module_output "[black:color 2 $hand $m]\[+\]"
  974. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  975. }
  976. quote {
  977. if {[setting:get $chan quoteofday]} {
  978. lappend module_output "[black:color 2 $hand $m]\[+\]"
  979. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  980. }
  981. backchan {
  982. if {[setting:get $chan backchan] != ""} {
  983. lappend module_output "[black:color 2 $hand $m]\[+\]"
  984. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  985. }
  986. reportnick {
  987. if {[setting:get $chan reportnick]} {
  988. lappend module_output "[black:color 2 $hand $m]\[+\]"
  989. } else { lappend module_output "[black:color 4 $hand $m]\[-\]"}
  990. }
  991. language {
  992. set lang [string toupper [setting:get $chan language]]
  993. if {$lang == ""} { set lang "[string toupper $black(default_lang)]" }
  994. lappend module_output "[black:color 1 $hand $m]\[$lang\]"
  995. }
  996. }
  997. }
  998. foreach m [h:wrap [join $module_output " ; "] 450] {
  999. blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $m
  1000. }
  1001. switch $type {
  1002. 0 {
  1003. blacktools:tell $nick $host $hand $chan $chan1 hcommand.7 none
  1004. }
  1005. 1 {
  1006. blacktools:tell $nick $host $hand $chan $chan1 hcommand.8 none
  1007. }
  1008. 2 {
  1009. blacktools:tell $nick $host $hand $chan $chan1 hcommand.9 none
  1010. }
  1011. }
  1012. }
  1013. egg {
  1014. set tcl_config $black(tclconfig)
  1015. set eggcmds ""
  1016. set egg_cmds "nick realname away homechan chanserv hostchanserv userlogin userpass chanremove-setting add-defaultmask add-mask user-expire banmethod-expire broadcast-showtime cmdchar defaultlang defaultoutput floodmenuprot userfloodmsgprot massfloodmsgprot massfloodsilencetime floodnotcprot pagelimit antibotidle"
  1017. set split_cmds [split $egg_cmds " "]
  1018. foreach cmd [color:filter $split_cmds] {
  1019. switch $cmd {
  1020. away {
  1021. set get_info [config:getinfo $tcl_config "set black(default_away) \"*\""]
  1022. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1023. }
  1024. add-mask {
  1025. set get_info [config:getinfo $tcl_config "set black(hostdefaultadd) \"*\""]
  1026. switch $get_info {
  1027. 1 {
  1028. set get_info "*!*@host"
  1029. }
  1030. 2 {
  1031. set get_info "*!user@host"
  1032. }
  1033. 3 {
  1034. set get_info "nick!user@host"
  1035. }
  1036. 4 {
  1037. set get_info "nick!*@*"
  1038. }
  1039. 5 {
  1040. set get_info "*!user@*"
  1041. }
  1042. }
  1043. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1044. }
  1045. hostchanserv {
  1046. set get_info [config:getinfo $tcl_config "set black(hostchanserv) \"*\""]
  1047. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1048. }
  1049. add-defaultmask {
  1050. set get_info [config:getinfo $tcl_config "set black(hostadd) \"*\""]
  1051. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1052. }
  1053. realname {
  1054. set get_info [config:getinfo $config "set realname \"*\""]
  1055. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1056. }
  1057. userlogin {
  1058. set get_info [config:getinfo $tcl_config "set black(username) \"*\""]
  1059. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1060. }
  1061. userpass {
  1062. set get_info [config:getinfo $tcl_config "set black(password) \"*\""]
  1063. if {$get_info == ""} { set get_info "N/A" }
  1064. set getc [string length $get_info]
  1065. set password ""
  1066. for {set i 0} { $i < $getc } { incr i} {
  1067. lappend password "*"
  1068. }
  1069. set get_info [join $password ""]
  1070. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1071. }
  1072. chanserv {
  1073. set get_info [config:getinfo $tcl_config "set black(chanserv) \"*\""]
  1074. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1075. }
  1076. nick {
  1077. set get_info [config:getinfo $config "set nick \"*\""]
  1078. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1079. }
  1080. cmdchar {
  1081. set get_info [config:getinfo $tcl_config "set black(cmdchar) \"*\""]
  1082. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1083. }
  1084. defaultlang {
  1085. set get_info [config:getinfo $tcl_config "set black(default_lang) \"*\""]
  1086. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1087. }
  1088. defaultoutput {
  1089. set get_info [config:getinfo $tcl_config "set black(default_output) \"*\""]
  1090. switch $get_info {
  1091. 0 {
  1092. set get_info "NOTICE"
  1093. }
  1094. 1 {
  1095. set get_info "CHAN"
  1096. }
  1097. 2 {
  1098. set get_info "PRIVMSG"
  1099. }
  1100. }
  1101. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1102. }
  1103. homechan {
  1104. set get_info [config:getinfo $tcl_config "set black(homechan) \"*\""]
  1105. if {[string equal -nocase $get_info "#no_home_chan"]} {
  1106. set get_info "N/A"
  1107. }
  1108. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1109. }
  1110. floodmenuprot {
  1111. set get_info [config:getinfo $tcl_config "set black(antiflood:cmd) \"*\""]
  1112. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1113. }
  1114. userfloodmsgprot {
  1115. set get_info [config:getinfo $tcl_config "set black(msg:flood) \"*\""]
  1116. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1117. }
  1118. massfloodmsgprot {
  1119. set get_info [config:getinfo $tcl_config "set black(mass:msg:flood) \"*\""]
  1120. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1121. }
  1122. massfloodsilencetime {
  1123. set get_info [config:getinfo $tcl_config "set black(mass:msg:silence_time) \"*\""]
  1124. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info$black(say.$getlang.timeout.9)\]
  1125. }
  1126. floodnotcprot {
  1127. set get_info [config:getinfo $tcl_config "set black(notice:flood) \"*\""]
  1128. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1129. }
  1130. chanremove-setting {
  1131. set get_info [config:getinfo $tcl_config "set black(chanremove_all) \"*\""]
  1132. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1133. }
  1134. antibotidle {
  1135. set get_info [config:getinfo $tcl_config "set black(antibotidle_status) \"*\""]
  1136. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1137. }
  1138. user-expire {
  1139. set get_info [config:getinfo $tcl_config "set black(user_expire_time) \"*\""]
  1140. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info$black(say.$getlang.timeout.4)\]
  1141. }
  1142. banmethod-expire {
  1143. set get_info [config:getinfo $tcl_config "set black(banmethod_memory_time) \"*\""]
  1144. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1145. }
  1146. broadcast-showtime {
  1147. set get_info [config:getinfo $tcl_config "set black(bttime) \"*\""]
  1148. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1149. }
  1150. pagelimit {
  1151. set get_info [config:getinfo $tcl_config "set black(modul:nr:entries) \"*\""]
  1152. lappend eggcmds [black:color 2 $hand $cmd]\[$get_info\]
  1153. }
  1154. login {
  1155. lappend eggcmds [black:color 2 $hand $cmd]
  1156. }
  1157. default {
  1158. lappend eggcmds [black:color 2 $hand $cmd]\[\]
  1159. }
  1160. }
  1161. }
  1162. foreach option [h:wrap [join $eggcmds " ; "] 450] {
  1163. blacktools:tell:h $nick $host $hand $chan $chan1 hegg.1 "$option"
  1164. }
  1165. switch $type {
  1166. 0 {
  1167. blacktools:tell $nick $host $hand $chan $chan1 hegg.2 none
  1168. }
  1169. 1 {
  1170. blacktools:tell $nick $host $hand $chan $chan1 hegg.3 none
  1171. }
  1172. 2 {
  1173. blacktools:tell $nick $host $hand $chan $chan1 hegg.4 none
  1174. }
  1175. }
  1176. }
  1177. }
  1178. }
  1179. ##############
  1180. #########################################################################
  1181. ## END ##
  1182. #########################################################################