BT.ChanCmds.tcl 57 KB

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