BT.PrvCmds.tcl 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089
  1. #########################################################################
  2. ## BlackTools - The Ultimate Channel Control Script ##
  3. ## One TCL. One smart Eggdrop ##
  4. #########################################################################
  5. ####################### PRIVMSG CMDS TCL ############################
  6. #########################################################################
  7. ## ##
  8. ## BlackTools : http://blacktools.tclscripts.net ##
  9. ## Bugs report : http://www.tclscripts.net/ ##
  10. ## Online Help : irc://irc.undernet.org/tcl-help ##
  11. ## #TCL-HELP / UnderNet ##
  12. ## You can ask in english or romanian ##
  13. ## ##
  14. #########################################################################
  15. proc command:pubpriv {nick host hand arg} {
  16. global black server uptime {server-online} botnick userfile
  17. set cmd [lindex [split $arg] 0]
  18. set chan [lindex [split $arg] 1]
  19. set check_code [join [lrange [split $arg] 2 end]]
  20. set chan1 $nick
  21. set found_access 0
  22. set mychan_use 0
  23. if {![regexp {^[&#]} $chan]} {
  24. if {[validuser $hand]} {
  25. set mychan [join [string tolower [getuser $hand XTRA MYCHAN]]]
  26. if {[validchan $mychan] && [matchattr $hand nmo|OVMA $mychan] && ![string equal -nocase $cmd "unbanme"]} {
  27. set chan [string tolower $mychan]
  28. set mychan_use 1
  29. }
  30. }
  31. }
  32. switch [string tolower $cmd] {
  33. report {
  34. set type 2
  35. set what [lindex [split $arg] 2]
  36. set message [join [lrange [split $arg] 3 end]]
  37. if {$mychan_use == "1"} {
  38. set what [lindex [split $arg] 1]
  39. set message [join [lrange [split $arg] 2 end]]
  40. }
  41. set chan1 $chan
  42. if {[matchattr $hand mno|MAO $chan]} {
  43. return
  44. }
  45. report:process $nick "prv" $hand $chan $chan1 $type $what $message
  46. }
  47. idle {
  48. if {[matchattr $hand nmo|M $chan]} {
  49. set type 2
  50. set chan1 "$chan"
  51. set why [lindex [split $arg] 2]
  52. set user [lindex [split $arg] 3]
  53. set host [lindex [split $arg] 4]
  54. if {$mychan_use == "1"} {
  55. set why [lindex [split $arg] 1]
  56. set user [lindex [split $arg] 2]
  57. set host [lindex [split $arg] 3]
  58. }
  59. antidle:process $why $type $user "prv" $nick $hand $chan $chan1
  60. }
  61. }
  62. link {
  63. if {[matchattr $hand nmo]} {
  64. set type 2
  65. set channels [join [lrange [split $arg] 1 end]]
  66. set what [lindex [split $arg] 1]
  67. set delchan [lindex [split $arg] 2]
  68. set chan1 $chan
  69. link:process $nick "prv" $hand $chan $chan1 $type $what $channels $delchan
  70. }
  71. }
  72. note {
  73. set found_access 0
  74. foreach c [channels] {
  75. if {[matchattr $hand nmo|MAOV $c]} {
  76. set found_access 1
  77. }
  78. }
  79. if {$found_access == "1"} {
  80. set type 2
  81. set chan1 $chan
  82. set who [lindex [split $arg] 1]
  83. set note [join [lrange [split $arg] 1 end]]
  84. set number [lindex [split $arg] 2]
  85. set user_send [lindex [split $arg] 2]
  86. set note_send [join [lrange [split $arg] 3 end]]
  87. note:process $nick "prv" $hand $chan $chan1 $who $note $user_send $note_send $number $type
  88. }
  89. }
  90. q {
  91. if {[matchattr $hand nmo|MAOV $chan]} {
  92. if {$mychan_use == "1"} {
  93. set who [lindex [split $arg] 1]
  94. set next [lindex [split $arg] 2]
  95. set quote [join [lrange [split $arg] 1 end]]
  96. if {$who == "*"} {
  97. set who [lindex [split $arg] 2]
  98. set quote [join [lrange [split $arg] 1 end]]
  99. }
  100. if {[regexp {^[\[]} $who]} {
  101. set who [lindex [split $arg] 2]
  102. set quote [join [lrange [split $arg] 1 end]]
  103. if {$who == "*"} {
  104. set who [lindex [split $arg] 3]
  105. set quote [join [lrange [split $arg] 1 end]]
  106. }
  107. }
  108. } else {
  109. set who [lindex [split $arg] 2]
  110. set next [lindex [split $arg] 3]
  111. set quote [join [lrange [split $arg] 2 end]]
  112. if {$who == "*"} {
  113. set who [lindex [split $arg] 3]
  114. set quote [join [lrange [split $arg] 2 end]]
  115. }
  116. if {[regexp {^[\[]} $who]} {
  117. set who [lindex [split $arg] 3]
  118. set quote [join [lrange [split $arg] 2 end]]
  119. if {$who == "*"} {
  120. set who [lindex [split $arg] 4]
  121. set quote [join [lrange [split $arg] 2 end]]
  122. }
  123. }
  124. }
  125. set type 2
  126. set chan1 $chan
  127. if {$mychan_use == "1"} {
  128. quote:process $nick "prv" $hand $chan $chan1 $type $who $quote [lrange [split $arg] 1 end] $next
  129. } else {
  130. quote:process $nick "prv" $hand $chan $chan1 $type $who $quote [lrange [split $arg] 2 end] $next
  131. }
  132. }
  133. }
  134. check {
  135. if {![validchan $chan]} {
  136. return
  137. }
  138. if {[setting:get $chan securemode] == "0"} {
  139. return
  140. }
  141. if {![botisop $chan] && ![setting:get $chan xonly]} {
  142. return
  143. }
  144. if {![info exists black(securecode:$nick:$chan)]} {
  145. return
  146. }
  147. set chanmode [getchanmode $chan]
  148. if {[string match -nocase "*D*" $chanmode] && [string match -nocase "*m*" $chanmode]} {
  149. if {[string equal -nocase $check_code $black(securecode:$nick:$chan)]} {
  150. set lang [setting:get $chan lang]
  151. if {$lang == ""} { set lang [string tolower $black(default_lang)] }
  152. if {[setting:get $chan xonly]} {
  153. putserv "PRIVMSG $black(chanserv) :voice $nick $chan"
  154. set replace(%chan%) $chan
  155. set replace(%msg.1%) $nick
  156. set message [string map [array get replace] $black(say.$lang.securemode.2)]
  157. putserv "PRIVMSG $nick :$message"
  158. if {[info exists black(secure:$chan:allowlist)]} {
  159. if {[lsearch -exact [string tolower $black(secure:$chan:allowlist)] [string tolower $host]] < 0} {
  160. lappend black(secure:$chan:allowlist) $host
  161. }
  162. } else { lappend black(secure:$chan:allowlist) $host }
  163. } else {
  164. putserv "MODE $chan +v $nick"
  165. set replace(%chan%) $chan
  166. set replace(%msg.1%) $nick
  167. set message [string map [array get replace] $black(say.$lang.securemode.2)]
  168. putserv "PRIVMSG $nick :$message"
  169. if {[info exists black(secure:$chan:allowlist)]} {
  170. if {[lsearch -exact [string tolower $black(secure:$chan:allowlist)] [string tolower $host]] < 0} {
  171. lappend black(secure:$chan:allowlist) $host
  172. }
  173. } else { lappend black(secure:$chan:allowlist) $host }
  174. if {[info exists black(securecode:$nick:$chan)]} {
  175. unset black(securecode:$nick:$chan)
  176. }
  177. if {[lsearch -exact [string tolower $black(secure:$chan:list)] [string tolower $nick]] > -1} {
  178. set position [lsearch -exact [string tolower $black(secure:$chan:list)] [string tolower $nick]]
  179. set black(secure:$chan:list) [lreplace $black(secure:$chan:list) $position $position]
  180. }
  181. }
  182. }
  183. }
  184. }
  185. voiceme {
  186. if {![validchan $chan]} {
  187. return
  188. }
  189. if {![setting:get $chan voiceme]} {
  190. return
  191. }
  192. if {![botisop $chan] && ![setting:get $chan xonly]} {
  193. return
  194. }
  195. if {![onchan $nick $chan]} {
  196. return
  197. }
  198. if {[isop $nick $chan] || [isvoice $nick $chan]} {
  199. return
  200. }
  201. if {[setting:get $chan onlyonmode] && ![info exists black(voiceme:stat:$chan)]} {
  202. return
  203. }
  204. if {[isvoice $nick $chan]} {
  205. blacktools:tell $nick "prv" $hand $chan $chan1 voiceme.4 none
  206. return
  207. }
  208. putserv "WHOIS $nick"
  209. set ::vnick $nick
  210. set ::vchan $chan
  211. set ::vhand $hand
  212. bind RAW - 330 voiceme:logged
  213. bind RAW - 307 voiceme:identified
  214. }
  215. unbanme {
  216. if {![regexp {^[&#]} $chan]} {
  217. return
  218. }
  219. if {![validchan $chan]} {
  220. return
  221. }
  222. if {![botisop $chan] && ![setting:get $chan xonly]} {
  223. return
  224. }
  225. set found_ban 0
  226. foreach b [blacktools:banlist $chan] {
  227. set read_chan [lindex [split $b] 2]
  228. if {[string equal -nocase $read_chan $chan]} {
  229. set read_host [lindex [split $b] 3]
  230. set real_read_host [string map [list \[ {\[} \] {\]} \? {\?} \\ {\\}] $read_host]
  231. if {[string match -nocase $real_read_host "$nick!$host"] || [string match -nocase "$nick!$host" $real_read_host]} {
  232. set read_bot [lindex [split $b] 7]
  233. if {$read_bot == 3} {
  234. set found_ban 1
  235. }
  236. }
  237. }
  238. }
  239. if {$found_ban == "0"} {
  240. return
  241. }
  242. set code [join [lrange [split $arg] 2 end]]
  243. if {$code == ""} {
  244. set black(botcode:$chan) [string toupper [bot:setcode]]
  245. blacktools:tell $nick "prv" $hand $chan $chan1 bot.6 $black(botcode:$chan)
  246. foreach tmr [utimers] {
  247. if {[string match "*unset black(botcode:$chan)*" [join [lindex $tmr 1]]]} {
  248. killutimer [lindex $tmr 2]
  249. }
  250. }
  251. utimer 60 [list unset black(botcode:$chan)]
  252. return
  253. }
  254. if {![info exists black(botcode:$chan)]} {
  255. return
  256. }
  257. if {[string equal -nocase $code $black(botcode:$chan)]} {
  258. foreach b [blacktools:banlist $chan] {
  259. set read_chan [lindex [split $b] 2]
  260. set read_host [lindex [split $b] 3]
  261. set real_read_host [string map [list \[ {\[} \] {\]} \? {\?} \\ {\\}] $read_host]
  262. if {[string match -nocase $real_read_host "$nick!$host"]} {
  263. set read_bot [lindex [split $b] 7]
  264. if {$read_bot == 3} {
  265. if {[ischanban $read_host $chan] && [botisop $chan]} {
  266. pushmode $chan -b $read_host
  267. }
  268. if {[setting:get $chan xonly] || [setting:get $chan xtools]} {
  269. putquick "PRIVMSG $black(chanserv) :unban $chan $read_host"
  270. }
  271. blacktools:auto:remove $read_host $chan
  272. blacktools:tell $nick "prv" $hand $chan $chan1 bot.7 none
  273. }
  274. }
  275. }
  276. }
  277. }
  278. enable {
  279. if {[matchattr $hand nmo|M $chan]} {
  280. set what [lindex [split $arg] 2]
  281. set user [lindex [split $arg] 3]
  282. if {$mychan_use == "1"} {
  283. set what [lindex [split $arg] 1]
  284. set user [lindex [split $arg] 2]
  285. }
  286. set chan1 "$chan"
  287. set type "2"
  288. enable:process $nick "prv" $hand $chan $chan1 $type $what $user
  289. }
  290. }
  291. disable {
  292. if {[matchattr $hand nmo|M $chan]} {
  293. set what [lindex [split $arg] 2]
  294. set user [lindex [split $arg] 3]
  295. if {$mychan_use == "1"} {
  296. set what [lindex [split $arg] 1]
  297. set user [lindex [split $arg] 2]
  298. }
  299. set chan1 "$chan"
  300. set type "2"
  301. disable:process $nick "prv" $hand $chan $chan1 $type $what $user
  302. }
  303. }
  304. dr {
  305. if {[matchattr $hand nmo|OSMA $chan]} {
  306. set drone [lindex [split $arg] 2]
  307. if {$mychan_use == "1"} {
  308. set drone [lindex [split $arg] 1]
  309. }
  310. set type 2
  311. set chan1 "$chan"
  312. userhost:act $drone $nick $hand "prv" $chan $chan1 $type $black(dr:bantime) "dr" "" "0"
  313. }
  314. }
  315. bot {
  316. if {[matchattr $hand nmo|OSMA $chan]} {
  317. set bot [lindex [split $arg] 2]
  318. if {$mychan_use == "1"} {
  319. set bot [lindex [split $arg] 1]
  320. }
  321. set type 2
  322. set chan1 "$chan"
  323. userhost:act $bot $nick "$hand:bot" "prv" $chan $chan1 $type $black(bot:bantime) "bot" "" "0"
  324. }
  325. }
  326. n {
  327. if {[matchattr $hand nmo|OMA $chan]} {
  328. set badnick [lindex [split $arg] 2]
  329. if {$mychan_use == "1"} {
  330. set badnick [lindex [split $arg] 1]
  331. }
  332. set type 0
  333. set chan1 "$chan"
  334. if {[setting:get $chan nextshortcmd]} {
  335. nextpublic:process $nick "prv" $hand $chan $chan1 $badnick
  336. return
  337. }
  338. if {[regexp {\*} $badnick]} {
  339. blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "n"
  340. return
  341. }
  342. if {$badnick == ""} {
  343. blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "n"
  344. return
  345. }
  346. bancmds:process $badnick $badnick $nick $hand "prv" $chan $chan1 $type $black(n:bantime) "n" "" "0"
  347. }
  348. }
  349. id {
  350. if {[matchattr $hand nmo|OMA $chan]} {
  351. set badident [lindex [split $arg] 2]
  352. if {$mychan_use == "1"} {
  353. set badident [lindex [split $arg] 1]
  354. }
  355. set handle [nick2hand $badident]
  356. set type 2
  357. set chan1 "$chan"
  358. userhost:act $badident $nick $hand "prv" $chan $chan1 $type $black(id:bantime) "id" "" "0"
  359. }
  360. }
  361. spam {
  362. if {[matchattr $hand nmo|OMA $chan]} {
  363. set spammer [lindex [split $arg] 2]
  364. if {$mychan_use == "1"} {
  365. set spammer [lindex [split $arg] 1]
  366. }
  367. set type 2
  368. set chan1 "$chan"
  369. userhost:act $spammer $nick $hand "prv" $chan $chan1 $type $black(spam:bantime) "spam" "" "0"
  370. }
  371. }
  372. bw {
  373. if {[matchattr $hand nmo|OMA $chan]} {
  374. set badw [lindex [split $arg] 2]
  375. if {$mychan_use == "1"} {
  376. set badw [lindex [split $arg] 1]
  377. }
  378. set type 2
  379. set chan1 "$chan"
  380. userhost:act $badw $nick $hand "prv" $chan $chan1 $type $black(bw:bantime) "bw" "" "0"
  381. }
  382. }
  383. black {
  384. if {[matchattr $hand nmo|MA $chan]} {
  385. set blackb [lindex [split $arg] 2]
  386. set reason [join [lrange [split $arg] 3 end]]
  387. if {$mychan_use == "1"} {
  388. set blackb [lindex [split $arg] 1]
  389. set reason [join [lrange [split $arg] 2 end]]
  390. }
  391. set type 2
  392. set chan1 "$chan"
  393. userhost:act $blackb $nick $hand "prv" $chan $chan1 $type "0" "black" $reason "0"
  394. }
  395. }
  396. bl {
  397. if {[matchattr $hand nmo|MA $chan]} {
  398. set blackb [lindex [split $arg] 2]
  399. set reason [join [lrange [split $arg] 3 end]]
  400. if {$mychan_use == "1"} {
  401. set blackb [lindex [split $arg] 1]
  402. set reason [join [lrange [split $arg] 2 end]]
  403. }
  404. set type 2
  405. set chan1 "$chan"
  406. userhost:act $blackb $nick $hand "prv" $chan $chan1 $type "0" "black" $reason "0"
  407. }
  408. }
  409. b {
  410. if {[matchattr $hand nmo|MAO $chan]} {
  411. set no_chan 0
  412. set type 2
  413. set gl 0
  414. set link 0
  415. set chan1 "$chan"
  416. set level ""
  417. set b [lindex [split $arg] 2]
  418. set tm [lindex [split $arg] 3]
  419. set global [lindex [split $arg] 4]
  420. set reason [join [lrange [split $arg] 5 end]]
  421. set return_time [time_return_minute $tm]
  422. if {$return_time == "-1"} {
  423. set global [lindex [split $arg] 3]
  424. set reason [join [lrange [split $arg] 4 end]]
  425. }
  426. if {![regexp {^[&#]} $chan]} {
  427. set no_chan 1
  428. set b [lindex [split $arg] 1]
  429. set tm [lindex [split $arg] 2]
  430. set global [lindex [split $arg] 3]
  431. set reason [join [lrange [split $arg] 4 end]]
  432. set return_time [time_return_minute $tm]
  433. if {$return_time == "-1"} {
  434. set global [lindex [split $arg] 2]
  435. set reason [join [lrange [split $arg] 3 end]]
  436. }
  437. }
  438. if {$mychan_use == "1"} {
  439. set b [lindex [split $arg] 1]
  440. set tm [lindex [split $arg] 2]
  441. set global [lindex [split $arg] 3]
  442. set reason [join [lrange [split $arg] 4 end]]
  443. set return_time [time_return_minute $tm]
  444. if {$return_time == "-1"} {
  445. set global [lindex [split $arg] 2]
  446. set reason [join [lrange [split $arg] 3 end]]
  447. }
  448. if {[regexp {^[-]} $tm]} {
  449. set level [blacktools:check:levelban $hand $chan $tm]
  450. set reason [join [lrange [split $arg] 4 end]]
  451. set tm [lindex [split $arg] 3]
  452. set return_time [time_return_minute $tm]
  453. if {$return_time == "-1"} {
  454. set tm [lindex [split $arg] 2]
  455. set reason [join [lrange [split $arg] 3 end]]
  456. }
  457. } elseif {[string equal -nocase "$global" "global"] && [matchattr $hand nm]} {
  458. set gl 1
  459. set tm [lindex [split $arg] 2]
  460. set reason [join [lrange [split $arg] 4 end]]
  461. set return_time [time_return_minute $tm]
  462. if {$return_time == "-1"} {
  463. set reason [join [lrange [split $arg] 3 end]]
  464. }
  465. } elseif {[string equal -nocase "$global" "link"] && [matchattr $hand nm]} {
  466. set link 1
  467. set tm [lindex [split $arg] 2]
  468. set reason [join [lrange [split $arg] 4 end]]
  469. set return_time [time_return_minute $tm]
  470. if {$return_time == "-1"} {
  471. set reason [join [lrange [split $arg] 3 end]]
  472. }
  473. if {$no_chan == "1"} {
  474. set b [lindex [split $arg] 1]
  475. set tm [lindex [split $arg] 2]
  476. set global [lindex [split $arg] 3]
  477. set reason [join [lrange [split $arg] 4 end]]
  478. set return_time [time_return_minute $tm]
  479. if {$return_time == "-1"} {
  480. set global [lindex [split $arg] 2]
  481. set reason [join [lrange [split $arg] 3 end]]
  482. }
  483. }
  484. } else {
  485. if {$return_time == "-1"} {
  486. set reason [join [lrange [split $arg] 2 end]]
  487. } else {
  488. set reason [join [lrange [split $arg] 3 end]]
  489. }
  490. }
  491. } else {
  492. if {[regexp {^[-]} $tm]} {
  493. set level [blacktools:check:levelban $hand $chan $tm]
  494. set reason [join [lrange [split $arg] 5 end]]
  495. set tm [lindex [split $arg] 4]
  496. set return_time [time_return_minute $tm]
  497. if {$return_time == "-1"} {
  498. set tm [lindex [split $arg] 3]
  499. set reason [join [lrange [split $arg] 4 end]]
  500. }
  501. } elseif {[string equal -nocase "$global" "global"] && [matchattr $hand nm]} {
  502. set gl 1
  503. set tm [lindex [split $arg] 3]
  504. set reason [join [lrange [split $arg] 5 end]]
  505. set return_time [time_return_minute $tm]
  506. if {$return_time == "-1"} {
  507. set reason [join [lrange [split $arg] 4 end]]
  508. }
  509. if {$no_chan == "1"} {
  510. set b [lindex [split $arg] 1]
  511. set tm [lindex [split $arg] 2]
  512. set global [lindex [split $arg] 3]
  513. set reason [join [lrange [split $arg] 4 end]]
  514. set return_time [time_return_minute $tm]
  515. if {$return_time == "-1"} {
  516. set global [lindex [split $arg] 2]
  517. set reason [join [lrange [split $arg] 3 end]]
  518. }
  519. }
  520. } elseif {[string equal -nocase "$global" "link"] && [matchattr $hand nm]} {
  521. set link 1
  522. set tm [lindex [split $arg] 3]
  523. set reason [join [lrange [split $arg] 5 end]]
  524. set return_time [time_return_minute $tm]
  525. if {$return_time == "-1"} {
  526. set reason [join [lrange [split $arg] 4 end]]
  527. }
  528. if {$no_chan == "1"} {
  529. set b [lindex [split $arg] 1]
  530. set tm [lindex [split $arg] 2]
  531. set global [lindex [split $arg] 3]
  532. set reason [join [lrange [split $arg] 4 end]]
  533. set return_time [time_return_minute $tm]
  534. if {$return_time == "-1"} {
  535. set global [lindex [split $arg] 2]
  536. set reason [join [lrange [split $arg] 3 end]]
  537. }
  538. }
  539. } else {
  540. if {$return_time == "-1"} {
  541. set reason [join [lrange [split $arg] 3 end]]
  542. } else {
  543. set reason [join [lrange [split $arg] 4 end]]
  544. }
  545. }
  546. }
  547. if {[setting:get $chan nextshortcmd]} {
  548. noidlepublic:process $nick "prv" $hand $chan $chan1 $b 0
  549. return
  550. }
  551. if {($return_time > "20160" || $return_time == "0") && [matchattr $hand -|OS $b]} {
  552. blacktools:tell $nick "prv" $hand $chan $chan1 b.6 none
  553. return
  554. }
  555. if {$return_time == "-1"} {
  556. set return_time $black(b:bantime)
  557. }
  558. if {[llength $level] > "1"} {
  559. blacktools:tell $nick "prv" $hand $chan $chan1 gl.invalidlevel [string map {"0" ""} $level]
  560. return
  561. }
  562. if {$level != ""} {
  563. userhost:act $b $nick "$hand:$level" "prv" $chan $chan1 $type $return_time "b" $reason $gl
  564. } else {
  565. if {$link == "1"} {
  566. foreach c [link:get] {
  567. userhost:act $b $nick "$hand" "prv" $c $chan1 $type $return_time "b" $reason "2"
  568. }
  569. return
  570. }
  571. userhost:act $b $nick "$hand" "prv" $chan $chan1 $type $return_time "b" $reason $gl
  572. }
  573. }
  574. }
  575. stick {
  576. if {[matchattr $hand nmo|M $chan]} {
  577. set stickb [lindex [split $arg] 2]
  578. set tm [lindex [split $arg] 3]
  579. if {$mychan_use == "1"} {
  580. set stickb [lindex [split $arg] 1]
  581. set tm [lindex [split $arg] 2]
  582. }
  583. set return_time [time_return_minute $tm]
  584. if {$return_time == "-1"} {
  585. set reason [join [lrange [split $arg] 3 end]]
  586. if {$mychan_use == "1"} {
  587. set reason [join [lrange [split $arg] 2 end]]
  588. }
  589. } else {
  590. set tm [lindex [split $arg] 4]
  591. set reason [join [lrange [split $arg] 4 end]]
  592. if {$mychan_use == "1"} {
  593. set tm [lindex [split $arg] 3]
  594. set reason [join [lrange [split $arg] 3 end]]
  595. }
  596. }
  597. set type 2
  598. set chan1 "$chan"
  599. if {($return_time > "20160" || $return_time == "0") && [matchattr $hand -|OS $stickb]} {
  600. blacktools:tell $nick "prv" $hand $chan $chan1 b.6 none
  601. return
  602. }
  603. if {$return_time == "-1"} {
  604. set return_time $black(stick:bantime)
  605. }
  606. userhost:act $stickb $nick $hand "prv" $chan $chan1 $type $return_time "stick" $reason "0"
  607. }
  608. }
  609. ub {
  610. if {[matchattr $hand nmo|MAO $chan]} {
  611. set ban [lindex [split $arg] 1]
  612. set why [lindex [split $arg] 2]
  613. if {[regexp {^[&#]} $ban]} {
  614. set ban [lindex [split $arg] 2]
  615. set why [lindex [split $arg] 3]
  616. }
  617. set type 2
  618. set chan1 "$chan"
  619. if {[regexp {^[0-9]} $ban]} {
  620. set cmd "ub:id"
  621. } else {
  622. set cmd "ub"
  623. }
  624. if {[string equal -nocase $why "global"] && [matchattr $hand nm]} {
  625. ub:process $ban $ban $nick $hand "prv" $chan $chan1 $type "1" $cmd "" ""
  626. } elseif {[string equal -nocase $why "link"] && [matchattr $hand nm]} {
  627. ub:process $ban $ban $nick $hand "prv" $chan $chan1 $type "" "ub" "" "1"
  628. } else {
  629. ub:process $ban $ban $nick $hand "prv" $chan $chan1 $type "" $cmd "" ""
  630. }
  631. }
  632. }
  633. k {
  634. if {[matchattr $hand nmo|OMA $chan]} {
  635. set knick [lindex [split $arg] 2]
  636. set type 2
  637. set reason [join [lrange [split $arg] 3 end]]
  638. if {$mychan_use == "1"} {
  639. set knick [lindex [split $arg] 1]
  640. set reason [join [lrange [split $arg] 2 end]]
  641. }
  642. set handle [nick2hand $knick]
  643. set chan1 "$chan"
  644. if {$knick != ""} {
  645. k:process $knick $nick $hand "prv" $reason $chan $chan1 $type
  646. } else {k:process $knick $nick $hand "prv" $reason $chan $chan1 $type}
  647. }
  648. }
  649. w {
  650. if {[matchattr $hand nmo|OMA $chan]} {
  651. set wnick [lindex [split $arg] 2]
  652. if {$mychan_use == "1"} {
  653. set wnick [lindex [split $arg] 1]
  654. }
  655. set type 2
  656. set handle [nick2hand $wnick]
  657. set chan1 "$chan"
  658. if {$wnick != ""} {
  659. w:process $wnick $nick $hand "prv" $chan $chan1 $type
  660. } else { w:process $wnick $nick $hand "prv" $chan $chan1 $type }
  661. }
  662. }
  663. ungag {
  664. if {[matchattr $hand nmo|OMA $chan]} {
  665. set gagger [lindex [split $arg] 2]
  666. if {$mychan_use == "1"} {
  667. set gagger [lindex [split $arg] 1]
  668. }
  669. set type 2
  670. set chan1 "$chan"
  671. if {$gagger != ""} {
  672. ungag:process $gagger $nick $hand "prv" $chan $chan1 $type
  673. } else { ungag:process $gagger $nick $hand "prv" $chan $chan1 $type }
  674. }
  675. }
  676. gag {
  677. if {[matchattr $hand nmo|OMA $chan]} {
  678. set gagger [lindex [split $arg] 2]
  679. set time [lindex [split $arg] 3]
  680. set reason [join [lrange [split $arg] 4 end]]
  681. if {$mychan_use == "1"} {
  682. set gagger [lindex [split $arg] 1]
  683. set time [lindex [split $arg] 2]
  684. set reason [join [lrange [split $arg] 3 end]]
  685. }
  686. set type 2
  687. set handle [nick2hand $gagger]
  688. set chan1 "$chan"
  689. set return_time [time_return_minute $time]
  690. if {$return_time == "-1"} {
  691. set reason [join [lrange [split $arg] 3 end]]
  692. set time [setting:get $chan gag-bantime]
  693. if {$time == ""} {
  694. set time $black(gag:bantime)
  695. }
  696. }
  697. if {$gagger != ""} {
  698. gag:process $gagger $time $reason $nick "$hand:GAG" "prv" $chan $chan1 $type
  699. } else { gag:process $gagger $time $reason $nick $hand "prv" $chan $chan1 $type }
  700. }
  701. }
  702. show {
  703. if {[matchattr $hand nmo|M $chan]} {
  704. set wich [lindex [split $arg] 2]
  705. if {$mychan_use == "1"} {
  706. set wich [lindex [split $arg] 1]
  707. }
  708. set type 2
  709. set chan1 "$chan"
  710. show:process $nick "prv" $hand $chan $chan1 $wich $type
  711. }
  712. }
  713. clonescan {
  714. if {[matchattr $hand nmo|MA $chan]} {
  715. set why [lindex [split $arg] 2]
  716. set type 2
  717. set chan1 "$chan"
  718. if {[regexp {^[&#]} $chan] && [matchattr $hand nmo|M $chan] && ($why != "")} {
  719. set chan1 "$chan"
  720. set clone [join [lrange [split $arg] 3 end]]
  721. set number [lindex [split $arg] 3]
  722. prot:module:process $nick "prv" $hand $chan $chan1 $chan $clone $type $number "clonescan"
  723. return
  724. }
  725. scanner:process $nick "prv" $hand $chan $chan1 $type
  726. }
  727. }
  728. sb {
  729. if {[matchattr $hand nmo|MAO $chan]} {
  730. set bhost [lindex [split $arg] 2]
  731. set what [lindex [split $arg] 3]
  732. if {$mychan_use == "1"} {
  733. set bhost [lindex [split $arg] 1]
  734. set what [lindex [split $arg] 2]
  735. }
  736. set type 2
  737. set chan1 "$chan"
  738. if {$bhost != ""} {
  739. if {[regexp {^[0-9]} $bhost]} {
  740. sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" "2"
  741. return
  742. }
  743. if {![validchan $chan]} {
  744. blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
  745. return
  746. }
  747. if {[onchan $bhost $chan]} {
  748. set bhost "$bhost![getchanhost $bhost $chan]"
  749. sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" "1"
  750. return
  751. }
  752. if {[regexp {\*} $bhost]} {
  753. sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" "1"
  754. return
  755. }
  756. sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" ""
  757. } else { sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" ""}
  758. }
  759. }
  760. banlist {
  761. if {[matchattr $hand nmo|AOM $chan]} {
  762. set user [lindex [split $arg] 2]
  763. set next [lindex [split $arg] 3]
  764. if {$mychan_use == "1"} {
  765. set user [lindex [split $arg] 1]
  766. set next [lindex [split $arg] 2]
  767. }
  768. if {[string equal -nocase $chan "global"]} {
  769. set user $chan
  770. }
  771. set type 2
  772. set chan1 "$chan"
  773. banlist:process $nick "prv" $hand $chan $chan1 $user $type "banlist" $next
  774. }
  775. }
  776. r {
  777. if {[matchattr $hand nmo|MAO $chan]} {
  778. set c [lindex [split $arg] 1]
  779. set chan1 $chan
  780. if {$c != "" && [matchattr $hand nmo|AMO $c]} {
  781. topic:refresh $nick "prv" $hand $c $chan1 $arg
  782. return
  783. }
  784. topic:refresh $nick "prv" $hand $chan $chan1 $arg
  785. }
  786. }
  787. egg {
  788. if {[matchattr $hand nm]} {
  789. set why [lindex [split $arg] 1]
  790. set type2 2
  791. set result [join [lrange [split $arg] 2 end]]
  792. egg:process $why $type2 $result $nick $hand "prv" $chan $chan1
  793. }
  794. }
  795. man {
  796. if {[matchattr $hand nmo|MASOV $chan]} {
  797. set command [lindex [split $arg] 1]
  798. set type 0
  799. man:process $nick $host $hand $chan $chan1 $type $command
  800. }
  801. }
  802. auto {
  803. if {[matchattr $hand nmo|MA $chan]} {
  804. set type 0
  805. set option [lindex [split $arg] 2]
  806. set user [lindex [split $arg] 3]
  807. set gl [lindex [split $arg] 4]
  808. if {$mychan_use == "1"} {
  809. set option [lindex [split $arg] 1]
  810. set user [lindex [split $arg] 2]
  811. set gl [lindex [split $arg] 3]
  812. }
  813. auto:process $nick "prv" $hand $chan $chan1 $user $option $gl $type
  814. }
  815. }
  816. version {
  817. if {[matchattr $hand nmo|MASOV $chan]} {
  818. version:process $nick $host $hand $chan $chan1
  819. }
  820. }
  821. seen {
  822. if {[matchattr $hand nmo|MAOV $chan]} {
  823. set type 2
  824. if {[matchattr $hand nmo]} {
  825. set s [lindex [split $arg] 1]
  826. if {[regexp {^[&#]} $s]} {
  827. set s [lindex [split $arg] 2]
  828. }
  829. } else {
  830. if {![regexp {^[&#]} $chan]} {
  831. blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "seen"
  832. return
  833. }
  834. set s [lindex [split $arg] 2]
  835. if {$mychan_use == "1"} {
  836. set s [lindex [split $arg] 1]
  837. }
  838. }
  839. seen:process $nick "$host:prv" $hand $chan $chan1 $s $type
  840. }
  841. }
  842. channels {
  843. if {[matchattr $hand nmo]} {
  844. set chan1 "$nick"
  845. channels:process $nick "prv" $hand $chan $chan1
  846. }
  847. }
  848. userlist {
  849. if {[matchattr $hand nmo|MAOV $chan]} {
  850. set type 2
  851. set chan1 $nick
  852. set level [lindex [split $arg] 2]
  853. if {$mychan_use == "1"} {
  854. set level [lindex [split $arg] 1]
  855. }
  856. if {[string equal -nocase $chan "owner"] && [matchattr $hand nmo]} {
  857. userlist:execute $hand "prv" $chan $chan $chan1 $nick $type
  858. return
  859. }
  860. userlist:execute $hand "prv" $level $chan $chan1 $nick $type
  861. }
  862. }
  863. chuser {
  864. if {[matchattr $hand nmo|M $chan]} {
  865. set user [lindex [split $arg] 1]
  866. set chandle [lindex [split $arg] 2]
  867. set type 2
  868. set chan1 "$nick"
  869. chuser:process $nick "prv" $hand $chan $chan1 $user $chandle $type
  870. }
  871. }
  872. securemode {
  873. if {[matchattr $hand nmo|M $chan]} {
  874. set type 2
  875. set chan1 "$chan"
  876. set why [lindex [split $arg] 2]
  877. set except [join [lrange [split $arg] 3 end]]
  878. set number [lindex [split $arg] 3]
  879. if {$mychan_use == "1"} {
  880. set why [lindex [split $arg] 1]
  881. set except [join [lrange [split $arg] 2 end]]
  882. set number [lindex [split $arg] 2]
  883. }
  884. prot:module:process $nick "prv" $hand $chan $chan1 $why $except $type $number "securemode"
  885. }
  886. }
  887. delhost {
  888. if {[matchattr $hand nmo|MA $chan]} {
  889. set user [lindex [split $arg] 1]
  890. set type 2
  891. set chan1 "$chan"
  892. set hosts [join [lrange [split $arg] 2 end]]
  893. delhost:process $nick "prv" $hand $chan $chan1 $user $hosts $type
  894. }
  895. }
  896. addhost {
  897. if {[matchattr $hand nmo|MA $chan]} {
  898. set type 2
  899. set chan1 "$chan"
  900. set user [lindex [split $arg] 1]
  901. set hosts [join [lrange [split $arg] 2 end]]
  902. addhost:process $nick "prv" $hand $chan $chan1 $user $hosts $type
  903. }
  904. }
  905. del {
  906. if {[matchattr $hand nmo|M $chan]} {
  907. set args [lrange [split $arg] 1 end]
  908. set type 2
  909. set chan1 "$chan"
  910. del:process $nick "prv" $hand $chan $chan1 $args $type
  911. }
  912. }
  913. delacc {
  914. if {[matchattr $hand nmo|MA $chan]} {
  915. set args [lrange [split $arg] 2 end]
  916. if {$mychan_use == "1"} {
  917. set args [lrange [split $arg] 1 end]
  918. }
  919. set type 2
  920. set chan1 "$chan"
  921. foreach user $args {
  922. delacc:process $nick "prv" $hand $chan $chan1 $user $type
  923. }
  924. }
  925. }
  926. add {
  927. if {[matchattr $hand nmo|MA $chan]} {
  928. set level [lindex [split $arg] 2]
  929. set type 2
  930. set args [lrange [split $arg] 3 end]
  931. set c [lindex [split $arg] 3]
  932. if {$mychan_use == "1"} {
  933. set level [lindex [split $arg] 1]
  934. set args [lrange [split $arg] 2 end]
  935. set c [lindex [split $arg] 2]
  936. }
  937. set chan1 "$chan"
  938. set handle ""
  939. set uhost ""
  940. if {$args != ""} {
  941. foreach user $args {
  942. if {$user != ""} {
  943. if {![regexp {^[a-zA-Z0-9]} $user]} {
  944. blacktools:tell $nick "prv" $hand $chan $chan1 add.18 none
  945. continue
  946. }
  947. add:process $user $uhost $handle $level $hand "prv" $chan $chan1 $nick $type "add"
  948. }
  949. }
  950. } else { add:process "" $uhost $handle $level $hand "prv" $chan $chan1 $nick $type "add" }
  951. }
  952. }
  953. adduser {
  954. if {[matchattr $hand nmo|MA $chan]} {
  955. set level [lindex [split $arg] 2]
  956. set args [lrange [split $arg] 3 end]
  957. set c [lindex [split $arg] 3]
  958. if {$mychan_use == "1"} {
  959. set level [lindex [split $arg] 1]
  960. set args [lrange [split $arg] 2 end]
  961. set c [lindex [split $arg] 2]
  962. }
  963. set type 2
  964. set chan1 "$chan"
  965. if {$args != ""} {
  966. foreach user $args {
  967. if {$user != ""} {
  968. set handle [nick2hand $user]
  969. if {![onchan $user $chan] && ![validuser $user]} {
  970. blacktools:tell $nick "prv" $hand $chan $chan1 gl.usernotonchan $user
  971. return
  972. }
  973. set hosts [getchanhost $user $chan]
  974. set uhost [return_mask $black(addusermask) $hosts $user]
  975. add:process $user $uhost $handle $level $hand "prv" $chan $chan1 $nick $type "adduser"
  976. }
  977. }
  978. } else { add:process "" "" "" $level $hand "prv" $chan $chan1 $nick $type "adduser" }
  979. }
  980. }
  981. suspend {
  982. if {[matchattr $hand nmo]} {
  983. set cmd_status [btcmd:status $chan $hand "suspend" 0]
  984. if {$cmd_status == "1"} {
  985. return
  986. }
  987. set chan1 "$chan"
  988. if {$chan == ""} {blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "suspend"
  989. return
  990. }
  991. if {![regexp {^[&#]} $chan]} {
  992. blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
  993. return
  994. }
  995. if {![validchan $chan]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
  996. return
  997. }
  998. if {[channel get $chan inactive]} {
  999. blacktools:tell $nick "prv" $hand $chan $chan1 suspend.3 $chan
  1000. return
  1001. }
  1002. channel set $chan +inactive
  1003. blacktools:tell $nick "prv" $hand $chan $chan1 suspend.4 $chan
  1004. }
  1005. }
  1006. unsuspend {
  1007. if {[matchattr $hand nmo]} {
  1008. set cmd_status [btcmd:status $chan $hand "unsuspend" 0]
  1009. if {$cmd_status == "1"} {
  1010. return
  1011. }
  1012. set chan1 "$chan"
  1013. if {$chan == ""} {blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "unsuspend"
  1014. return
  1015. }
  1016. if {![regexp {^[&#]} $chan]} {
  1017. blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
  1018. return
  1019. }
  1020. if {![validchan $chan]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
  1021. return
  1022. }
  1023. if {![channel get $chan inactive]} {
  1024. blacktools:tell $nick "prv" $hand $chan $chan1 unsuspend.3 $chan
  1025. return
  1026. }
  1027. channel set $chan -inactive
  1028. blacktools:tell $nick "prv" $hand $chan $chan1 unsuspend.4 $chan
  1029. }
  1030. }
  1031. delchan {
  1032. if {[matchattr $hand nmo]} {
  1033. set cmd_status [btcmd:status $chan $hand "delchan" 0]
  1034. if {$cmd_status == "1"} {
  1035. return
  1036. }
  1037. set chan1 "$chan"
  1038. if {$chan == ""} {blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "delchan"
  1039. return
  1040. }
  1041. if {![regexp {^[&#]} $chan]} {
  1042. blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
  1043. return
  1044. }
  1045. if {![validchan $chan]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
  1046. return
  1047. }
  1048. set getlang [string tolower [getuser $hand XTRA OUTPUT_LANG]]
  1049. if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
  1050. if {!($black(homechan) == "") && ![string equal -nocase $black(homechan) "#no_home_chan"]} {
  1051. if {[string equal -nocase $chan $black(homechan)]} {
  1052. blacktools:tell $nick "prv" $hand $chan $chan1 delchan.5 $chan
  1053. return
  1054. }
  1055. }
  1056. channel remove $chan
  1057. delchan:all $chan
  1058. blacktools:tell $nick "prv" $hand $chan $chan1 delchan.3 $chan
  1059. }
  1060. }
  1061. addchan {
  1062. if {[matchattr $hand nmo]} {
  1063. set cmd_status [btcmd:status $chan $hand "addchan" 0]
  1064. if {$cmd_status == "1"} {
  1065. return
  1066. }
  1067. set key [lindex [split $arg] 2]
  1068. set chan1 "$chan"
  1069. if {$chan == ""} {
  1070. blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "addchan"
  1071. return
  1072. }
  1073. if {![regexp {^[&#]} $chan]} {
  1074. blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
  1075. return
  1076. }
  1077. if {[validchan $chan]} {
  1078. blacktools:tell $nick "prv" $hand $chan $chan1 addchan.2 $chan
  1079. return
  1080. } else {
  1081. channel add $chan
  1082. blacktools:tell $nick "prv" $hand $chan $chan1 addchan.3 $chan
  1083. if {$key != ""} {
  1084. putquick "JOIN $chan :$key"
  1085. channel set $chan chanmode "+ntk $key"
  1086. }
  1087. }
  1088. }
  1089. }
  1090. die {
  1091. if {[matchattr $hand nm]} {
  1092. set cmd_status [btcmd:status $chan $hand "die" 0]
  1093. if {$cmd_status == "1"} {
  1094. return
  1095. }
  1096. set chan1 "$chan"
  1097. set reason [join [lrange [split $arg] 1 end]]
  1098. set getlang [string tolower [getuser $hand XTRA OUTPUT_LANG]]
  1099. if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
  1100. blacktools:tell $nick "prv" $hand $chan $chan1 die.1 none
  1101. if {$reason == ""} {
  1102. set reason $black(say.$getlang.die.2)
  1103. }
  1104. utimer 3 [list die $reason]
  1105. }
  1106. }
  1107. jump {
  1108. if {[matchattr $hand nm]} {
  1109. set cmd_status [btcmd:status $chan $hand "jump" 0]
  1110. if {$cmd_status == "1"} {
  1111. return
  1112. }
  1113. set chan1 "$chan"
  1114. set serv [lindex [split $arg] 1]
  1115. if {$serv == ""} {
  1116. blacktools:tell $nick "prv" $hand $chan $chan1 jump.1 "..."
  1117. utimer 3 [list jump]
  1118. } else {
  1119. blacktools:tell $nick "prv" $hand $chan $chan1 jump.1 "\002$serv\002"
  1120. utimer 3 [list jump $serv]
  1121. }
  1122. }
  1123. }
  1124. save {
  1125. if {[matchattr $hand nm]} {
  1126. set cmd_status [btcmd:status $chan $hand "save" 0]
  1127. if {$cmd_status == "1"} {
  1128. return
  1129. }
  1130. set chan1 "$chan"
  1131. blacktools:tell $nick "prv" $hand $chan $chan1 save.1 none
  1132. save
  1133. }
  1134. }
  1135. restart {
  1136. if {[matchattr $hand nm]} {
  1137. set cmd_status [btcmd:status $chan $hand "restart" 0]
  1138. if {$cmd_status == "1"} {
  1139. return
  1140. }
  1141. set chan1 "$chan"
  1142. blacktools:tell $nick "prv" $hand $chan $chan1 restart.1 none
  1143. utimer 3 [list restart]
  1144. }
  1145. }
  1146. rehash {
  1147. if {[matchattr $hand nm]} {
  1148. set cmd_status [btcmd:status $chan $hand "rehash" 0]
  1149. if {$cmd_status == "1"} {
  1150. return
  1151. }
  1152. set chan1 "$chan"
  1153. blacktools:tell $nick "prv" $hand $chan $chan1 rehash.1 none
  1154. rehash
  1155. }
  1156. }
  1157. nick {
  1158. if {[matchattr $hand nm]} {
  1159. set thenick [lindex [split $arg] 1]
  1160. set chan1 $chan
  1161. set type 2
  1162. tempnick:process $thenick $nick "prv" $hand $chan $chan1 $type
  1163. }
  1164. }
  1165. msg {
  1166. if {[matchattr $hand nmo]} {
  1167. set who [lindex [split $arg] 1]
  1168. set chan1 "$chan"
  1169. set type 2
  1170. set msg [join [lrange [split $arg] 2 end]]
  1171. msg:process $nick "prv" $hand $chan $chan1 $who $msg $type
  1172. }
  1173. }
  1174. set {
  1175. if {[matchattr $hand nmo|M $chan]} {
  1176. set flags [lindex [split $arg] 2]
  1177. set type [join [lrange [split $arg] 3 end]]
  1178. if {$mychan_use == "1"} {
  1179. set flags [lindex [split $arg] 1]
  1180. set type [join [lrange [split $arg] 2 end]]
  1181. }
  1182. set type1 2
  1183. set chan1 "$chan"
  1184. if {[matchattr $hand mn]} {
  1185. if {[string equal -nocase "global" $chan]} {
  1186. set chan "$flags"
  1187. foreach c [channels] {
  1188. set:process $nick "prv" $hand $c $chan1 $flags $type $type1
  1189. }
  1190. return
  1191. }
  1192. }
  1193. set:process $nick "prv" $hand $chan $chan1 $flags $type $type1
  1194. }
  1195. }
  1196. mode {
  1197. if {[matchattr $hand nmo|OMA $chan]} {
  1198. set modes [lindex [split $arg] 2]
  1199. if {$mychan_use == "1"} {
  1200. set modes [lindex [split $arg] 1]
  1201. }
  1202. set type 2
  1203. set chan1 "$chan"
  1204. mode:process $nick "prv" $hand $chan $chan1 $modes $type
  1205. }
  1206. }
  1207. cycle {
  1208. if {[matchattr $hand nmo|OMA $chan]} {
  1209. set reason [join [lrange [split $arg] 2 end]]
  1210. if {$mychan_use == "1"} {
  1211. set reason [join [lrange [split $arg] 1 end]]
  1212. }
  1213. set chan1 "$chan"
  1214. cycle:process $nick "prv" $hand $chan $chan1 $reason
  1215. }
  1216. }
  1217. purge {
  1218. if {[matchattr $hand -|M $chan]} {
  1219. set reason [join [lrange [split $arg] 2 end]]
  1220. if {$mychan_use == "1"} {
  1221. set reason [join [lrange [split $arg] 1 end]]
  1222. }
  1223. set chan1 "$chan"
  1224. if {$reason == ""} {
  1225. blacktools:tell $nick "prv" $hand $chan $chan1 purge.1 none
  1226. return
  1227. }
  1228. purge:process $nick "prv" $hand $chan $chan1 $reason
  1229. }
  1230. }
  1231. broadcast {
  1232. if {[matchattr $hand nm]} {
  1233. set text [join [lrange [split $arg] 2 end]]
  1234. set chan1 "$chan"
  1235. set type 2
  1236. broadcast:cmd:process $nick "prv" $hand $chan $chan1 $text $type
  1237. }
  1238. }
  1239. act {
  1240. if {[matchattr $hand nmo|MA $chan]} {
  1241. set text [join [lrange [split $arg] 2 end]]
  1242. set c [lindex [split $arg] 2]
  1243. if {$mychan_use == "1"} {
  1244. set text [join [lrange [split $arg] 1 end]]
  1245. set c [lindex [split $arg] 1]
  1246. }
  1247. set type 2
  1248. set chan1 "$chan"
  1249. act:process $nick "prv" $hand $chan $chan1 $text $type
  1250. }
  1251. }
  1252. say {
  1253. if {[matchattr $hand nmo|MA $chan]} {
  1254. set text [join [lrange [split $arg] 2 end]]
  1255. set c [lindex [split $arg] 2]
  1256. if {$mychan_use == "1"} {
  1257. set text [join [lrange [split $arg] 1 end]]
  1258. set c [lindex [split $arg] 1]
  1259. }
  1260. set type 2
  1261. set chan1 "$chan"
  1262. say:process $nick "prv" $hand $chan $chan1 $text $type
  1263. }
  1264. }
  1265. v {
  1266. if {[matchattr $hand nmo|VOMA $chan]} {
  1267. set voicex [join [lrange [split $arg] 2 end]]
  1268. if {$mychan_use == "1"} {
  1269. set voicex [join [lrange [split $arg] 1 end]]
  1270. }
  1271. set chan1 "$chan"
  1272. v:process [split $nick] "prv" $hand $chan $chan1 $voicex
  1273. }
  1274. }
  1275. ho {
  1276. if {[matchattr $hand nmo|OMA $chan]} {
  1277. set hopex [join [lrange [split $arg] 2 end]]
  1278. if {$mychan_use == "1"} {
  1279. set hopex [join [lrange [split $arg] 1 end]]
  1280. }
  1281. set chan1 "$chan"
  1282. ho:process $nick "prv" $hand $chan $chan1 $hopex
  1283. }
  1284. }
  1285. o {
  1286. if {[matchattr $hand nmo|OMA $chan]} {
  1287. set opex [join [lrange [split $arg] 2 end]]
  1288. if {$mychan_use == "1"} {
  1289. set opex [join [lrange [split $arg] 1 end]]
  1290. }
  1291. set chan1 "$chan"
  1292. o:process $nick "prv" $hand $chan $chan1 $opex
  1293. }
  1294. }
  1295. private {
  1296. if {[matchattr $hand nmo|M $chan]} {
  1297. set type 2
  1298. set chan1 "$chan"
  1299. set why [lindex [split $arg] 2]
  1300. set user [lindex [split $arg] 3]
  1301. if {$mychan_use == "1"} {
  1302. set why [lindex [split $arg] 1]
  1303. set user [lindex [split $arg] 2]
  1304. }
  1305. private:process $nick "prv" $hand $chan $chan1 $why $user $type
  1306. }
  1307. }
  1308. myset {
  1309. foreach c [channels] {
  1310. if {[matchattr $hand nmo|AOMV $c]} {
  1311. set chan $c
  1312. }
  1313. }
  1314. if {[regexp {^[&#]} $chan] && [validuser $hand]} {
  1315. set type 2
  1316. set chan1 "$chan"
  1317. set flags [lindex [split $arg] 1]
  1318. set typez [lindex [split $arg] 2]
  1319. set chan2 [lindex [split $arg] 3]
  1320. set arg [join [lrange [split $arg] 2 end]]
  1321. myset:process $nick "prv" $hand $chan $chan1 $flags $typez $type $chan2 $arg
  1322. }
  1323. }
  1324. uptime {
  1325. if {[matchattr $hand nmo]} {
  1326. set cmd_status [btcmd:status $chan $hand "uptime" 0]
  1327. if {$cmd_status == "1"} {
  1328. return
  1329. }
  1330. set getlang [string tolower [getuser $hand XTRA OUTPUT_LANG]]
  1331. if {[matchattr $hand q]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.glsuspend none
  1332. return
  1333. }
  1334. if {[matchattr $hand -|q $chan]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.suspend none
  1335. return
  1336. }
  1337. if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
  1338. set chan1 "$chan"
  1339. set up [return_time_2 $getlang [expr [unixtime] - $uptime]]
  1340. set on [return_time_2 $getlang [expr [unixtime] - ${server-online}]]
  1341. catch {exec uptime} shelluptime
  1342. set file [open $black(uptime_file) "r"]
  1343. set data [read -nonewline $file]
  1344. close $file
  1345. if {$data == ""} {
  1346. set read_maxup "-"
  1347. set read_maxon "-"
  1348. } else {
  1349. set read_maxup [return_time_2 $getlang [lindex [split $data] 0]]
  1350. set read_maxon [return_time_2 $getlang [lindex [split $data] 1]]
  1351. }
  1352. blacktools:tell $nick "prv" $hand $chan $chan1 maxup.1 "$up $read_maxup"
  1353. blacktools:tell $nick "prv" $hand $chan $chan1 maxon.1 "$on $read_maxon"
  1354. blacktools:tell $nick "prv" $hand $chan $chan1 uptime.2 $shelluptime
  1355. blacktools:tell $nick "prv" $hand $chan $chan1 uptime.3 $server
  1356. }
  1357. }
  1358. status {
  1359. if {[matchattr $hand nmo]} {
  1360. status:process $nick "prv" $hand $chan
  1361. }
  1362. }
  1363. t {
  1364. if {[matchattr $hand nmo|OMA $chan]} {
  1365. set topics [join [lrange [split $arg] 2 end]]
  1366. if {$mychan_use == "1"} {
  1367. set topics [join [lrange [split $arg] 1 end]]
  1368. }
  1369. set type 2
  1370. set chan1 "$chan"
  1371. t:process $nick "prv" $hand $chan $chan1 $topics $type
  1372. }
  1373. }
  1374. tcl {
  1375. if {[matchattr $hand n]} {
  1376. set type 2
  1377. set chan1 "$chan"
  1378. set the_script [lindex [split $arg] 2]
  1379. set who [lindex [split $arg] 1]
  1380. tcl:process $nick "prv" $hand $chan $chan1 $type $the_script $who
  1381. }
  1382. }
  1383. anunt {
  1384. if {[matchattr $hand nmo|M $chan]} {
  1385. set type 2
  1386. set chan1 "$chan"
  1387. set who [lindex [split $arg] 2]
  1388. set message [join [lrange [split $arg] 3 end]]
  1389. set number [lindex [split $arg] 3]
  1390. if {$mychan_use == "1"} {
  1391. set who [lindex [split $arg] 1]
  1392. set message [join [lrange [split $arg] 2 end]]
  1393. set number [lindex [split $arg] 2]
  1394. }
  1395. anunt:process $nick "prv" $hand $chan $chan1 $who $message $number $type
  1396. }
  1397. }
  1398. h {
  1399. if {[matchattr $hand nmo|MOAV $chan]} {
  1400. set chan1 "$chan"
  1401. set type 2
  1402. set command [lindex [split $arg] 1]
  1403. if {[regexp {^[&#]} $command]} {
  1404. set chan $command
  1405. set command [lindex [split $arg] 2]
  1406. }
  1407. h:process $nick "prv" $hand $chan $chan1 $command $type
  1408. }
  1409. }
  1410. cp {
  1411. if {[matchattr $hand nm]} {
  1412. set type 2
  1413. set chan1 $chan
  1414. set what [lindex [split $arg] 1]
  1415. set from [lindex [split $arg] 2]
  1416. set to [lindex [split $arg] 3]
  1417. cp:process $nick "prv" $hand $chan $chan1 $type $what $from $to
  1418. }
  1419. }
  1420. banstats {
  1421. if {[matchattr $hand nmo|AOM $chan]} {
  1422. set next [lindex [split $arg] 2]
  1423. if {$mychan_use == "1"} {
  1424. set next [lindex [split $arg] 1]
  1425. }
  1426. set cmd ""
  1427. set type 2
  1428. set chan1 "$chan"
  1429. if {[string equal -nocase $next "reset"]} {
  1430. set cmd "reset"
  1431. }
  1432. if {[string equal -nocase $next "total"]} {
  1433. set next [lindex [split $arg] 3]
  1434. if {$mychan_use == "1"} {
  1435. set next [lindex [split $arg] 2]
  1436. }
  1437. set cmd "total"
  1438. }
  1439. banstats:process $nick "prv" $hand $chan $chan1 $cmd $type $next
  1440. }
  1441. }
  1442. troll {
  1443. if {[matchattr $hand nmo|AOM $chan]} {
  1444. set tr [lindex [split $arg] 2]
  1445. if {$mychan_use == "1"} {
  1446. set tr [lindex [split $arg] 1]
  1447. }
  1448. set chan1 "$chan"
  1449. set type 2
  1450. userhost:act $tr $nick $hand "prv" $chan $chan1 $type "1440" "troll" "" "0"
  1451. }
  1452. }
  1453. limit {
  1454. if {[matchattr $hand nmo|M $chan]} {
  1455. set why [lindex [split $arg] 1]
  1456. set lm [lindex [split $arg] 2]
  1457. set type 2
  1458. set chan1 "$chan"
  1459. if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
  1460. set chan "$why"
  1461. set why [lindex [split $arg] 2]
  1462. set lm [lindex [split $arg] 3]
  1463. }
  1464. limit:process $nick "prv" $hand $chan $chan1 $why $lm $type
  1465. }
  1466. }
  1467. bt {
  1468. if {[matchattr $hand nm]} {
  1469. set chan1 "$chan"
  1470. set type 2
  1471. set who [lindex [split $arg] 1]
  1472. set message [join [lrange [split $arg] 2 end]]
  1473. set number [lindex [split $arg] 2]
  1474. broadcast:process $nick "prv" $hand $chan $chan1 $who $message $number $type
  1475. }
  1476. }
  1477. us {
  1478. if {[matchattr $hand nmo|MA $chan]} {
  1479. set type 2
  1480. set chan1 "$chan"
  1481. set users [lindex [split $arg] 2]
  1482. if {$mychan_use == "1"} {
  1483. set users [lindex [split $arg] 1]
  1484. }
  1485. us:process $nick "prv" $hand $chan $chan1 $users $type
  1486. }
  1487. }
  1488. s {
  1489. if {[matchattr $hand nmo|MA $chan]} {
  1490. set type 2
  1491. set chan1 "$chan"
  1492. set user [lindex [split $arg] 2]
  1493. set suspend_time [lindex [split $arg] 3]
  1494. set suspend_reason [join [lrange [split $arg] 4 end]]
  1495. if {$mychan_use == "1"} {
  1496. set user [lindex [split $arg] 1]
  1497. set suspend_time [lindex [split $arg] 2]
  1498. set suspend_reason [join [lrange [split $arg] 3 end]]
  1499. }
  1500. if {![regexp {^[0-9]} $suspend_time]} {
  1501. set suspend_reason [join [lrange [split $arg] 3 end]]
  1502. if {$mychan_use == "1"} {
  1503. set suspend_reason [join [lrange [split $arg] 2 end]]
  1504. }
  1505. }
  1506. s:process $nick "prv" $hand $chan $chan1 $user $type $suspend_time $suspend_reason
  1507. }
  1508. }
  1509. guestnick {
  1510. if {[matchattr $hand nmo|M $chan]} {
  1511. set who [lindex [split $arg] 2]
  1512. set modul "guestnick"
  1513. set type 2
  1514. set chan1 $chan
  1515. set gnick [join [lrange [split $arg] 3 end]]
  1516. set number [lindex [split $arg] 3]
  1517. if {$mychan_use == "1"} {
  1518. set who [lindex [split $arg] 1]
  1519. set gnick [join [lrange [split $arg] 2 end]]
  1520. set number [lindex [split $arg] 2]
  1521. }
  1522. guestnick:process $nick "prv" $hand $chan $chan1 $who $gnick $type $number $modul
  1523. }
  1524. }
  1525. badhost {
  1526. if {[matchattr $hand nmo|M $chan]} {
  1527. set type 2
  1528. set chan1 "$chan"
  1529. set why [lindex [split $arg] 2]
  1530. set badh [join [lrange [split $arg] 3 end]]
  1531. set number [lindex [split $arg] 3]
  1532. if {$mychan_use == "1"} {
  1533. set why [lindex [split $arg] 1]
  1534. set badh [join [lrange [split $arg] 2 end]]
  1535. set number [lindex [split $arg] 2]
  1536. }
  1537. prot:module:process $nick "prv" $hand $chan $chan1 $why $badh $type $number "badhost"
  1538. }
  1539. }
  1540. badrealname {
  1541. if {[matchattr $hand nmo|M $chan]} {
  1542. set type 2
  1543. set chan1 "$chan"
  1544. set why [lindex [split $arg] 2]
  1545. set badf [join [lrange [split $arg] 3 end]]
  1546. set number [lindex [split $arg] 3]
  1547. if {$mychan_use == "1"} {
  1548. set why [lindex [split $arg] 1]
  1549. set badf [join [lrange [split $arg] 2 end]]
  1550. set number [lindex [split $arg] 2]
  1551. }
  1552. prot:module:process $nick "prv" $hand $chan $chan1 $why $badf $type $number "badrealname"
  1553. }
  1554. }
  1555. badquitpart {
  1556. if {[matchattr $hand nmo|M $chan]} {
  1557. set type 2
  1558. set chan1 "$chan"
  1559. set why [lindex [split $arg] 2]
  1560. set badq [join [lrange [split $arg] 3 end]]
  1561. set number [lindex [split $arg] 3]
  1562. if {$mychan_use == "1"} {
  1563. set why [lindex [split $arg] 1]
  1564. set badq [join [lrange [split $arg] 2 end]]
  1565. set number [lindex [split $arg] 2]
  1566. }
  1567. prot:module:process $nick "prv" $hand $chan $chan1 $why $badq $type $number "badquitpart"
  1568. }
  1569. }
  1570. badident {
  1571. if {[matchattr $hand nmo|M $chan]} {
  1572. set type 2
  1573. set chan1 "$chan"
  1574. set why [lindex [split $arg] 2]
  1575. set badi [join [lrange [split $arg] 3 end]]
  1576. set number [lindex [split $arg] 3]
  1577. if {$mychan_use == "1"} {
  1578. set why [lindex [split $arg] 1]
  1579. set badi [join [lrange [split $arg] 2 end]]
  1580. set number [lindex [split $arg] 2]
  1581. }
  1582. prot:module:process $nick "prv" $hand $chan $chan1 $why $badi $type $number "badident"
  1583. }
  1584. }
  1585. badnick {
  1586. if {[matchattr $hand nmo|M $chan]} {
  1587. set type 2
  1588. set chan1 "$chan"
  1589. set why [lindex [split $arg] 2]
  1590. set badn [join [lrange [split $arg] 3 end]]
  1591. set number [lindex [split $arg] 3]
  1592. if {$mychan_use == "1"} {
  1593. set why [lindex [split $arg] 1]
  1594. set badn [join [lrange [split $arg] 2 end]]
  1595. set number [lindex [split $arg] 2]
  1596. }
  1597. prot:module:process $nick "prv" $hand $chan $chan1 $why $badn $type $number "badnick"
  1598. }
  1599. }
  1600. badword {
  1601. if {[matchattr $hand nmo|M $chan]} {
  1602. set type 2
  1603. set chan1 "$chan"
  1604. set why [lindex [split $arg] 2]
  1605. set badw [join [lrange [split $arg] 3 end]]
  1606. set number [lindex [split $arg] 3]
  1607. if {$mychan_use == "1"} {
  1608. set why [lindex [split $arg] 1]
  1609. set badw [join [lrange [split $arg] 2 end]]
  1610. set number [lindex [split $arg] 2]
  1611. }
  1612. prot:module:process $nick "prv" $hand $chan $chan1 $why $badw $type $number "badword"
  1613. }
  1614. }
  1615. info {
  1616. if {[matchattr $hand nmo|MAOV $chan]} {
  1617. set user [lindex [split $arg] 2]
  1618. set infouser [lindex [split $arg] 2]
  1619. if {$mychan_use == "1"} {
  1620. set user [lindex [split $arg] 1]
  1621. set infouser [lindex [split $arg] 1]
  1622. }
  1623. if {![regexp {^[&#]} $chan]} {
  1624. set user $chan
  1625. }
  1626. set type 2
  1627. set chan1 "$chan"
  1628. if {[regexp {^[&#]} $chan] && [matchattr $hand nmo|MAO $chan] && ($infouser == "")} {
  1629. info:process:chan $nick "prv" $hand $chan $chan1
  1630. return
  1631. }
  1632. info:process $nick "prv" $hand $chan $chan1 $user $type
  1633. }
  1634. }
  1635. antipub {
  1636. if {[matchattr $hand nmo|M $chan]} {
  1637. set type 2
  1638. set chan1 "$chan"
  1639. set why [lindex [split $arg] 2]
  1640. set except [join [lrange [split $arg] 3 end]]
  1641. set number [lindex [split $arg] 3]
  1642. if {$mychan_use == "1"} {
  1643. set why [lindex [split $arg] 1]
  1644. set except [join [lrange [split $arg] 2 end]]
  1645. set number [lindex [split $arg] 2]
  1646. }
  1647. prot:module:process $nick "prv" $hand $chan $chan1 $why $except $type $number "antipub"
  1648. }
  1649. }
  1650. badchan {
  1651. if {[matchattr $hand nmo|M $chan]} {
  1652. set why [lindex [split $arg] 2]
  1653. set type1 2
  1654. set chan1 "$chan"
  1655. set bdchan [lindex [split $arg] 3]
  1656. set type [lindex [split $arg] 4]
  1657. set reason [join [lrange [split $arg] 4 end]]
  1658. if {[string equal -nocase $type "global"]} {
  1659. set reason [join [lrange [split $arg] 5 end]]
  1660. }
  1661. if {$mychan_use == "1"} {
  1662. set why [lindex [split $arg] 1]
  1663. set bdchan [lindex [split $arg] 2]
  1664. set type [lindex [split $arg] 3]
  1665. set reason [join [lrange [split $arg] 3 end]]
  1666. if {[string equal -nocase $type "global"]} {
  1667. set reason [join [lrange [split $arg] 4 end]]
  1668. }
  1669. }
  1670. if {![regexp {^[&#]} $chan] && [matchattr $hand nmo]} {
  1671. set why $chan
  1672. set bdchan [lindex [split $arg] 2]
  1673. set type [lindex [split $arg] 3]
  1674. set reason [join [lrange [split $arg] 3 end]]
  1675. if {[string equal -nocase $type "global"]} {
  1676. set reason [join [lrange [split $arg] 4 end]]
  1677. }
  1678. if {$mychan_use == "1"} {
  1679. set bdchan [lindex [split $arg] 1]
  1680. set type [lindex [split $arg] 2]
  1681. set reason [join [lrange [split $arg] 2 end]]
  1682. if {[string equal -nocase $type "global"]} {
  1683. set reason [join [lrange [split $arg] 3 end]]
  1684. }
  1685. }
  1686. }
  1687. badchan:process $nick "prv" $hand $chan $chan1 $why $bdchan $type1 $type $reason
  1688. }
  1689. }
  1690. unset {
  1691. if {[matchattr $hand nmo|M $chan]} {
  1692. set setting [lindex [split $arg] 2]
  1693. if {$mychan_use == "1"} {
  1694. set setting [lindex [split $arg] 1]
  1695. }
  1696. set chan1 $chan
  1697. set type 2
  1698. if {[string equal -nocase $setting "global"] && [matchattr $hand nm]} {
  1699. set setting [lindex [split $arg] 2]
  1700. foreach c [channels] {
  1701. unset:process $nick "prv" $hand $c $chan1 $setting $type
  1702. }
  1703. return
  1704. }
  1705. unset:process $nick "prv" $hand $chan $chan1 $setting $type
  1706. }
  1707. }
  1708. greet {
  1709. if {[matchattr $hand nmo|M $chan]} {
  1710. set who [lindex [split $arg] 2]
  1711. set modul "greet"
  1712. set type 2
  1713. set chan1 $chan
  1714. set greet [join [lrange [split $arg] 3 end]]
  1715. if {$mychan_use == "1"} {
  1716. set who [lindex [split $arg] 1]
  1717. set greet [join [lrange [split $arg] 2 end]]
  1718. }
  1719. othermodule:process $nick "prv" $hand $chan $chan1 $who $greet $type $modul
  1720. }
  1721. }
  1722. leave {
  1723. if {[matchattr $hand nmo|M $chan]} {
  1724. set who [lindex [split $arg] 2]
  1725. set modul "leave"
  1726. set type 2
  1727. set chan1 $chan
  1728. set leave [join [lrange [split $arg] 3 end]]
  1729. if {$mychan_use == "1"} {
  1730. set who [lindex [split $arg] 1]
  1731. set leave [join [lrange [split $arg] 2 end]]
  1732. }
  1733. othermodule:process $nick "prv" $hand $chan $chan1 $who $leave $type $modul
  1734. }
  1735. }
  1736. topic {
  1737. if {[matchattr $hand nmo|M $chan]} {
  1738. set who [lindex [split $arg] 2]
  1739. set modul "topic"
  1740. set type 2
  1741. set chan1 $chan
  1742. set topic [join [lrange [split $arg] 3 end]]
  1743. if {$mychan_use == "1"} {
  1744. set who [lindex [split $arg] 1]
  1745. set topic [join [lrange [split $arg] 2 end]]
  1746. }
  1747. othermodule:process $nick "prv" $hand $chan $chan1 $who $topic $type $modul
  1748. }
  1749. }
  1750. vr {
  1751. if {[matchattr $hand nmo|OMA $chan]} {
  1752. set vr [lindex [split $arg] 2]
  1753. set chan1 "$chan"
  1754. set type 2
  1755. if {$mychan_use == "1"} {
  1756. set vr [lindex [split $arg] 1]
  1757. }
  1758. userhost:act $vr $nick $hand "prv" $chan $chan1 $type $black(vr:bantime) "vr" "" "0"
  1759. }
  1760. }
  1761. timer {
  1762. if {[matchattr $hand nm]} {
  1763. set chan1 $chan
  1764. set cmd [lindex [split $arg] 1]
  1765. set pid [lindex [split $arg] 2]
  1766. set timer_args [join [lrange [split $arg] 4 end]]
  1767. set type 2
  1768. timer:process $nick "prv" $hand $chan $chan1 $cmd $pid $timer_args $type
  1769. }
  1770. }
  1771. i {
  1772. if {[matchattr $hand nmo|VAOM $chan]} {
  1773. set type 2
  1774. set chan1 "$chan"
  1775. set inick [lindex [split $arg] 2]
  1776. if {$mychan_use == "1"} {
  1777. set inick [lindex [split $arg] 1]
  1778. }
  1779. if {[regexp {^[&#]} $inick] && [matchattr $hand nmo|VAOM $inick]} {
  1780. set chan "$inick"
  1781. set inick [lindex [split $arg] 3]
  1782. }
  1783. i:process $nick "prv" $hand $chan $chan1 $inick $type
  1784. }
  1785. }
  1786. next {
  1787. if {[matchattr $hand nmo|MAO $chan]} {
  1788. set option [lindex [split $arg] 2]
  1789. if {$mychan_use == "1"} {
  1790. set option [lindex [split $arg] 1]
  1791. }
  1792. set chan1 $chan
  1793. foreach c [channels] {
  1794. set backchan [join [setting:get $c next-backchan]]
  1795. if {[string match -nocase $chan $backchan]} {
  1796. set chan "$c"
  1797. }
  1798. }
  1799. nextpublic:process $nick "prv" $hand $chan $chan1 $option
  1800. }
  1801. }
  1802. helped {
  1803. if {[matchattr $hand nmo|MAO $chan]} {
  1804. set user [lindex [split $arg] 2]
  1805. if {$mychan_use == "1"} {
  1806. set user [lindex [split $arg] 1]
  1807. }
  1808. set chan1 $chan
  1809. set type 1
  1810. foreach c [channels] {
  1811. set backchan [join [setting:get $c next-backchan]]
  1812. if {[string match -nocase $chan $backchan]} {
  1813. set chan "$c"
  1814. }
  1815. }
  1816. helpedpublic:process $nick "prv" $hand $chan $chan1 $user $type
  1817. }
  1818. }
  1819. noidle {
  1820. if {[matchattr $hand nmo|MAO $chan]} {
  1821. set user [lindex [split $arg] 2]
  1822. if {$mychan_use == "1"} {
  1823. set user [lindex [split $arg] 1]
  1824. }
  1825. set chan1 $chan
  1826. set type 2
  1827. foreach c [channels] {
  1828. set backchan [join [setting:get $c next-backchan]]
  1829. if {[string match -nocase $chan $backchan]} {
  1830. set chan "$c"
  1831. }
  1832. }
  1833. noidlepublic:process $nick "prv" $hand $chan $chan1 $user $type
  1834. }
  1835. }
  1836. skip {
  1837. if {[matchattr $hand nmo|MAO $chan]} {
  1838. set user [lindex [split $arg] 2]
  1839. if {$mychan_use == "1"} {
  1840. set user [lindex [split $arg] 1]
  1841. }
  1842. set chan1 $chan
  1843. set type 2
  1844. foreach c [channels] {
  1845. set backchan [join [setting:get $c next-backchan]]
  1846. if {[string match -nocase $chan $backchan]} {
  1847. set chan "$c"
  1848. }
  1849. }
  1850. skippublic:process $nick "prv" $hand $chan $chan1 $user $type
  1851. }
  1852. }
  1853. activ {
  1854. if {[matchattr $hand nmo|AOMV $chan]} {
  1855. set type 2
  1856. set chan1 "$chan"
  1857. set user [lindex [split $arg] 2]
  1858. set option [lindex [split $arg] 3]
  1859. if {$mychan_use == "1"} {
  1860. set user [lindex [split $arg] 1]
  1861. set option [lindex [split $arg] 2]
  1862. }
  1863. activ:process $nick "prv" $hand $chan $chan1 $user $option $type
  1864. }
  1865. }
  1866. topwords {
  1867. if {[matchattr $hand nmo|AOMV $chan]} {
  1868. set next [lindex [split $arg] 2]
  1869. set cmd ""
  1870. set type 2
  1871. set chan1 "$chan"
  1872. if {$mychan_use == "1"} {
  1873. set next [lindex [split $arg] 1]
  1874. }
  1875. if {[string equal -nocase $next "reset"] && [matchattr $hand nmo|M $chan]} {
  1876. set cmd "reset"
  1877. }
  1878. if {[string equal -nocase $next "total"]} {
  1879. set next [lindex [split $arg] 3]
  1880. if {$mychan_use == "1"} {
  1881. set next [lindex [split $arg] 2]
  1882. }
  1883. set cmd "total"
  1884. }
  1885. if {[string equal -nocase $next "add"] && [matchattr $hand nmo|M $next]} {
  1886. set next [lindex [split $arg] 3]
  1887. if {$mychan_use == "1"} {
  1888. set next [lindex [split $arg] 2]
  1889. }
  1890. set cmd "add"
  1891. }
  1892. if {[string equal -nocase $next "del"] && [matchattr $hand nmo|M $next]} {
  1893. set next [lindex [split $arg] 3]
  1894. if {$mychan_use == "1"} {
  1895. set next [lindex [split $arg] 2]
  1896. }
  1897. set cmd "del"
  1898. }
  1899. topwords:process $nick "prv" $hand $chan $chan1 $cmd $type $next
  1900. }
  1901. }
  1902. ignore {
  1903. if {[matchattr $hand nmo|M $chan]} {
  1904. set chan1 "$chan"
  1905. set type 2
  1906. set what [lindex [split $arg] 1]
  1907. set mask [lindex [split $arg] 2]
  1908. set time [lindex [split $arg] 3]
  1909. set reason [join [lrange [split $arg] 4 end]]
  1910. if {![regexp {^[0-9]} $time]} {
  1911. set reason [join [lrange [split $arg] 3 end]]
  1912. }
  1913. ignore:process $nick "prv" $hand $chan $chan1 $what $mask $time $reason $type
  1914. }
  1915. }
  1916. chat {
  1917. if {[matchattr $hand nm]} {
  1918. set cmd_status [btcmd:status $chan $hand "chat" 0]
  1919. if {$cmd_status == "1"} {
  1920. return
  1921. }
  1922. set chan1 $chan
  1923. *ctcp:CHAT $nick $host $hand $botnick CHAT $arg
  1924. blacktools:tell $nick "prv" $hand $chan $chan1 chat.1 none
  1925. }
  1926. }
  1927. hello {
  1928. if {![file exists $userfile]} {
  1929. blacktools:hello $nick $host $hand
  1930. }
  1931. }
  1932. pass {
  1933. if {[validuser $hand]} {
  1934. set pass [lindex [split $arg] 1]
  1935. if {$pass == ""} {
  1936. return
  1937. }
  1938. if {[getuser $hand pass] != ""} {
  1939. return
  1940. }
  1941. setuser $hand PASS $pass
  1942. blacktools:tell $nick "prv" $hand "" "" pass.1 $pass
  1943. }
  1944. }
  1945. }
  1946. }
  1947. ##############
  1948. #########################################################################
  1949. ## END ##
  1950. #########################################################################