BT.MeCmds.tcl 56 KB

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