BT.ForCmds.tcl 54 KB

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