BT.ForCmds.tcl 54 KB

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