BT.ForCmds.tcl 54 KB

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