BT.MeCmds.tcl 49 KB

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