BT.PrvCmds.tcl 62 KB

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