| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089 |
- #########################################################################
- ## BlackTools - The Ultimate Channel Control Script ##
- ## One TCL. One smart Eggdrop ##
- #########################################################################
- ####################### PRIVMSG CMDS TCL ############################
- #########################################################################
- ## ##
- ## BlackTools : http://blacktools.tclscripts.net ##
- ## Bugs report : http://www.tclscripts.net/ ##
- ## Online Help : irc://irc.undernet.org/tcl-help ##
- ## #TCL-HELP / UnderNet ##
- ## You can ask in english or romanian ##
- ## ##
- #########################################################################
- proc command:pubpriv {nick host hand arg} {
- global black server uptime {server-online} botnick userfile
- set cmd [lindex [split $arg] 0]
- set chan [lindex [split $arg] 1]
- set check_code [join [lrange [split $arg] 2 end]]
- set chan1 $nick
- set found_access 0
- set mychan_use 0
- if {![regexp {^[&#]} $chan]} {
- if {[validuser $hand]} {
- set mychan [join [string tolower [getuser $hand XTRA MYCHAN]]]
- if {[validchan $mychan] && [matchattr $hand nmo|OVMA $mychan] && ![string equal -nocase $cmd "unbanme"]} {
- set chan [string tolower $mychan]
- set mychan_use 1
- }
- }
- }
- switch [string tolower $cmd] {
- report {
- set type 2
- set what [lindex [split $arg] 2]
- set message [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set what [lindex [split $arg] 1]
- set message [join [lrange [split $arg] 2 end]]
- }
- set chan1 $chan
- if {[matchattr $hand mno|MAO $chan]} {
- return
- }
- report:process $nick "prv" $hand $chan $chan1 $type $what $message
- }
- idle {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set user [lindex [split $arg] 3]
- set host [lindex [split $arg] 4]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set user [lindex [split $arg] 2]
- set host [lindex [split $arg] 3]
- }
- antidle:process $why $type $user "prv" $nick $hand $chan $chan1
- }
- }
- link {
- if {[matchattr $hand nmo]} {
- set type 2
- set channels [join [lrange [split $arg] 1 end]]
- set what [lindex [split $arg] 1]
- set delchan [lindex [split $arg] 2]
- set chan1 $chan
- link:process $nick "prv" $hand $chan $chan1 $type $what $channels $delchan
- }
- }
- note {
- set found_access 0
- foreach c [channels] {
- if {[matchattr $hand nmo|MAOV $c]} {
- set found_access 1
- }
- }
- if {$found_access == "1"} {
- set type 2
- set chan1 $chan
- set who [lindex [split $arg] 1]
- set note [join [lrange [split $arg] 1 end]]
- set number [lindex [split $arg] 2]
- set user_send [lindex [split $arg] 2]
- set note_send [join [lrange [split $arg] 3 end]]
- note:process $nick "prv" $hand $chan $chan1 $who $note $user_send $note_send $number $type
- }
- }
- q {
- if {[matchattr $hand nmo|MAOV $chan]} {
- if {$mychan_use == "1"} {
- set who [lindex [split $arg] 1]
- set next [lindex [split $arg] 2]
- set quote [join [lrange [split $arg] 1 end]]
- if {$who == "*"} {
- set who [lindex [split $arg] 2]
- set quote [join [lrange [split $arg] 1 end]]
- }
- if {[regexp {^[\[]} $who]} {
- set who [lindex [split $arg] 2]
- set quote [join [lrange [split $arg] 1 end]]
- if {$who == "*"} {
- set who [lindex [split $arg] 3]
- set quote [join [lrange [split $arg] 1 end]]
- }
- }
- } else {
- set who [lindex [split $arg] 2]
- set next [lindex [split $arg] 3]
- set quote [join [lrange [split $arg] 2 end]]
- if {$who == "*"} {
- set who [lindex [split $arg] 3]
- set quote [join [lrange [split $arg] 2 end]]
- }
- if {[regexp {^[\[]} $who]} {
- set who [lindex [split $arg] 3]
- set quote [join [lrange [split $arg] 2 end]]
- if {$who == "*"} {
- set who [lindex [split $arg] 4]
- set quote [join [lrange [split $arg] 2 end]]
- }
- }
- }
- set type 2
- set chan1 $chan
- if {$mychan_use == "1"} {
- quote:process $nick "prv" $hand $chan $chan1 $type $who $quote [lrange [split $arg] 1 end] $next
- } else {
- quote:process $nick "prv" $hand $chan $chan1 $type $who $quote [lrange [split $arg] 2 end] $next
- }
- }
- }
- check {
- if {![validchan $chan]} {
- return
- }
- if {[setting:get $chan securemode] == "0"} {
- return
- }
- if {![botisop $chan] && ![setting:get $chan xonly]} {
- return
- }
-
- if {![info exists black(securecode:$nick:$chan)]} {
- return
- }
- set chanmode [getchanmode $chan]
- if {[string match -nocase "*D*" $chanmode] && [string match -nocase "*m*" $chanmode]} {
- if {[string equal -nocase $check_code $black(securecode:$nick:$chan)]} {
- set lang [setting:get $chan lang]
- if {$lang == ""} { set lang [string tolower $black(default_lang)] }
- if {[setting:get $chan xonly]} {
- putserv "PRIVMSG $black(chanserv) :voice $nick $chan"
- set replace(%chan%) $chan
- set replace(%msg.1%) $nick
- set message [string map [array get replace] $black(say.$lang.securemode.2)]
- putserv "PRIVMSG $nick :$message"
- if {[info exists black(secure:$chan:allowlist)]} {
- if {[lsearch -exact [string tolower $black(secure:$chan:allowlist)] [string tolower $host]] < 0} {
- lappend black(secure:$chan:allowlist) $host
- }
- } else { lappend black(secure:$chan:allowlist) $host }
- } else {
- putserv "MODE $chan +v $nick"
- set replace(%chan%) $chan
- set replace(%msg.1%) $nick
- set message [string map [array get replace] $black(say.$lang.securemode.2)]
- putserv "PRIVMSG $nick :$message"
- if {[info exists black(secure:$chan:allowlist)]} {
- if {[lsearch -exact [string tolower $black(secure:$chan:allowlist)] [string tolower $host]] < 0} {
- lappend black(secure:$chan:allowlist) $host
- }
- } else { lappend black(secure:$chan:allowlist) $host }
- if {[info exists black(securecode:$nick:$chan)]} {
- unset black(securecode:$nick:$chan)
- }
- if {[lsearch -exact [string tolower $black(secure:$chan:list)] [string tolower $nick]] > -1} {
- set position [lsearch -exact [string tolower $black(secure:$chan:list)] [string tolower $nick]]
- set black(secure:$chan:list) [lreplace $black(secure:$chan:list) $position $position]
- }
- }
- }
- }
- }
- voiceme {
- if {![validchan $chan]} {
- return
- }
- if {![setting:get $chan voiceme]} {
- return
- }
- if {![botisop $chan] && ![setting:get $chan xonly]} {
- return
- }
- if {![onchan $nick $chan]} {
- return
- }
- if {[isop $nick $chan] || [isvoice $nick $chan]} {
- return
- }
- if {[setting:get $chan onlyonmode] && ![info exists black(voiceme:stat:$chan)]} {
- return
- }
- if {[isvoice $nick $chan]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 voiceme.4 none
- return
- }
- putserv "WHOIS $nick"
- set ::vnick $nick
- set ::vchan $chan
- set ::vhand $hand
- bind RAW - 330 voiceme:logged
- bind RAW - 307 voiceme:identified
- }
- unbanme {
- if {![regexp {^[&#]} $chan]} {
- return
- }
- if {![validchan $chan]} {
- return
- }
- if {![botisop $chan] && ![setting:get $chan xonly]} {
- return
- }
- set found_ban 0
- foreach b [blacktools:banlist $chan] {
- set read_chan [lindex [split $b] 2]
- if {[string equal -nocase $read_chan $chan]} {
- set read_host [lindex [split $b] 3]
- set real_read_host [string map [list \[ {\[} \] {\]} \? {\?} \\ {\\}] $read_host]
- if {[string match -nocase $real_read_host "$nick!$host"] || [string match -nocase "$nick!$host" $real_read_host]} {
- set read_bot [lindex [split $b] 7]
- if {$read_bot == 3} {
- set found_ban 1
- }
- }
- }
- }
- if {$found_ban == "0"} {
- return
- }
- set code [join [lrange [split $arg] 2 end]]
- if {$code == ""} {
- set black(botcode:$chan) [string toupper [bot:setcode]]
- blacktools:tell $nick "prv" $hand $chan $chan1 bot.6 $black(botcode:$chan)
- foreach tmr [utimers] {
- if {[string match "*unset black(botcode:$chan)*" [join [lindex $tmr 1]]]} {
- killutimer [lindex $tmr 2]
- }
- }
- utimer 60 [list unset black(botcode:$chan)]
- return
- }
- if {![info exists black(botcode:$chan)]} {
- return
- }
- if {[string equal -nocase $code $black(botcode:$chan)]} {
- foreach b [blacktools:banlist $chan] {
- set read_chan [lindex [split $b] 2]
- set read_host [lindex [split $b] 3]
- set real_read_host [string map [list \[ {\[} \] {\]} \? {\?} \\ {\\}] $read_host]
- if {[string match -nocase $real_read_host "$nick!$host"]} {
- set read_bot [lindex [split $b] 7]
- if {$read_bot == 3} {
- if {[ischanban $read_host $chan] && [botisop $chan]} {
- pushmode $chan -b $read_host
- }
- if {[setting:get $chan xonly] || [setting:get $chan xtools]} {
- putquick "PRIVMSG $black(chanserv) :unban $chan $read_host"
- }
- blacktools:auto:remove $read_host $chan
- blacktools:tell $nick "prv" $hand $chan $chan1 bot.7 none
- }
- }
- }
- }
- }
- enable {
- if {[matchattr $hand nmo|M $chan]} {
- set what [lindex [split $arg] 2]
- set user [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set what [lindex [split $arg] 1]
- set user [lindex [split $arg] 2]
- }
- set chan1 "$chan"
- set type "2"
- enable:process $nick "prv" $hand $chan $chan1 $type $what $user
- }
- }
- disable {
- if {[matchattr $hand nmo|M $chan]} {
- set what [lindex [split $arg] 2]
- set user [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set what [lindex [split $arg] 1]
- set user [lindex [split $arg] 2]
- }
- set chan1 "$chan"
- set type "2"
- disable:process $nick "prv" $hand $chan $chan1 $type $what $user
- }
- }
- dr {
- if {[matchattr $hand nmo|OSMA $chan]} {
- set drone [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set drone [lindex [split $arg] 1]
- }
- set type 2
- set chan1 "$chan"
- userhost:act $drone $nick $hand "prv" $chan $chan1 $type $black(dr:bantime) "dr" "" "0"
- }
- }
- bot {
- if {[matchattr $hand nmo|OSMA $chan]} {
- set bot [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set bot [lindex [split $arg] 1]
- }
- set type 2
- set chan1 "$chan"
- userhost:act $bot $nick "$hand:bot" "prv" $chan $chan1 $type $black(bot:bantime) "bot" "" "0"
- }
- }
- n {
- if {[matchattr $hand nmo|OMA $chan]} {
- set badnick [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set badnick [lindex [split $arg] 1]
- }
- set type 0
- set chan1 "$chan"
-
- if {[setting:get $chan nextshortcmd]} {
- nextpublic:process $nick "prv" $hand $chan $chan1 $badnick
- return
- }
- if {[regexp {\*} $badnick]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "n"
- return
- }
- if {$badnick == ""} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "n"
- return
- }
- bancmds:process $badnick $badnick $nick $hand "prv" $chan $chan1 $type $black(n:bantime) "n" "" "0"
- }
- }
- id {
- if {[matchattr $hand nmo|OMA $chan]} {
- set badident [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set badident [lindex [split $arg] 1]
- }
- set handle [nick2hand $badident]
- set type 2
- set chan1 "$chan"
- userhost:act $badident $nick $hand "prv" $chan $chan1 $type $black(id:bantime) "id" "" "0"
- }
- }
- spam {
- if {[matchattr $hand nmo|OMA $chan]} {
- set spammer [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set spammer [lindex [split $arg] 1]
- }
- set type 2
- set chan1 "$chan"
- userhost:act $spammer $nick $hand "prv" $chan $chan1 $type $black(spam:bantime) "spam" "" "0"
- }
- }
- bw {
- if {[matchattr $hand nmo|OMA $chan]} {
- set badw [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set badw [lindex [split $arg] 1]
- }
- set type 2
- set chan1 "$chan"
- userhost:act $badw $nick $hand "prv" $chan $chan1 $type $black(bw:bantime) "bw" "" "0"
- }
- }
- black {
- if {[matchattr $hand nmo|MA $chan]} {
- set blackb [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set blackb [lindex [split $arg] 1]
- set reason [join [lrange [split $arg] 2 end]]
- }
- set type 2
- set chan1 "$chan"
- userhost:act $blackb $nick $hand "prv" $chan $chan1 $type "0" "black" $reason "0"
- }
- }
- bl {
- if {[matchattr $hand nmo|MA $chan]} {
- set blackb [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set blackb [lindex [split $arg] 1]
- set reason [join [lrange [split $arg] 2 end]]
- }
- set type 2
- set chan1 "$chan"
- userhost:act $blackb $nick $hand "prv" $chan $chan1 $type "0" "black" $reason "0"
- }
- }
- b {
- if {[matchattr $hand nmo|MAO $chan]} {
- set no_chan 0
- set type 2
- set gl 0
- set link 0
- set chan1 "$chan"
- set level ""
- set b [lindex [split $arg] 2]
- set tm [lindex [split $arg] 3]
- set global [lindex [split $arg] 4]
- set reason [join [lrange [split $arg] 5 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set global [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 4 end]]
- }
- if {![regexp {^[&#]} $chan]} {
- set no_chan 1
- set b [lindex [split $arg] 1]
- set tm [lindex [split $arg] 2]
- set global [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 4 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set global [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 3 end]]
- }
- }
- if {$mychan_use == "1"} {
- set b [lindex [split $arg] 1]
- set tm [lindex [split $arg] 2]
- set global [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 4 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set global [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 3 end]]
- }
- if {[regexp {^[-]} $tm]} {
- set level [blacktools:check:levelban $hand $chan $tm]
- set reason [join [lrange [split $arg] 4 end]]
- set tm [lindex [split $arg] 3]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set tm [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 3 end]]
- }
- } elseif {[string equal -nocase "$global" "global"] && [matchattr $hand nm]} {
- set gl 1
- set tm [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 4 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set reason [join [lrange [split $arg] 3 end]]
- }
- } elseif {[string equal -nocase "$global" "link"] && [matchattr $hand nm]} {
- set link 1
- set tm [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 4 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set reason [join [lrange [split $arg] 3 end]]
- }
- if {$no_chan == "1"} {
- set b [lindex [split $arg] 1]
- set tm [lindex [split $arg] 2]
- set global [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 4 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set global [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 3 end]]
- }
- }
- } else {
- if {$return_time == "-1"} {
- set reason [join [lrange [split $arg] 2 end]]
- } else {
- set reason [join [lrange [split $arg] 3 end]]
- }
- }
- } else {
- if {[regexp {^[-]} $tm]} {
- set level [blacktools:check:levelban $hand $chan $tm]
- set reason [join [lrange [split $arg] 5 end]]
- set tm [lindex [split $arg] 4]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set tm [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 4 end]]
- }
- } elseif {[string equal -nocase "$global" "global"] && [matchattr $hand nm]} {
- set gl 1
- set tm [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 5 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set reason [join [lrange [split $arg] 4 end]]
- }
- if {$no_chan == "1"} {
- set b [lindex [split $arg] 1]
- set tm [lindex [split $arg] 2]
- set global [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 4 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set global [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 3 end]]
- }
- }
- } elseif {[string equal -nocase "$global" "link"] && [matchattr $hand nm]} {
- set link 1
- set tm [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 5 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set reason [join [lrange [split $arg] 4 end]]
- }
- if {$no_chan == "1"} {
- set b [lindex [split $arg] 1]
- set tm [lindex [split $arg] 2]
- set global [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 4 end]]
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set global [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 3 end]]
- }
- }
- } else {
- if {$return_time == "-1"} {
- set reason [join [lrange [split $arg] 3 end]]
- } else {
- set reason [join [lrange [split $arg] 4 end]]
- }
- }
- }
-
- if {[setting:get $chan nextshortcmd]} {
- noidlepublic:process $nick "prv" $hand $chan $chan1 $b 0
- return
- }
- if {($return_time > "20160" || $return_time == "0") && [matchattr $hand -|OS $b]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 b.6 none
- return
- }
- if {$return_time == "-1"} {
- set return_time $black(b:bantime)
- }
- if {[llength $level] > "1"} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.invalidlevel [string map {"0" ""} $level]
- return
- }
-
- if {$level != ""} {
- userhost:act $b $nick "$hand:$level" "prv" $chan $chan1 $type $return_time "b" $reason $gl
- } else {
- if {$link == "1"} {
- foreach c [link:get] {
- userhost:act $b $nick "$hand" "prv" $c $chan1 $type $return_time "b" $reason "2"
- }
- return
- }
- userhost:act $b $nick "$hand" "prv" $chan $chan1 $type $return_time "b" $reason $gl
- }
- }
- }
- stick {
- if {[matchattr $hand nmo|M $chan]} {
- set stickb [lindex [split $arg] 2]
- set tm [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set stickb [lindex [split $arg] 1]
- set tm [lindex [split $arg] 2]
- }
- set return_time [time_return_minute $tm]
- if {$return_time == "-1"} {
- set reason [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set reason [join [lrange [split $arg] 2 end]]
- }
- } else {
- set tm [lindex [split $arg] 4]
- set reason [join [lrange [split $arg] 4 end]]
- if {$mychan_use == "1"} {
- set tm [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 3 end]]
- }
- }
- set type 2
- set chan1 "$chan"
- if {($return_time > "20160" || $return_time == "0") && [matchattr $hand -|OS $stickb]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 b.6 none
- return
- }
- if {$return_time == "-1"} {
- set return_time $black(stick:bantime)
- }
- userhost:act $stickb $nick $hand "prv" $chan $chan1 $type $return_time "stick" $reason "0"
- }
- }
- ub {
- if {[matchattr $hand nmo|MAO $chan]} {
- set ban [lindex [split $arg] 1]
- set why [lindex [split $arg] 2]
- if {[regexp {^[&#]} $ban]} {
- set ban [lindex [split $arg] 2]
- set why [lindex [split $arg] 3]
- }
- set type 2
- set chan1 "$chan"
- if {[regexp {^[0-9]} $ban]} {
- set cmd "ub:id"
- } else {
- set cmd "ub"
- }
- if {[string equal -nocase $why "global"] && [matchattr $hand nm]} {
- ub:process $ban $ban $nick $hand "prv" $chan $chan1 $type "1" $cmd "" ""
- } elseif {[string equal -nocase $why "link"] && [matchattr $hand nm]} {
- ub:process $ban $ban $nick $hand "prv" $chan $chan1 $type "" "ub" "" "1"
- } else {
- ub:process $ban $ban $nick $hand "prv" $chan $chan1 $type "" $cmd "" ""
- }
- }
- }
- k {
- if {[matchattr $hand nmo|OMA $chan]} {
- set knick [lindex [split $arg] 2]
- set type 2
- set reason [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set knick [lindex [split $arg] 1]
- set reason [join [lrange [split $arg] 2 end]]
- }
- set handle [nick2hand $knick]
- set chan1 "$chan"
- if {$knick != ""} {
- k:process $knick $nick $hand "prv" $reason $chan $chan1 $type
- } else {k:process $knick $nick $hand "prv" $reason $chan $chan1 $type}
- }
- }
- w {
- if {[matchattr $hand nmo|OMA $chan]} {
- set wnick [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set wnick [lindex [split $arg] 1]
- }
- set type 2
- set handle [nick2hand $wnick]
- set chan1 "$chan"
- if {$wnick != ""} {
- w:process $wnick $nick $hand "prv" $chan $chan1 $type
- } else { w:process $wnick $nick $hand "prv" $chan $chan1 $type }
- }
- }
- ungag {
- if {[matchattr $hand nmo|OMA $chan]} {
- set gagger [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set gagger [lindex [split $arg] 1]
- }
- set type 2
- set chan1 "$chan"
- if {$gagger != ""} {
- ungag:process $gagger $nick $hand "prv" $chan $chan1 $type
- } else { ungag:process $gagger $nick $hand "prv" $chan $chan1 $type }
- }
- }
- gag {
- if {[matchattr $hand nmo|OMA $chan]} {
- set gagger [lindex [split $arg] 2]
- set time [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 4 end]]
- if {$mychan_use == "1"} {
- set gagger [lindex [split $arg] 1]
- set time [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 3 end]]
- }
- set type 2
- set handle [nick2hand $gagger]
- set chan1 "$chan"
- set return_time [time_return_minute $time]
- if {$return_time == "-1"} {
- set reason [join [lrange [split $arg] 3 end]]
- set time [setting:get $chan gag-bantime]
- if {$time == ""} {
- set time $black(gag:bantime)
- }
- }
- if {$gagger != ""} {
- gag:process $gagger $time $reason $nick "$hand:GAG" "prv" $chan $chan1 $type
- } else { gag:process $gagger $time $reason $nick $hand "prv" $chan $chan1 $type }
- }
- }
- show {
- if {[matchattr $hand nmo|M $chan]} {
- set wich [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set wich [lindex [split $arg] 1]
- }
- set type 2
- set chan1 "$chan"
- show:process $nick "prv" $hand $chan $chan1 $wich $type
- }
- }
- clonescan {
- if {[matchattr $hand nmo|MA $chan]} {
- set why [lindex [split $arg] 2]
- set type 2
- set chan1 "$chan"
- if {[regexp {^[&#]} $chan] && [matchattr $hand nmo|M $chan] && ($why != "")} {
- set chan1 "$chan"
- set clone [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- prot:module:process $nick "prv" $hand $chan $chan1 $chan $clone $type $number "clonescan"
- return
- }
- scanner:process $nick "prv" $hand $chan $chan1 $type
- }
- }
- sb {
- if {[matchattr $hand nmo|MAO $chan]} {
- set bhost [lindex [split $arg] 2]
- set what [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set bhost [lindex [split $arg] 1]
- set what [lindex [split $arg] 2]
- }
- set type 2
- set chan1 "$chan"
- if {$bhost != ""} {
- if {[regexp {^[0-9]} $bhost]} {
- sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" "2"
- return
- }
- if {![validchan $chan]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
- return
- }
- if {[onchan $bhost $chan]} {
- set bhost "$bhost![getchanhost $bhost $chan]"
- sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" "1"
- return
- }
- if {[regexp {\*} $bhost]} {
- sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" "1"
- return
- }
- sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" ""
- } else { sb:process $bhost $what $nick $hand "prv" $chan $chan1 $type "sb" ""}
- }
- }
- banlist {
- if {[matchattr $hand nmo|AOM $chan]} {
- set user [lindex [split $arg] 2]
- set next [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set user [lindex [split $arg] 1]
- set next [lindex [split $arg] 2]
- }
- if {[string equal -nocase $chan "global"]} {
- set user $chan
- }
- set type 2
- set chan1 "$chan"
- banlist:process $nick "prv" $hand $chan $chan1 $user $type "banlist" $next
- }
- }
- r {
- if {[matchattr $hand nmo|MAO $chan]} {
- set c [lindex [split $arg] 1]
- set chan1 $chan
- if {$c != "" && [matchattr $hand nmo|AMO $c]} {
- topic:refresh $nick "prv" $hand $c $chan1 $arg
- return
- }
- topic:refresh $nick "prv" $hand $chan $chan1 $arg
- }
- }
- egg {
- if {[matchattr $hand nm]} {
- set why [lindex [split $arg] 1]
- set type2 2
- set result [join [lrange [split $arg] 2 end]]
- egg:process $why $type2 $result $nick $hand "prv" $chan $chan1
- }
- }
- man {
- if {[matchattr $hand nmo|MASOV $chan]} {
- set command [lindex [split $arg] 1]
- set type 0
- man:process $nick $host $hand $chan $chan1 $type $command
- }
- }
- auto {
- if {[matchattr $hand nmo|MA $chan]} {
- set type 0
- set option [lindex [split $arg] 2]
- set user [lindex [split $arg] 3]
- set gl [lindex [split $arg] 4]
- if {$mychan_use == "1"} {
- set option [lindex [split $arg] 1]
- set user [lindex [split $arg] 2]
- set gl [lindex [split $arg] 3]
- }
- auto:process $nick "prv" $hand $chan $chan1 $user $option $gl $type
- }
- }
- version {
- if {[matchattr $hand nmo|MASOV $chan]} {
- version:process $nick $host $hand $chan $chan1
- }
- }
- seen {
- if {[matchattr $hand nmo|MAOV $chan]} {
- set type 2
- if {[matchattr $hand nmo]} {
- set s [lindex [split $arg] 1]
- if {[regexp {^[&#]} $s]} {
- set s [lindex [split $arg] 2]
- }
- } else {
- if {![regexp {^[&#]} $chan]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "seen"
- return
- }
- set s [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set s [lindex [split $arg] 1]
- }
- }
- seen:process $nick "$host:prv" $hand $chan $chan1 $s $type
- }
- }
- channels {
- if {[matchattr $hand nmo]} {
- set chan1 "$nick"
- channels:process $nick "prv" $hand $chan $chan1
- }
- }
- userlist {
- if {[matchattr $hand nmo|MAOV $chan]} {
- set type 2
- set chan1 $nick
- set level [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set level [lindex [split $arg] 1]
- }
- if {[string equal -nocase $chan "owner"] && [matchattr $hand nmo]} {
- userlist:execute $hand "prv" $chan $chan $chan1 $nick $type
- return
- }
- userlist:execute $hand "prv" $level $chan $chan1 $nick $type
- }
- }
- chuser {
- if {[matchattr $hand nmo|M $chan]} {
- set user [lindex [split $arg] 1]
- set chandle [lindex [split $arg] 2]
- set type 2
- set chan1 "$nick"
- chuser:process $nick "prv" $hand $chan $chan1 $user $chandle $type
- }
- }
- securemode {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set except [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set except [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- prot:module:process $nick "prv" $hand $chan $chan1 $why $except $type $number "securemode"
- }
- }
- delhost {
- if {[matchattr $hand nmo|MA $chan]} {
- set user [lindex [split $arg] 1]
- set type 2
- set chan1 "$chan"
- set hosts [join [lrange [split $arg] 2 end]]
- delhost:process $nick "prv" $hand $chan $chan1 $user $hosts $type
- }
- }
- addhost {
- if {[matchattr $hand nmo|MA $chan]} {
- set type 2
- set chan1 "$chan"
- set user [lindex [split $arg] 1]
- set hosts [join [lrange [split $arg] 2 end]]
- addhost:process $nick "prv" $hand $chan $chan1 $user $hosts $type
- }
- }
- del {
- if {[matchattr $hand nmo|M $chan]} {
- set args [lrange [split $arg] 1 end]
- set type 2
- set chan1 "$chan"
- del:process $nick "prv" $hand $chan $chan1 $args $type
- }
- }
- delacc {
- if {[matchattr $hand nmo|MA $chan]} {
- set args [lrange [split $arg] 2 end]
- if {$mychan_use == "1"} {
- set args [lrange [split $arg] 1 end]
- }
- set type 2
- set chan1 "$chan"
- foreach user $args {
- delacc:process $nick "prv" $hand $chan $chan1 $user $type
- }
- }
- }
- add {
- if {[matchattr $hand nmo|MA $chan]} {
- set level [lindex [split $arg] 2]
- set type 2
- set args [lrange [split $arg] 3 end]
- set c [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set level [lindex [split $arg] 1]
- set args [lrange [split $arg] 2 end]
- set c [lindex [split $arg] 2]
- }
- set chan1 "$chan"
- set handle ""
- set uhost ""
- if {$args != ""} {
- foreach user $args {
- if {$user != ""} {
- if {![regexp {^[a-zA-Z0-9]} $user]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 add.18 none
- continue
- }
- add:process $user $uhost $handle $level $hand "prv" $chan $chan1 $nick $type "add"
- }
- }
- } else { add:process "" $uhost $handle $level $hand "prv" $chan $chan1 $nick $type "add" }
- }
- }
- adduser {
- if {[matchattr $hand nmo|MA $chan]} {
- set level [lindex [split $arg] 2]
- set args [lrange [split $arg] 3 end]
- set c [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set level [lindex [split $arg] 1]
- set args [lrange [split $arg] 2 end]
- set c [lindex [split $arg] 2]
- }
- set type 2
- set chan1 "$chan"
- if {$args != ""} {
- foreach user $args {
- if {$user != ""} {
- set handle [nick2hand $user]
- if {![onchan $user $chan] && ![validuser $user]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.usernotonchan $user
- return
- }
- set hosts [getchanhost $user $chan]
- set uhost [return_mask $black(addusermask) $hosts $user]
- add:process $user $uhost $handle $level $hand "prv" $chan $chan1 $nick $type "adduser"
- }
- }
- } else { add:process "" "" "" $level $hand "prv" $chan $chan1 $nick $type "adduser" }
- }
- }
- suspend {
- if {[matchattr $hand nmo]} {
- set cmd_status [btcmd:status $chan $hand "suspend" 0]
- if {$cmd_status == "1"} {
- return
- }
- set chan1 "$chan"
- if {$chan == ""} {blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "suspend"
- return
- }
- if {![regexp {^[&#]} $chan]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
- return
- }
- if {![validchan $chan]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
- return
- }
- if {[channel get $chan inactive]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 suspend.3 $chan
- return
- }
- channel set $chan +inactive
- blacktools:tell $nick "prv" $hand $chan $chan1 suspend.4 $chan
- }
- }
- unsuspend {
- if {[matchattr $hand nmo]} {
- set cmd_status [btcmd:status $chan $hand "unsuspend" 0]
- if {$cmd_status == "1"} {
- return
- }
- set chan1 "$chan"
- if {$chan == ""} {blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "unsuspend"
- return
- }
- if {![regexp {^[&#]} $chan]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
- return
- }
-
- if {![validchan $chan]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
- return
- }
- if {![channel get $chan inactive]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 unsuspend.3 $chan
- return
- }
- channel set $chan -inactive
- blacktools:tell $nick "prv" $hand $chan $chan1 unsuspend.4 $chan
- }
- }
- delchan {
- if {[matchattr $hand nmo]} {
- set cmd_status [btcmd:status $chan $hand "delchan" 0]
- if {$cmd_status == "1"} {
- return
- }
- set chan1 "$chan"
- if {$chan == ""} {blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "delchan"
- return
- }
- if {![regexp {^[&#]} $chan]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
- return
- }
- if {![validchan $chan]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
- return
- }
- set getlang [string tolower [getuser $hand XTRA OUTPUT_LANG]]
- if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
- if {!($black(homechan) == "") && ![string equal -nocase $black(homechan) "#no_home_chan"]} {
- if {[string equal -nocase $chan $black(homechan)]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 delchan.5 $chan
- return
- }
- }
- channel remove $chan
- delchan:all $chan
- blacktools:tell $nick "prv" $hand $chan $chan1 delchan.3 $chan
- }
- }
- addchan {
- if {[matchattr $hand nmo]} {
- set cmd_status [btcmd:status $chan $hand "addchan" 0]
- if {$cmd_status == "1"} {
- return
- }
- set key [lindex [split $arg] 2]
- set chan1 "$chan"
- if {$chan == ""} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.instr_priv "addchan"
- return
- }
- if {![regexp {^[&#]} $chan]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 gl.novalidchan none
- return
- }
- if {[validchan $chan]} {
- blacktools:tell $nick "prv" $hand $chan $chan1 addchan.2 $chan
- return
- } else {
- channel add $chan
- blacktools:tell $nick "prv" $hand $chan $chan1 addchan.3 $chan
- if {$key != ""} {
- putquick "JOIN $chan :$key"
- channel set $chan chanmode "+ntk $key"
- }
- }
- }
- }
- die {
- if {[matchattr $hand nm]} {
- set cmd_status [btcmd:status $chan $hand "die" 0]
- if {$cmd_status == "1"} {
- return
- }
- set chan1 "$chan"
- set reason [join [lrange [split $arg] 1 end]]
- set getlang [string tolower [getuser $hand XTRA OUTPUT_LANG]]
- if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
- blacktools:tell $nick "prv" $hand $chan $chan1 die.1 none
- if {$reason == ""} {
- set reason $black(say.$getlang.die.2)
- }
- utimer 3 [list die $reason]
- }
- }
- jump {
- if {[matchattr $hand nm]} {
- set cmd_status [btcmd:status $chan $hand "jump" 0]
- if {$cmd_status == "1"} {
- return
- }
- set chan1 "$chan"
- set serv [lindex [split $arg] 1]
- if {$serv == ""} {
- blacktools:tell $nick "prv" $hand $chan $chan1 jump.1 "..."
- utimer 3 [list jump]
- } else {
- blacktools:tell $nick "prv" $hand $chan $chan1 jump.1 "\002$serv\002"
- utimer 3 [list jump $serv]
- }
- }
- }
- save {
- if {[matchattr $hand nm]} {
- set cmd_status [btcmd:status $chan $hand "save" 0]
- if {$cmd_status == "1"} {
- return
- }
- set chan1 "$chan"
- blacktools:tell $nick "prv" $hand $chan $chan1 save.1 none
- save
- }
- }
- restart {
- if {[matchattr $hand nm]} {
- set cmd_status [btcmd:status $chan $hand "restart" 0]
- if {$cmd_status == "1"} {
- return
- }
- set chan1 "$chan"
- blacktools:tell $nick "prv" $hand $chan $chan1 restart.1 none
- utimer 3 [list restart]
- }
- }
- rehash {
- if {[matchattr $hand nm]} {
- set cmd_status [btcmd:status $chan $hand "rehash" 0]
- if {$cmd_status == "1"} {
- return
- }
- set chan1 "$chan"
- blacktools:tell $nick "prv" $hand $chan $chan1 rehash.1 none
- rehash
- }
- }
- nick {
- if {[matchattr $hand nm]} {
- set thenick [lindex [split $arg] 1]
- set chan1 $chan
- set type 2
- tempnick:process $thenick $nick "prv" $hand $chan $chan1 $type
- }
- }
- msg {
- if {[matchattr $hand nmo]} {
- set who [lindex [split $arg] 1]
- set chan1 "$chan"
- set type 2
- set msg [join [lrange [split $arg] 2 end]]
- msg:process $nick "prv" $hand $chan $chan1 $who $msg $type
- }
- }
- set {
- if {[matchattr $hand nmo|M $chan]} {
- set flags [lindex [split $arg] 2]
- set type [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set flags [lindex [split $arg] 1]
- set type [join [lrange [split $arg] 2 end]]
- }
- set type1 2
- set chan1 "$chan"
- if {[matchattr $hand mn]} {
- if {[string equal -nocase "global" $chan]} {
- set chan "$flags"
- foreach c [channels] {
- set:process $nick "prv" $hand $c $chan1 $flags $type $type1
- }
- return
- }
- }
- set:process $nick "prv" $hand $chan $chan1 $flags $type $type1
- }
- }
- mode {
- if {[matchattr $hand nmo|OMA $chan]} {
- set modes [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set modes [lindex [split $arg] 1]
- }
- set type 2
- set chan1 "$chan"
- mode:process $nick "prv" $hand $chan $chan1 $modes $type
- }
- }
- cycle {
- if {[matchattr $hand nmo|OMA $chan]} {
- set reason [join [lrange [split $arg] 2 end]]
- if {$mychan_use == "1"} {
- set reason [join [lrange [split $arg] 1 end]]
- }
- set chan1 "$chan"
- cycle:process $nick "prv" $hand $chan $chan1 $reason
- }
- }
- purge {
- if {[matchattr $hand -|M $chan]} {
- set reason [join [lrange [split $arg] 2 end]]
- if {$mychan_use == "1"} {
- set reason [join [lrange [split $arg] 1 end]]
- }
- set chan1 "$chan"
- if {$reason == ""} {
- blacktools:tell $nick "prv" $hand $chan $chan1 purge.1 none
- return
- }
- purge:process $nick "prv" $hand $chan $chan1 $reason
- }
- }
- broadcast {
- if {[matchattr $hand nm]} {
- set text [join [lrange [split $arg] 2 end]]
- set chan1 "$chan"
- set type 2
- broadcast:cmd:process $nick "prv" $hand $chan $chan1 $text $type
- }
- }
- act {
- if {[matchattr $hand nmo|MA $chan]} {
- set text [join [lrange [split $arg] 2 end]]
- set c [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set text [join [lrange [split $arg] 1 end]]
- set c [lindex [split $arg] 1]
- }
- set type 2
- set chan1 "$chan"
- act:process $nick "prv" $hand $chan $chan1 $text $type
- }
- }
- say {
- if {[matchattr $hand nmo|MA $chan]} {
- set text [join [lrange [split $arg] 2 end]]
- set c [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set text [join [lrange [split $arg] 1 end]]
- set c [lindex [split $arg] 1]
- }
- set type 2
- set chan1 "$chan"
- say:process $nick "prv" $hand $chan $chan1 $text $type
- }
- }
- v {
- if {[matchattr $hand nmo|VOMA $chan]} {
- set voicex [join [lrange [split $arg] 2 end]]
- if {$mychan_use == "1"} {
- set voicex [join [lrange [split $arg] 1 end]]
- }
- set chan1 "$chan"
- v:process [split $nick] "prv" $hand $chan $chan1 $voicex
- }
- }
- ho {
- if {[matchattr $hand nmo|OMA $chan]} {
- set hopex [join [lrange [split $arg] 2 end]]
- if {$mychan_use == "1"} {
- set hopex [join [lrange [split $arg] 1 end]]
- }
- set chan1 "$chan"
- ho:process $nick "prv" $hand $chan $chan1 $hopex
- }
- }
- o {
- if {[matchattr $hand nmo|OMA $chan]} {
- set opex [join [lrange [split $arg] 2 end]]
- if {$mychan_use == "1"} {
- set opex [join [lrange [split $arg] 1 end]]
- }
- set chan1 "$chan"
- o:process $nick "prv" $hand $chan $chan1 $opex
- }
- }
- private {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set user [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set user [lindex [split $arg] 2]
- }
- private:process $nick "prv" $hand $chan $chan1 $why $user $type
- }
- }
- myset {
- foreach c [channels] {
- if {[matchattr $hand nmo|AOMV $c]} {
- set chan $c
- }
- }
- if {[regexp {^[&#]} $chan] && [validuser $hand]} {
- set type 2
- set chan1 "$chan"
- set flags [lindex [split $arg] 1]
- set typez [lindex [split $arg] 2]
- set chan2 [lindex [split $arg] 3]
- set arg [join [lrange [split $arg] 2 end]]
- myset:process $nick "prv" $hand $chan $chan1 $flags $typez $type $chan2 $arg
- }
- }
- uptime {
- if {[matchattr $hand nmo]} {
- set cmd_status [btcmd:status $chan $hand "uptime" 0]
- if {$cmd_status == "1"} {
- return
- }
- set getlang [string tolower [getuser $hand XTRA OUTPUT_LANG]]
- if {[matchattr $hand q]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.glsuspend none
- return
- }
- if {[matchattr $hand -|q $chan]} { blacktools:tell $nick "prv" $hand $chan $chan1 gl.suspend none
- return
- }
- if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
- set chan1 "$chan"
- set up [return_time_2 $getlang [expr [unixtime] - $uptime]]
- set on [return_time_2 $getlang [expr [unixtime] - ${server-online}]]
- catch {exec uptime} shelluptime
- set file [open $black(uptime_file) "r"]
- set data [read -nonewline $file]
- close $file
- if {$data == ""} {
- set read_maxup "-"
- set read_maxon "-"
- } else {
- set read_maxup [return_time_2 $getlang [lindex [split $data] 0]]
- set read_maxon [return_time_2 $getlang [lindex [split $data] 1]]
- }
- blacktools:tell $nick "prv" $hand $chan $chan1 maxup.1 "$up $read_maxup"
- blacktools:tell $nick "prv" $hand $chan $chan1 maxon.1 "$on $read_maxon"
- blacktools:tell $nick "prv" $hand $chan $chan1 uptime.2 $shelluptime
- blacktools:tell $nick "prv" $hand $chan $chan1 uptime.3 $server
- }
- }
- status {
- if {[matchattr $hand nmo]} {
- status:process $nick "prv" $hand $chan
- }
- }
- t {
- if {[matchattr $hand nmo|OMA $chan]} {
- set topics [join [lrange [split $arg] 2 end]]
- if {$mychan_use == "1"} {
- set topics [join [lrange [split $arg] 1 end]]
- }
- set type 2
- set chan1 "$chan"
- t:process $nick "prv" $hand $chan $chan1 $topics $type
- }
- }
- tcl {
- if {[matchattr $hand n]} {
- set type 2
- set chan1 "$chan"
- set the_script [lindex [split $arg] 2]
- set who [lindex [split $arg] 1]
- tcl:process $nick "prv" $hand $chan $chan1 $type $the_script $who
- }
- }
- anunt {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set who [lindex [split $arg] 2]
- set message [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set who [lindex [split $arg] 1]
- set message [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- anunt:process $nick "prv" $hand $chan $chan1 $who $message $number $type
- }
- }
- h {
- if {[matchattr $hand nmo|MOAV $chan]} {
- set chan1 "$chan"
- set type 2
- set command [lindex [split $arg] 1]
- if {[regexp {^[&#]} $command]} {
- set chan $command
- set command [lindex [split $arg] 2]
- }
- h:process $nick "prv" $hand $chan $chan1 $command $type
- }
- }
- cp {
- if {[matchattr $hand nm]} {
- set type 2
- set chan1 $chan
- set what [lindex [split $arg] 1]
- set from [lindex [split $arg] 2]
- set to [lindex [split $arg] 3]
- cp:process $nick "prv" $hand $chan $chan1 $type $what $from $to
- }
- }
- banstats {
- if {[matchattr $hand nmo|AOM $chan]} {
- set next [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set next [lindex [split $arg] 1]
- }
- set cmd ""
- set type 2
- set chan1 "$chan"
- if {[string equal -nocase $next "reset"]} {
- set cmd "reset"
- }
- if {[string equal -nocase $next "total"]} {
- set next [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set next [lindex [split $arg] 2]
- }
- set cmd "total"
- }
- banstats:process $nick "prv" $hand $chan $chan1 $cmd $type $next
- }
- }
- troll {
- if {[matchattr $hand nmo|AOM $chan]} {
- set tr [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set tr [lindex [split $arg] 1]
- }
- set chan1 "$chan"
- set type 2
- userhost:act $tr $nick $hand "prv" $chan $chan1 $type "1440" "troll" "" "0"
- }
- }
- limit {
- if {[matchattr $hand nmo|M $chan]} {
- set why [lindex [split $arg] 1]
- set lm [lindex [split $arg] 2]
- set type 2
- set chan1 "$chan"
- if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
- set chan "$why"
- set why [lindex [split $arg] 2]
- set lm [lindex [split $arg] 3]
- }
- limit:process $nick "prv" $hand $chan $chan1 $why $lm $type
- }
- }
- bt {
- if {[matchattr $hand nm]} {
- set chan1 "$chan"
- set type 2
- set who [lindex [split $arg] 1]
- set message [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- broadcast:process $nick "prv" $hand $chan $chan1 $who $message $number $type
- }
- }
- us {
- if {[matchattr $hand nmo|MA $chan]} {
- set type 2
- set chan1 "$chan"
- set users [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set users [lindex [split $arg] 1]
- }
- us:process $nick "prv" $hand $chan $chan1 $users $type
- }
- }
- s {
- if {[matchattr $hand nmo|MA $chan]} {
- set type 2
- set chan1 "$chan"
- set user [lindex [split $arg] 2]
- set suspend_time [lindex [split $arg] 3]
- set suspend_reason [join [lrange [split $arg] 4 end]]
- if {$mychan_use == "1"} {
- set user [lindex [split $arg] 1]
- set suspend_time [lindex [split $arg] 2]
- set suspend_reason [join [lrange [split $arg] 3 end]]
- }
- if {![regexp {^[0-9]} $suspend_time]} {
- set suspend_reason [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set suspend_reason [join [lrange [split $arg] 2 end]]
- }
- }
- s:process $nick "prv" $hand $chan $chan1 $user $type $suspend_time $suspend_reason
- }
- }
- guestnick {
- if {[matchattr $hand nmo|M $chan]} {
- set who [lindex [split $arg] 2]
- set modul "guestnick"
- set type 2
- set chan1 $chan
- set gnick [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set who [lindex [split $arg] 1]
- set gnick [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- guestnick:process $nick "prv" $hand $chan $chan1 $who $gnick $type $number $modul
- }
- }
- badhost {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set badh [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set badh [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- prot:module:process $nick "prv" $hand $chan $chan1 $why $badh $type $number "badhost"
- }
- }
- badrealname {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set badf [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set badf [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- prot:module:process $nick "prv" $hand $chan $chan1 $why $badf $type $number "badrealname"
- }
- }
- badquitpart {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set badq [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set badq [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- prot:module:process $nick "prv" $hand $chan $chan1 $why $badq $type $number "badquitpart"
- }
- }
- badident {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set badi [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set badi [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- prot:module:process $nick "prv" $hand $chan $chan1 $why $badi $type $number "badident"
- }
- }
- badnick {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set badn [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set badn [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- prot:module:process $nick "prv" $hand $chan $chan1 $why $badn $type $number "badnick"
- }
- }
- badword {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set badw [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set badw [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- prot:module:process $nick "prv" $hand $chan $chan1 $why $badw $type $number "badword"
- }
- }
- info {
- if {[matchattr $hand nmo|MAOV $chan]} {
- set user [lindex [split $arg] 2]
- set infouser [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set user [lindex [split $arg] 1]
- set infouser [lindex [split $arg] 1]
- }
- if {![regexp {^[&#]} $chan]} {
- set user $chan
- }
- set type 2
- set chan1 "$chan"
- if {[regexp {^[&#]} $chan] && [matchattr $hand nmo|MAO $chan] && ($infouser == "")} {
- info:process:chan $nick "prv" $hand $chan $chan1
- return
- }
- info:process $nick "prv" $hand $chan $chan1 $user $type
- }
- }
- antipub {
- if {[matchattr $hand nmo|M $chan]} {
- set type 2
- set chan1 "$chan"
- set why [lindex [split $arg] 2]
- set except [join [lrange [split $arg] 3 end]]
- set number [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set except [join [lrange [split $arg] 2 end]]
- set number [lindex [split $arg] 2]
- }
- prot:module:process $nick "prv" $hand $chan $chan1 $why $except $type $number "antipub"
- }
- }
- badchan {
- if {[matchattr $hand nmo|M $chan]} {
- set why [lindex [split $arg] 2]
- set type1 2
- set chan1 "$chan"
- set bdchan [lindex [split $arg] 3]
- set type [lindex [split $arg] 4]
- set reason [join [lrange [split $arg] 4 end]]
- if {[string equal -nocase $type "global"]} {
- set reason [join [lrange [split $arg] 5 end]]
- }
- if {$mychan_use == "1"} {
- set why [lindex [split $arg] 1]
- set bdchan [lindex [split $arg] 2]
- set type [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 3 end]]
- if {[string equal -nocase $type "global"]} {
- set reason [join [lrange [split $arg] 4 end]]
- }
- }
- if {![regexp {^[&#]} $chan] && [matchattr $hand nmo]} {
- set why $chan
- set bdchan [lindex [split $arg] 2]
- set type [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 3 end]]
- if {[string equal -nocase $type "global"]} {
- set reason [join [lrange [split $arg] 4 end]]
- }
- if {$mychan_use == "1"} {
- set bdchan [lindex [split $arg] 1]
- set type [lindex [split $arg] 2]
- set reason [join [lrange [split $arg] 2 end]]
- if {[string equal -nocase $type "global"]} {
- set reason [join [lrange [split $arg] 3 end]]
- }
- }
- }
- badchan:process $nick "prv" $hand $chan $chan1 $why $bdchan $type1 $type $reason
- }
- }
- unset {
- if {[matchattr $hand nmo|M $chan]} {
- set setting [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set setting [lindex [split $arg] 1]
- }
- set chan1 $chan
- set type 2
- if {[string equal -nocase $setting "global"] && [matchattr $hand nm]} {
- set setting [lindex [split $arg] 2]
- foreach c [channels] {
- unset:process $nick "prv" $hand $c $chan1 $setting $type
- }
- return
- }
- unset:process $nick "prv" $hand $chan $chan1 $setting $type
- }
- }
- greet {
- if {[matchattr $hand nmo|M $chan]} {
- set who [lindex [split $arg] 2]
- set modul "greet"
- set type 2
- set chan1 $chan
- set greet [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set who [lindex [split $arg] 1]
- set greet [join [lrange [split $arg] 2 end]]
- }
- othermodule:process $nick "prv" $hand $chan $chan1 $who $greet $type $modul
- }
- }
- leave {
- if {[matchattr $hand nmo|M $chan]} {
- set who [lindex [split $arg] 2]
- set modul "leave"
- set type 2
- set chan1 $chan
- set leave [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set who [lindex [split $arg] 1]
- set leave [join [lrange [split $arg] 2 end]]
- }
- othermodule:process $nick "prv" $hand $chan $chan1 $who $leave $type $modul
- }
- }
- topic {
- if {[matchattr $hand nmo|M $chan]} {
- set who [lindex [split $arg] 2]
- set modul "topic"
- set type 2
- set chan1 $chan
- set topic [join [lrange [split $arg] 3 end]]
- if {$mychan_use == "1"} {
- set who [lindex [split $arg] 1]
- set topic [join [lrange [split $arg] 2 end]]
- }
- othermodule:process $nick "prv" $hand $chan $chan1 $who $topic $type $modul
- }
- }
- vr {
- if {[matchattr $hand nmo|OMA $chan]} {
- set vr [lindex [split $arg] 2]
- set chan1 "$chan"
- set type 2
- if {$mychan_use == "1"} {
- set vr [lindex [split $arg] 1]
- }
- userhost:act $vr $nick $hand "prv" $chan $chan1 $type $black(vr:bantime) "vr" "" "0"
- }
- }
- timer {
- if {[matchattr $hand nm]} {
- set chan1 $chan
- set cmd [lindex [split $arg] 1]
- set pid [lindex [split $arg] 2]
- set timer_args [join [lrange [split $arg] 4 end]]
- set type 2
- timer:process $nick "prv" $hand $chan $chan1 $cmd $pid $timer_args $type
- }
- }
- i {
- if {[matchattr $hand nmo|VAOM $chan]} {
- set type 2
- set chan1 "$chan"
- set inick [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set inick [lindex [split $arg] 1]
- }
- if {[regexp {^[&#]} $inick] && [matchattr $hand nmo|VAOM $inick]} {
- set chan "$inick"
- set inick [lindex [split $arg] 3]
- }
- i:process $nick "prv" $hand $chan $chan1 $inick $type
- }
- }
- next {
- if {[matchattr $hand nmo|MAO $chan]} {
- set option [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set option [lindex [split $arg] 1]
- }
- set chan1 $chan
- foreach c [channels] {
- set backchan [join [setting:get $c next-backchan]]
- if {[string match -nocase $chan $backchan]} {
- set chan "$c"
- }
- }
- nextpublic:process $nick "prv" $hand $chan $chan1 $option
- }
- }
- helped {
- if {[matchattr $hand nmo|MAO $chan]} {
- set user [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set user [lindex [split $arg] 1]
- }
- set chan1 $chan
- set type 1
- foreach c [channels] {
- set backchan [join [setting:get $c next-backchan]]
- if {[string match -nocase $chan $backchan]} {
- set chan "$c"
- }
- }
- helpedpublic:process $nick "prv" $hand $chan $chan1 $user $type
- }
- }
- noidle {
- if {[matchattr $hand nmo|MAO $chan]} {
- set user [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set user [lindex [split $arg] 1]
- }
- set chan1 $chan
- set type 2
- foreach c [channels] {
- set backchan [join [setting:get $c next-backchan]]
- if {[string match -nocase $chan $backchan]} {
- set chan "$c"
- }
- }
- noidlepublic:process $nick "prv" $hand $chan $chan1 $user $type
- }
- }
- skip {
- if {[matchattr $hand nmo|MAO $chan]} {
- set user [lindex [split $arg] 2]
- if {$mychan_use == "1"} {
- set user [lindex [split $arg] 1]
- }
- set chan1 $chan
- set type 2
- foreach c [channels] {
- set backchan [join [setting:get $c next-backchan]]
- if {[string match -nocase $chan $backchan]} {
- set chan "$c"
- }
- }
- skippublic:process $nick "prv" $hand $chan $chan1 $user $type
- }
- }
- activ {
- if {[matchattr $hand nmo|AOMV $chan]} {
- set type 2
- set chan1 "$chan"
- set user [lindex [split $arg] 2]
- set option [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set user [lindex [split $arg] 1]
- set option [lindex [split $arg] 2]
- }
- activ:process $nick "prv" $hand $chan $chan1 $user $option $type
- }
- }
- topwords {
- if {[matchattr $hand nmo|AOMV $chan]} {
- set next [lindex [split $arg] 2]
- set cmd ""
- set type 2
- set chan1 "$chan"
- if {$mychan_use == "1"} {
- set next [lindex [split $arg] 1]
- }
- if {[string equal -nocase $next "reset"] && [matchattr $hand nmo|M $chan]} {
- set cmd "reset"
- }
- if {[string equal -nocase $next "total"]} {
- set next [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set next [lindex [split $arg] 2]
- }
- set cmd "total"
- }
- if {[string equal -nocase $next "add"] && [matchattr $hand nmo|M $next]} {
- set next [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set next [lindex [split $arg] 2]
- }
- set cmd "add"
- }
- if {[string equal -nocase $next "del"] && [matchattr $hand nmo|M $next]} {
- set next [lindex [split $arg] 3]
- if {$mychan_use == "1"} {
- set next [lindex [split $arg] 2]
- }
- set cmd "del"
- }
- topwords:process $nick "prv" $hand $chan $chan1 $cmd $type $next
- }
- }
- ignore {
- if {[matchattr $hand nmo|M $chan]} {
- set chan1 "$chan"
- set type 2
- set what [lindex [split $arg] 1]
- set mask [lindex [split $arg] 2]
- set time [lindex [split $arg] 3]
- set reason [join [lrange [split $arg] 4 end]]
- if {![regexp {^[0-9]} $time]} {
- set reason [join [lrange [split $arg] 3 end]]
- }
- ignore:process $nick "prv" $hand $chan $chan1 $what $mask $time $reason $type
- }
- }
- chat {
- if {[matchattr $hand nm]} {
- set cmd_status [btcmd:status $chan $hand "chat" 0]
- if {$cmd_status == "1"} {
- return
- }
- set chan1 $chan
- *ctcp:CHAT $nick $host $hand $botnick CHAT $arg
- blacktools:tell $nick "prv" $hand $chan $chan1 chat.1 none
- }
- }
- hello {
- if {![file exists $userfile]} {
- blacktools:hello $nick $host $hand
- }
- }
- pass {
- if {[validuser $hand]} {
- set pass [lindex [split $arg] 1]
- if {$pass == ""} {
- return
- }
- if {[getuser $hand pass] != ""} {
- return
- }
- setuser $hand PASS $pass
- blacktools:tell $nick "prv" $hand "" "" pass.1 $pass
- }
- }
- }
- }
- ##############
- #########################################################################
- ## END ##
- #########################################################################
|