├── VERSION ├── BlackTools ├── temp │ ├── banner │ └── motd ├── lang │ ├── HowToAdd.txt │ ├── CumSaAdaugi.txt │ └── loader.tcl ├── Protections │ ├── BT.antinotice.tcl │ ├── BT.antictcp.tcl │ ├── BT.antilongtext.tcl │ ├── BT.repetitivechars.tcl │ ├── BT.antichanflood.tcl │ ├── BT.nickflood.tcl │ ├── BT.badident.tcl │ ├── BT.badhost.tcl │ ├── BT.antirepeat.tcl │ ├── BT.antibadword.tcl │ ├── BT.inviteban.tcl │ ├── BT.badrealname.tcl │ ├── BT.noproxy.tcl │ ├── BT.antipub.tcl │ ├── BT.antibadtext.tcl │ ├── BT.antijoinflood.tcl │ ├── BT.antibadquitpart.tcl │ ├── BT.antispam.tcl │ └── BT.badnick.tcl ├── README │ ├── INSTALL.txt │ ├── FAQ.txt │ └── README.txt ├── Modules │ ├── BT.AntiTake.tcl │ ├── BT.Topic.tcl │ ├── BT.Timer.tcl │ ├── BT.GreetLeave.tcl │ ├── BT.CloneScan.tcl │ ├── BT.ChanLink.tcl │ ├── BT.Limit.tcl │ ├── BT.Private.tcl │ ├── BT.VoiceMe.tcl │ ├── BT.VoiceOnMsg.tcl │ ├── BT.Alias.tcl │ ├── BT.Idle.tcl │ ├── BT.Anunt.tcl │ ├── BT.TCL.tcl │ └── BT.Gag.tcl ├── Addons │ ├── github.tcl │ └── json.tcl ├── BT.Loader.tcl └── BT.Binds.tcl ├── ChangeLog └── README.txt /VERSION: -------------------------------------------------------------------------------- 1 | VERSION 2.5.5 2 | LAST MODIFIED 1618162992 3 | STATUS 0 4 | SIZE 78 5 | -------------------------------------------------------------------------------- /BlackTools/temp/banner: -------------------------------------------------------------------------------- 1 | Powered by 2 | 3 | 4 | ##\ ##\ ##\ ##\ ##\ 5 | ## | ## | ## | ## | ## | 6 | #######\ ## | ######\ #######\ ## | ##\ ######\ ######\ ######\ ## | #######\ 7 | ## __##\ ## | \____##\ ## _____|## | ## |\_## _| ## __##\ ## __##\ ## |## _____| 8 | ## | ## |## | ####### |## / ###### / ## | ## / ## |## / ## |## |\######\ 9 | ## | ## |## |## __## |## | ## _##< ## |##\ ## | ## |## | ## |## | \____##\ 10 | ####### |## |\####### |\#######\ ## | \##\ \#### |\###### |\###### |## |####### | 11 | \_______/ \__| \_______| \_______|\__| \__| \____/ \______/ \______/ \__|\_______/ 12 | 13 | 14 | www.TclScriptS.NeT ® The Next Generation TCL 15 | Copyright © 2008 - 2021 16 | -------------------------------------------------------------------------------- /BlackTools/lang/HowToAdd.txt: -------------------------------------------------------------------------------- 1 | ============================================================================================ 2 | -= BLaCkShaDoW Production Presents =- 3 | BlackTools - The Ultimate Channel Control Script 4 | One TCL. One smart Eggdrop 5 | ============================================================================================ 6 | 7 | The available languages are RO and EN. 8 | But you can easily add another language of your choice. 9 | 10 | The steps are: 11 | 12 | 1 - Create a tcl file in the lang folder with the name "BT..lang.tcl" 13 | For example we add the language "French" , so we create the file -> "BT.fr.lang.tcl" <- 14 | 15 | 2 - Now you have to translate the text from other language file that is available..into you language file. 16 | Remember, in the file we have the variables : black(say.ro.gl.noban). Here we have 17 | to modify for the language added (for example french) and we will have : black(say.fr.gl.noban). 18 | 19 | 3 - Rehash your BOT 20 | 21 | 4 - Type in the chan .myset lang fr 22 | 23 | 5 - And There you are, the french language is ready 24 | 25 | 6 - If you want to set the french language as default open the BlackTools.tcl and you will have 26 | 27 | #Default language ( RO / EN ) 28 | 29 | set black(default_lang) "RO" 30 | 31 | 7 - Set here 32 | 33 | set black(default_lang) "FR" 34 | 35 | 36 | Thats all folks :) 37 | 38 | ---------------------------------------------------------------------------------------------- 39 | Copyright (c) 2008-2018 Daniel Voipan (aka BLaCkShaDoW). 40 | ---------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- /BlackTools/lang/CumSaAdaugi.txt: -------------------------------------------------------------------------------- 1 | ============================================================================================ 2 | -= BLaCkShaDoW Production Presents =- 3 | BlackTools - The Ultimate Channel Control Script 4 | One TCL. One smart Eggdrop 5 | ============================================================================================ 6 | 7 | Limbile disponibile sunt RO si EN. 8 | Dar poti adauga dupa preferinta o alta limba 9 | 10 | Pasi de urmat: 11 | 12 | 1 - Creaza un fisier tip .tcl in folderul lang cu numele "BT..lang.tcl" 13 | De exemplu adaugam limba "franceza" , deci punem numele la fisier ""BT.fr.lang.tcl" 14 | 15 | 2 - Acum trebuie sa traducem textul dintr-o alta limba disponibila din folderul BlackTools/lang. 16 | De tinut minte, in cadrul fisierului avem variabile de genu : black(say.ro.gl.noban). Aici trebuie 17 | sa modificam pentru limba adaugata (spre exemplu franceza) si vom avea : black(say.fr.gl.noban). 18 | 19 | 3 - Dam rehash la Eggdrop 20 | 21 | 4 - Scriem pe canal .myset lang fr 22 | 23 | 5 - Si asta este, am integrat si activat limba franceza. 24 | 25 | 6 - Daca dorim sa facem limba franceza ca cea standard a scriptului deschidem BlackTOols.tcl si avem : 26 | 27 | #Default language ( RO / EN ) 28 | 29 | set black(default_lang) "RO" 30 | 31 | 7 - Setam aici 32 | 33 | set black(default_lang) "FR" 34 | 35 | 36 | Si cam atat :) 37 | 38 | ---------------------------------------------------------------------------------------------- 39 | Copyright (c) 2008-2018 Daniel Voipan (aka BLaCkShaDoW). 40 | ---------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- /BlackTools/temp/motd: -------------------------------------------------------------------------------- 1 | Connected to %B, running %V powered by 2 | 3 | 4 | ##\ ##\ ##\ ##\ ##\ 5 | ## | ## | ## | ## | ## | 6 | #######\ ## | ######\ #######\ ## | ##\ ######\ ######\ ######\ ## | #######\ 7 | ## __##\ ## | \____##\ ## _____|## | ## |\_## _| ## __##\ ## __##\ ## |## _____| 8 | ## | ## |## | ####### |## / ###### / ## | ## / ## |## / ## |## |\######\ 9 | ## | ## |## |## __## |## | ## _##< ## |##\ ## | ## |## | ## |## | \____##\ 10 | ####### |## |\####### |\#######\ ## | \##\ \#### |\###### |\###### |## |####### | 11 | \_______/ \__| \_______| \_______|\__| \__| \____/ \______/ \______/ \__|\_______/ 12 | 13 | 14 | www.TclScriptS.NeT ® The Next Generation TCL 15 | Copyright © 2008 - 2021 16 | 17 | Hey %b%N!%b My name is %b%B%b and I am running the %bBlackToolS 2.5.5%b Channel Control Script. 18 | 19 | +++ 'One TCL. One smart Eggdrop' 20 | 21 | Local time is now %b%T%b %{+nmo|MAOV} 22 | 23 | ** DCC commands start with '.' (like '.quit' or '.help') 24 | 25 | +++ Use %b.help%b for basic help. 26 | +++ Use %b.help all%b to get a full command list. 27 | +++ Use %b.help *somestring*%b to list any help texts containing "somestring". 28 | 29 | Don't Fuck anything up! 30 | 31 | +++ Remember, you can use %b!h%b in any channel that the bot is in to view the %bhelp manual%b from the BlackTools script. 32 | 33 | ** Support: 34 | wWw.TclScriptS.NeT or %bjoin #Tcl-Help%b on irc://irc.undernet.org/ 35 | 36 | ** Have fun _\|/_ 37 | 38 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antinotice.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ######################### ANTINOTICE 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 antinotice:protect {nick host hand arg chan} { 18 | global black botnick 19 | if {![validchan $chan]} { return } 20 | if {[setting:get $chan antinotice]} { 21 | set handle [nick2hand $nick] 22 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 23 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 24 | set bl_protect [blacktools:protect $nick $chan] 25 | if {$bl_protect == "1"} { return } 26 | if {[isbotnick $nick]} { return } 27 | if {[string equal -nocase $chan $botnick]} { return } 28 | blacktools:banner:1 $nick "ANTINOTICE" $chan $host [get:banmethod "antinotice" $chan] [link:chan:get $chan] 29 | } 30 | } 31 | 32 | ############## 33 | ######################################################################### 34 | ## END ## 35 | ######################################################################### 36 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antictcp.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################## ANTICTCP 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 antictcp:protect {nick host hand chan keyword arg} { 18 | global black botnick 19 | if {![validchan $chan]} { return } 20 | if {[setting:get $chan antictcp]} { 21 | set handle [nick2hand $nick] 22 | if {[string equal -nocase "action" $keyword] || [string equal -nocase "chat" $keyword]} {return} 23 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 24 | if {[matchattr $handle $black(exceptflags) $chan]} { return} 25 | set bl_protect [blacktools:protect $nick $chan] 26 | if {$bl_protect == "1"} { return } 27 | if {[isbotnick $nick]} { return } 28 | blacktools:banner:1 $nick "ANTICTCP" $chan $host [get:banmethod "antictcp" $chan] [link:chan:get $chan] 29 | } 30 | } 31 | 32 | ############## 33 | ######################################################################### 34 | ## END ## 35 | ######################################################################### 36 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antilongtext.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ######################## ANTILONGTEXT 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 antilongtext:protect {nick host hand chan arg} { 18 | global black botnick 19 | if {![validchan $chan]} { return } 20 | set handle [nick2hand $nick] 21 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 22 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 23 | set bl_protect [blacktools:protect $nick $chan] 24 | if {$bl_protect == "1"} { return } 25 | if {[isbotnick $nick]} { return } 26 | set getlongchar [setting:get $chan antilongtextmax] 27 | if {$getlongchar == ""} { set getlongchar "$black(longchar)" } 28 | if {[string length $arg] >= $getlongchar} { 29 | blacktools:banner:1 $nick "ANTILONGTEXT" $chan $host [get:banmethod "antilongtext" $chan] [link:chan:get $chan] 30 | return 1 31 | } 32 | } 33 | 34 | ############## 35 | ######################################################################### 36 | ## END ## 37 | ######################################################################### 38 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.repetitivechars.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ####################### RepetitiveChars 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 repetitivechars:protect {nick host hand chan arg} { 18 | global black 19 | if {![validchan $chan]} { return } 20 | set handle [nick2hand $nick] 21 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 22 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 23 | if {[isbotnick $nick]} { return } 24 | set bl_protect [blacktools:protect $nick $chan] 25 | if {$bl_protect == "1"} { return } 26 | set getnum [setting:get $chan repetitivechars-char] 27 | if {$getnum == ""} { set getnum "$black(repetitivechars:num)" } 28 | set llength_chars [string length $arg] 29 | set chars [split $arg ""] 30 | set counter 0 31 | set current_char "" 32 | for {set i 0 } { $i < $llength_chars } { set i [expr $i + 1] } { 33 | set char [lindex $chars $i] 34 | if {$current_char == ""} { 35 | set current_char $char 36 | set counter [expr $counter + 1] 37 | } else { 38 | if {$char != "$current_char"} { 39 | set current_char $char 40 | set counter 1 41 | } else { 42 | set counter [expr $counter + 1] 43 | } 44 | } 45 | } 46 | if {$counter >= $getnum} { 47 | blacktools:banner:1 $nick "repetitivechars" $chan $host [get:banmethod "repetitivechars" $chan] [link:chan:get $chan] 48 | return 1 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /BlackTools/README/INSTALL.txt: -------------------------------------------------------------------------------- 1 | ================================================================================ 2 | BlackTools - The Ultimate Channel Control Script 3 | One TCL. One smart Eggdrop 4 | ================================================================================ 5 | 6 | o Before starting with this script, please read the README and FAQ file :) 7 | Thank you for this. 8 | 9 | o gunzip and untar tar.gz file: 10 | some/where> tar xvzf BlackTools2.5.3.tar.gz 11 | OR 12 | some/where> gzip -d BlackTools2.5.3.tar.gz 13 | some/where> tar xvf BlackTools2.5.3.tar 14 | 15 | o Edit the BlackTools.tcl file. 16 | o Copy dir 'BlackTools/' into your 'scripts/' dir of your eggdrop 17 | (This is case sensitive!). 18 | cp BlackTools/ /home/of/your_eggdrop/scripts/ 19 | o Copy BlackTools.tcl file into your 'scripts/' directory: 20 | cp BlackTools.tcl /home/of/your_eggdrop/scripts/ 21 | o Add the following line at the end of your eggdrop config file: 22 | source scripts/BlackTools.tcl 23 | 24 | o Now restart your eggdrop and type .h (in any channel) to start using 25 | your eggdrop and to configure this script. 26 | Remember to use .man feature to learn about all functions and commands on 27 | how to use BlackTools. 28 | 29 | o WARNING!! USERS WHO USE BOTH A&A AND BLACKTOOLS SCRIPTS TOGETHER SHOULD 30 | KNOW THAT THIS WORKS IN THEORY. 31 | SO DON'T ASK ME FOR HELP FOR THIS SCRIPT IF YOU USE IT TOGETHER WITH A&A SCRIPT... 32 | 33 | o Read the MANUAL before asking me or saying: 'this script don't work ;)' 34 | 35 | o If you don't like this script, either live with the fact that not everything 36 | can be made perfectly the way you want it, or don't use it. 37 | 38 | o Otherwise if you have any problem with this script or if you find a bug, post 39 | on tclscripts.net forum an explanation of the problem/bug. You can also meet 40 | me on IRC on #TCL-HELP (On UnderNet of course). 41 | 42 | -------------------------------------------------------------------------------- 43 | BlackTools - The Ultimate Channel Control Script. 44 | Copyright (c) 2008-2018 Daniel Voipan (aka BLaCkShaDoW). 45 | -------------------------------------------------------------------------------- 46 | -------------------------------------------------------------------------------- /BlackTools/lang/loader.tcl: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | # _ _ _ _ _ _ _ _ _ _ _ _ _ _ #### 3 | # / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ # 4 | # ( T | C | L | S | C | R | I | P | T | S | . | N | E | T ) # 5 | # \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ # 6 | # # 7 | ############### # 8 | ################################################################# 9 | # 10 | ##### LANGUAGE MODULE 11 | ### This is the language loader for BlackTools.tcl 12 | # 13 | ### Provides replies/notices in diff languages. 14 | ### The default lang can be set in BlackTools.tcl 15 | # 16 | ## 1 - Romanian 17 | ## 2 - English 18 | ## 3 - Italian (not available) 19 | ## 4 - Spanish (not available) 20 | ## 5 - French (not available) 21 | # ############### 22 | ################################################################# 23 | 24 | if {[info exists black(backup_update)]} { 25 | set black(backdir) $black(backup_dir) 26 | } else { 27 | set black(backdir) $black(dirname) 28 | } 29 | 30 | #load language 31 | 32 | set get_lang_files [glob -directory "$black(backdir)/BlackTools/lang" "*.??.lang.tcl"] 33 | foreach lang $get_lang_files { 34 | set black(lang_error_$lang) [catch {source $lang} black(lang_error_stats_$lang)] 35 | if {$black(lang_error_$lang) == "1"} { 36 | putlog "\[BT\] :Couldn't load the lang file \"$lang\".Reason: \"$black(lang_error_stats_$lang)\"" 37 | } else { 38 | set split_lang [split $lang "."] 39 | set the_lang [lindex $split_lang 1] 40 | lappend black(current_lang) [join $the_lang ","] 41 | } 42 | 43 | if {![info exists black(current_lang) ]} {set black(current_lang) "N/A"} 44 | 45 | } 46 | 47 | #load manual 48 | 49 | set get_man_files [glob -directory "$black(backdir)/BlackTools/lang" "*.???-??.lang.tcl"] 50 | foreach lang $get_man_files { 51 | set black(man_error_$lang) [catch {source $lang} black(man_error_stats_$lang)] 52 | if {$black(man_error_$lang) == "1"} { 53 | putlog "\[BT\] :Couldn't load the manual file \"$lang\".Reason: \"$black(man_error_stats_$lang)\"" 54 | } 55 | } 56 | 57 | ############### 58 | ################################################################# 59 | # END # 60 | ################################################################# -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antichanflood.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ####################### ANTICHANFLOOD 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 antifloodchan:protect {nick host hand chan arg} { 18 | global black 19 | if {![validchan $chan]} { return } 20 | set handle [nick2hand $nick] 21 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 22 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 23 | if {[isbotnick $nick]} { return } 24 | set bl_protect [blacktools:protect $nick $chan] 25 | if {$bl_protect == "1"} { return } 26 | set getset [setting:get $chan chanflood] 27 | if {$getset == ""} { set getset "$black(antichanfloodrepeats)" } 28 | set number [scan $getset %\[^:\]] 29 | set time [scan $getset %*\[^:\]:%s] 30 | if {![info exists black(repeat:$host:$chan:flood)]} { 31 | set black(repeat:$host:$chan:flood) 0 32 | } 33 | foreach tmr [utimers] { 34 | if {[string match "*chanflood:unset $host $chan*" [join [lindex $tmr 1]]]} { 35 | killutimer [lindex $tmr 2] 36 | } 37 | } 38 | incr black(repeat:$host:$chan:flood) 39 | utimer $time [list chanflood:unset $host $chan] 40 | if {$black(repeat:$host:$chan:flood) >= $number} { 41 | blacktools:banner:1 $nick "ANTICHANFLOOD" $chan $host [get:banmethod "antichanflood" $chan] [link:chan:get $chan] 42 | chanflood:unset $host $chan 43 | return 1 44 | } 45 | } 46 | 47 | proc chanflood:unset {host chan} { 48 | global black 49 | if {[info exists black(repeat:$host:$chan:flood)]} { 50 | unset black(repeat:$host:$chan:flood) 51 | } 52 | } 53 | 54 | ############## 55 | ######################################################################### 56 | ## END ## 57 | ######################################################################### 58 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.AntiTake.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################## ANTITAKE 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 dontdeoppublic {nick host hand chan args} { 18 | global black botnick 19 | set dnick [lindex $args 1] 20 | set handle [nick2hand $nick] 21 | if {[setting:get $chan dontdeop] } { 22 | if {[string match -nocase $nick $botnick]} { 23 | return 24 | } 25 | if {![matchattr $handle $black(exceptflags) $chan]} { 26 | putquick "MODE $chan -o $nick" 27 | putquick "MODE $chan +o $dnick" 28 | set getlang [string tolower [setting:get $chan lang]] 29 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 30 | set text [black:color:set "" $black(say.$getlang.antitake.1)] 31 | set text [join $text] 32 | puthelp "NOTICE $nick :$text" 33 | } 34 | } 35 | } 36 | 37 | proc dontoppublic {nick host hand chan args} { 38 | global black botnick 39 | set onick [lindex $args 1] 40 | set handle [nick2hand $nick] 41 | if {[setting:get $chan dontop]} { 42 | if {[string match -nocase $nick $botnick]} { 43 | return 44 | } 45 | if {[string match -nocase $onick $botnick]} { 46 | return 47 | } 48 | if {![matchattr $handle $black(exceptflags) $chan]} { 49 | putquick "MODE $chan -o $nick" 50 | putquick "MODE $chan -o $onick" 51 | set getlang [string tolower [setting:get $chan lang]] 52 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 53 | set text [black:color:set "" $black(say.$getlang.antitake.2)] 54 | set text [join $text] 55 | puthelp "NOTICE $nick :$text" 56 | } 57 | } 58 | } 59 | 60 | ############## 61 | ######################################################################### 62 | ## END ## 63 | ######################################################################### 64 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.nickflood.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################## NICKFLOOD 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 nickflood:protect {nick host hand chan arg} { 18 | global black 19 | if {![validchan $chan]} { return } 20 | if {[setting:get $chan nickflood]} { 21 | set handle [nick2hand $nick] 22 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 23 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 24 | if {[isbotnick $nick]} { return } 25 | set bl_protect [blacktools:protect $nick $chan] 26 | if {$bl_protect == "1"} { return } 27 | set getset [setting:get $chan nickflood-repeat] 28 | if {$getset == ""} { set getset "$black(nickfloodrepeats)" } 29 | set number [scan $getset %\[^:\]] 30 | set time [scan $getset %*\[^:\]:%s] 31 | if {![info exists black(nick:$host:$chan:flood)]} { 32 | set black(nick:$host:$chan:flood) 0 33 | } 34 | foreach tmr [utimers] { 35 | if {[string match "*nickflood:unset $host $chan*" [join [lindex $tmr 1]]]} { 36 | killutimer [lindex $tmr 2] 37 | } 38 | } 39 | incr black(nick:$host:$chan:flood) 40 | utimer $time [list nickflood:unset $host $chan] 41 | if {$black(nick:$host:$chan:flood) >= $number} { 42 | blacktools:banner:1 $nick "NICKFLOOD:$arg" $chan $host [get:banmethod "nickflood" $chan] [link:chan:get $chan] 43 | nickflood:unset $host $chan 44 | } 45 | } 46 | } 47 | 48 | 49 | proc nickflood:unset {host chan} { 50 | global black 51 | foreach tmr [utimers] { 52 | if {[string match "*nickflood:unset $host $chan*" [join [lindex $tmr 1]]]} { 53 | killutimer [lindex $tmr 2] 54 | } 55 | } 56 | if {[info exists black(nick:$host:$chan:flood)]} { 57 | unset black(nick:$host:$chan:flood) 58 | } 59 | } 60 | 61 | ############## 62 | ######################################################################### 63 | ## END ## 64 | ######################################################################### 65 | -------------------------------------------------------------------------------- /BlackTools/Addons/github.tcl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env tclsh 2 | # file github/github.tcl 3 | #https://wiki.tcl-lang.org/page/github%3A%3Agithub 4 | # 5 | #Version 1.1 - added a timer in seconds between files & folders 6 | 7 | # chicken and egg problem we need non-standard packages tls and json ... 8 | package require tls 9 | package require http 10 | ::http::register https 443 ::tls::socket 11 | 12 | namespace eval ::github { 13 | variable libdir [file normalize [file join [file dirname [info script]] ..]] 14 | if {[lsearch $::auto_path $libdir] == -1} { 15 | lappend auto_path $libdir 16 | } 17 | } 18 | 19 | # I already placed the json folder below of the github folder 20 | package require json 21 | package provide github::github 0.2 22 | package provide github 0.2 23 | 24 | # Tcl package download 25 | proc ::github::github {cmd owner repo folder} { 26 | variable libdir 27 | set url https://api.github.com/repos/$owner/$repo/contents/ 28 | download $url $folder 29 | } 30 | 31 | # Folder download 32 | proc ::github::download {url folder {debug true}} { 33 | if {![file exists $folder]} { 34 | file mkdir $folder 35 | } 36 | set sfiles "" 37 | set dfiles "" 38 | set data [http::data [http::geturl $url]] 39 | set d [json::json2dict $data] 40 | set l [llength $d] 41 | set files [list] 42 | for {set i 0} {$i < $l} {incr i 1} { 43 | set dic [dict create {*}[lindex $d $i]] 44 | set file [dict get $dic download_url] 45 | set type [dict get $dic type] 46 | if {$file eq "null" && $type eq "dir"} { 47 | set file [dict get $dic url] 48 | set file [regsub {.ref=master} $file ""] 49 | } 50 | if {$type eq "file"} { 51 | lappend sfiles $file 52 | } else { 53 | lappend dfiles $file 54 | } 55 | } 56 | if {$sfiles != ""} { 57 | files $sfiles $folder 0 $dfiles 58 | return 59 | } 60 | if {$dfiles != ""} { 61 | dirs $dfiles $folder 0 62 | } 63 | } 64 | 65 | # Folders make 66 | proc ::github::dirs {dirs dir num} { 67 | set file [lindex $dirs $num] 68 | set nfolder [file join $dir [file tail $file]] 69 | download $file $nfolder 70 | set counter [expr $num + 1] 71 | if {[lindex $dirs $counter] != ""} { 72 | utimer 2 [list ::github::dirs $dirs $dir $counter] 73 | } 74 | } 75 | 76 | # Files make 77 | proc ::github::files {files dir num dirs} { 78 | set item [lindex $files $num] 79 | set file [lindex $item 0] 80 | set fname [file tail $file] 81 | set fname [file join $dir $fname] 82 | set f [open $fname w] 83 | fconfigure $f -translation binary 84 | set tok [http::geturl $file -channel $f] 85 | set Stat [::http::status $tok] 86 | flush $f 87 | close $f 88 | http::cleanup $tok 89 | set counter [expr $num + 1] 90 | if {[lindex $files $counter] != ""} { 91 | utimer 2 [list ::github::files $files $dir $counter $dirs] 92 | } else { 93 | if {$dirs != ""} { 94 | dirs $dirs $dir 0 95 | } 96 | } 97 | } 98 | 99 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.badident.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################## BADIDENT 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 badident:protect:join {nick host hand chan} { 18 | global black botnick 19 | set found_ident "" 20 | if {![validchan $chan]} { return } 21 | if {[setting:get $chan badident]} { 22 | set chan1 $chan 23 | if {[matchattr $hand $black(exceptflags) $chan]} { return } 24 | set bl_protect [blacktools:protect $nick $chan] 25 | if {$bl_protect == "1"} { return } 26 | set ident "[string map {"~" ""} [string tolower [lindex [split $host "@"] 0]]]" 27 | set text [check:except $ident $chan $black(badidentwords) $black(badidentexcept) "BADIDENT"] 28 | set check_word [check:file:word $chan $text "BADIDENT"] 29 | if {$check_word != ""} { 30 | set found_ident $check_word 31 | } 32 | if {$found_ident != ""} { 33 | blacktools:banner:2 $nick "BADIDENT:$found_ident" $chan $chan1 $host "0" "" 34 | if {[link:status $chan] == "1"} { 35 | foreach c [link:chan:get $chan] { 36 | blacktools:banner:2 $nick "BADIDENT:$found_ident" $c $c $host "1" "" 37 | } 38 | blacktools:link_ban2 [link:get] 0 39 | } else { who:chan $chan } 40 | } 41 | } 42 | } 43 | 44 | proc badident:module {nick host hand chan arg} { 45 | global black lastbind 46 | set type 0 47 | set chan1 "$chan" 48 | set why [lindex [split $arg] 0] 49 | set badi [join [lrange [split $arg] 1 end]] 50 | set number [lindex [split $arg] 1] 51 | if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} { 52 | set chan "$why" 53 | set why [lindex [split $arg] 1] 54 | set badi [join [lrange [split $arg] 2 end]] 55 | set number [lindex [split $arg] 2] 56 | } 57 | set return [blacktools:mychar $lastbind $hand] 58 | if {$return == "0"} { 59 | return 60 | } 61 | prot:module:process $nick $host $hand $chan $chan1 $why $badi $type $number "badident" 62 | } 63 | 64 | ############## 65 | ######################################################################### 66 | ## END ## 67 | ######################################################################### 68 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.badhost.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################## BADHOST 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 badhost:protect {nick host hand chan} { 18 | global black botnick 19 | set uhost [lindex [split $host @] 1] 20 | set chan1 $chan 21 | set found_bad "" 22 | if {![validchan $chan]} { return } 23 | if {[setting:get $chan badhost]} { 24 | if {[matchattr $hand $black(exceptflags) $chan]} { return } 25 | set bl_protect [blacktools:protect $nick $chan] 26 | if {$bl_protect == "1"} { return } 27 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 28 | set gethost [check:except $uhost $chan $black(badhostword) $black(badhostexcept) "BADHOST"] 29 | set check_word [check:file:word $chan $gethost "BADHOST"] 30 | if {$check_word != ""} { 31 | set found_bad $check_word 32 | } 33 | if {$found_bad != ""} { 34 | blacktools:banner:2 $nick "BADHOST:$found_bad" $chan $chan1 $host "0" "" 35 | if {[link:status $chan] == "1"} { 36 | foreach c [link:chan:get $chan] { 37 | blacktools:banner:2 $nick "BADHOST:$found_bad" $c $c $host "1" "" 38 | } 39 | blacktools:link_ban2 [link:get] 0 40 | } else { who:chan $chan } 41 | } 42 | } 43 | } 44 | 45 | proc badhost:module {nick host hand chan arg} { 46 | global black lastbind 47 | set type 0 48 | set chan1 "$chan" 49 | set why [lindex [split $arg] 0] 50 | set badh [join [lrange [split $arg] 1 end]] 51 | set number [lindex [split $arg] 1] 52 | if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} { 53 | set chan "$why" 54 | set why [lindex [split $arg] 1] 55 | set badh [join [lrange [split $arg] 2 end]] 56 | set number [lindex [split $arg] 2] 57 | } 58 | set return [blacktools:mychar $lastbind $hand] 59 | if {$return == "0"} { 60 | return 61 | } 62 | prot:module:process $nick $host $hand $chan $chan1 $why $badh $type $number "badhost" 63 | } 64 | 65 | ############## 66 | ######################################################################### 67 | ## END ## 68 | ######################################################################### 69 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antirepeat.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ######################## ANTIREPEAT 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 antirepeat:protect {nick host hand chan arg} { 18 | global black botnick 19 | set arg [color:filter [join [split $arg]]] 20 | set handle [nick2hand $nick] 21 | if {![validchan $chan]} { return } 22 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 23 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 24 | set bl_protect [blacktools:protect $nick $chan] 25 | if {$bl_protect == "1"} { return } 26 | if {[isbotnick $nick]} { return } 27 | set repeatset [setting:get $chan antirepeat-setting] 28 | if {$repeatset == ""} { set repeatset "$black(antirepeat:repeats)" } 29 | set number [scan $repeatset %\[^:\]] 30 | set time [scan $repeatset %*\[^:\]:%s] 31 | foreach tmr [utimers] { 32 | if {[string match "*antirepeat:remove $host $chan $arg*" [join [lindex $tmr 1]]]} { 33 | killutimer [lindex $tmr 2] 34 | } 35 | } 36 | 37 | if {![info exists black(repeat:$host:$chan:$arg)]} { 38 | set black(repeat:$host:$chan:$arg) 0 39 | } 40 | incr black(repeat:$host:$chan:$arg) 41 | utimer $time [list antirepeat:remove $host $chan $arg] 42 | 43 | if {$black(repeat:$host:$chan:$arg) >= $number} { 44 | blacktools:banner:1 $nick "ANTIREPEAT" $chan $host [get:banmethod "antirepeat" $chan] [link:chan:get $chan] 45 | antirepeat:remove $host $chan $arg 46 | return 1 47 | } 48 | } 49 | 50 | proc antirepeat:remove {host chan arg} { 51 | global black 52 | 53 | foreach tmr [utimers] { 54 | if {[string match "*antirepeat:remove $host $chan $arg*" [join [lindex $tmr 1]]]} { 55 | killutimer [lindex $tmr 2] 56 | } 57 | } 58 | 59 | if {[info exists black(repeat:$host:$chan:$arg)]} { 60 | unset black(repeat:$host:$chan:$arg) 61 | } 62 | } 63 | 64 | proc antirepeat:protect:me {nick host hand chan keyword arg} { 65 | antirepeat:protect $nick $host $hand $chan $arg 66 | } 67 | 68 | ############## 69 | ######################################################################### 70 | ## END ## 71 | ######################################################################### 72 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antibadword.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ######################## ANTIBADWORD 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 antibadword:protect {nick host hand chan arg} { 18 | global black botnick username 19 | if {![validchan $chan]} { return } 20 | set handle [nick2hand $nick] 21 | set found_word "" 22 | set text [color:filter [split $arg]] 23 | set split_check "" 24 | set get_pers "" 25 | if {![validchan $chan]} { return } 26 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 27 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 28 | set bl_protect [blacktools:protect $nick $chan] 29 | if {$bl_protect == "1"} { return } 30 | if {[isbotnick $nick]} { return } 31 | set text [check:except $text $chan $black(antibadword) $black(except_badwords) "BADWORD"] 32 | set check_word [check:file:word $chan $text "BADWORD"] 33 | if {$check_word != ""} { 34 | if {[regexp {[:]} $check_word]} { 35 | set split_check [split $check_word ":"] 36 | set check_word [join [lindex $split_check 0]] 37 | set get_pers [lindex $split_check 1] 38 | } 39 | if {$get_pers != ""} { 40 | blacktools:banner:1 $nick "ANTIBADWORD:$check_word" $chan $host [get:banmethod "antibadword:$get_pers" $chan] [link:chan:get $chan] 41 | } else { 42 | blacktools:banner:1 $nick "ANTIBADWORD:$check_word" $chan $host [get:banmethod "antibadword" $chan] [link:chan:get $chan] 43 | } 44 | return 1 45 | } 46 | } 47 | 48 | proc badword:module {nick host hand chan arg} { 49 | global black lastbind 50 | set type 0 51 | set chan1 "$chan" 52 | set why [lindex [split $arg] 0] 53 | set badw [join [lrange [split $arg] 1 end]] 54 | set number [lindex [split $arg] 1] 55 | if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} { 56 | set chan "$why" 57 | set why [lindex [split $arg] 1] 58 | set badw [join [lrange [split $arg] 2 end]] 59 | set number [lindex [split $arg] 2] 60 | } 61 | set return [blacktools:mychar $lastbind $hand] 62 | if {$return == "0"} { 63 | return 64 | } 65 | prot:module:process $nick $host $hand $chan $chan1 $why $badw $type $number "badword" 66 | } 67 | 68 | ############## 69 | ######################################################################### 70 | ## END ## 71 | ######################################################################### 72 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.inviteban.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################## INVITEBAN 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 inviteban:protect {from type arg} { 18 | global black 19 | set invitechan [lindex [split $arg] 1] 20 | set ::invitechan $invitechan 21 | if {[string match -nocase "*!*" $from]} { 22 | set split_from [split $from "!"] 23 | set from_nick [lindex [split $split_from] 0] 24 | if {[string equal -nocase $from_nick $black(chanserv)]} { 25 | return 26 | } 27 | putserv "USERHOST :$from_nick" 28 | bind RAW - 302 inviteban:gethost 29 | return 30 | } 31 | if {[string equal -nocase $from $black(chanserv)]} { 32 | return 33 | } 34 | putserv "USERHOST :$from" 35 | bind RAW - 302 inviteban:gethost 36 | } 37 | 38 | proc inviteban:gethost {from keyword arguments} { 39 | global black 40 | set invitechan $::invitechan 41 | set hostname [lindex [split $arguments] 1] 42 | set channels "" 43 | if {[regexp {\+} $hostname]} { 44 | set split_host [split $hostname "+"] 45 | } else { 46 | set split_host [split $hostname "-"] 47 | } 48 | set mask [lindex $split_host 1] 49 | set getnick [string map { 50 | "=" "" 51 | ":" "" 52 | } [lindex $split_host 0]] 53 | if {$getnick != ""} { 54 | foreach chan [channels] { 55 | set bl_protect [blacktools:protect $getnick $chan] 56 | if {$bl_protect == "1"} { continue } 57 | if {[matchattr [nick2hand $getnick] $black(exceptflags) $chan]} { 58 | continue 59 | } 60 | lappend channels $chan 61 | } 62 | } 63 | if {$channels != ""} { 64 | inviteban:act $channels 0 $mask $invitechan $getnick 65 | } 66 | check:if:bind "inviteban:gethost" "302" 67 | } 68 | 69 | proc inviteban:act {channels num mask invitechan nick} { 70 | global black 71 | set chan [join [lindex [split $channels] $num]] 72 | set inc 0 73 | if {$chan == ""} { 74 | return 75 | } 76 | if {[setting:get $chan inviteban]} { 77 | if {[onchan $nick $chan]} { 78 | blacktools:banner:2 $nick "INVITEBAN:[encoding convertto utf-8 $invitechan]" $chan $chan $mask "0" "" 79 | who:chan $chan 80 | } 81 | } 82 | set inc [expr $num + 1] 83 | if {[lindex $channels $inc] != ""} { 84 | utimer 5 [list inviteban:act $channels $inc $mask $invitechan $nick] 85 | } 86 | } 87 | 88 | ############## 89 | ######################################################################### 90 | ## END ## 91 | ######################################################################### 92 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.badrealname.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ######################### BADREALNAME 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 badrealname:protect:join {nick host hand chan} { 18 | global botnick black 19 | set ::cchan $chan 20 | set ::nnick $nick 21 | set ::hhost $host 22 | set handle [nick2hand $nick] 23 | if {[setting:get $chan badrealname]} { 24 | if {[isbotnick $nick]} { 25 | return 26 | } 27 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 28 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 29 | if {[onchan $nick $chan]} { 30 | putquick "WHOIS $nick" 31 | bind RAW - 311 badrealname:protect 32 | } 33 | } 34 | } 35 | 36 | proc badrealname:protect { from keyword arguments } { 37 | global botnick black 38 | set chan $::cchan 39 | set nick $::nnick 40 | set host $::hhost 41 | set chan1 $chan 42 | set found_realname "" 43 | set fullname [string range [join [lrange [split $arguments] 5 end]] 1 end] 44 | set text [check:except $fullname $chan $black(badfwords) $black(badfexcept) "BADREALNAME"] 45 | set check_word [check:file:word $chan $text "badrealname"] 46 | if {$check_word != ""} { 47 | set found_realname $check_word 48 | } 49 | if {$found_realname != ""} { 50 | blacktools:banner:2 $nick "badrealname:$found_realname" $chan $chan1 $host "0" "" 51 | if {[link:status $chan] == "1"} { 52 | foreach c [link:chan:get $chan] { 53 | blacktools:banner:2 $nick "badrealname:$found_realname" $c $c $host "1" "" 54 | } 55 | blacktools:link_ban2 [link:get] 0 56 | } else { who:chan $chan } 57 | } 58 | unbind RAW - 311 badrealname:protect 59 | } 60 | 61 | proc badrealname:module {nick host hand chan arg} { 62 | global black lastbind 63 | set type 0 64 | set chan1 "$chan" 65 | set why [lindex [split $arg] 0] 66 | set badf [join [lrange [split $arg] 1 end]] 67 | set number [lindex [split $arg] 1] 68 | if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} { 69 | set chan "$why" 70 | set why [lindex [split $arg] 1] 71 | set badf [join [lrange [split $arg] 2 end]] 72 | set number [lindex [split $arg] 2] 73 | } 74 | set return [blacktools:mychar $lastbind $hand] 75 | if {$return == "0"} { 76 | return 77 | } 78 | prot:module:process $nick $host $hand $chan $chan1 $why $badf $type $number "badrealname" 79 | } 80 | 81 | ############## 82 | ######################################################################### 83 | ## END ## 84 | ######################################################################### 85 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.Topic.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ############################# TOPIC 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 topic:get {chan} { 18 | global black 19 | set getline "" 20 | set file [open $black(join_file) r] 21 | while {[gets $file line] != -1} { 22 | set read_modul [lindex [split $line] 0] 23 | set read_chan [lindex [split $line] 1] 24 | if {[string equal -nocase $read_modul "TOPIC"] && [string equal -nocase $chan $read_chan]} { 25 | set read_msg [join [lrange [split $line] 2 end]] 26 | set getline [encoding convertfrom utf-8 $read_msg] 27 | continue 28 | } 29 | } 30 | close $file 31 | return $getline 32 | } 33 | 34 | proc topic:autotopic {nick host hand chan} { 35 | global black 36 | if {![validchan $chan]} { return } 37 | if {[setting:get $chan autotopic]} { 38 | utimer 5 [list topic:join:act $chan] 39 | } 40 | } 41 | 42 | proc topic:join:act {chan} { 43 | global black 44 | if {![botisop $chan]} { 45 | return 46 | } 47 | set gettopic "" 48 | set file [open $black(join_file) r] 49 | while {[gets $file line] != -1} { 50 | set read_modul [lindex [split $line] 0] 51 | set read_chan [lindex [split $line] 1] 52 | if {[string equal -nocase $read_modul "topic"] && [string equal -nocase $chan $read_chan]} { 53 | set read_msg [lrange [split $line] 2 end] 54 | set gettopic [encoding convertfrom utf-8 $read_msg] 55 | } 56 | } 57 | close $file 58 | if {$gettopic != ""} { 59 | set chantopic [topic $chan] 60 | set url [join [setting:get $chan url]] 61 | if {$url != ""} { 62 | set chantopic [string map [list "($url)" ""] $chantopic] 63 | } 64 | if {![string equal -nocase [concat [color:filter $chantopic]] [concat [color:filter $gettopic]]]} { 65 | if {$url != ""} { 66 | putserv "TOPIC $chan :[join $gettopic] ($url)" 67 | } else { putserv "TOPIC $chan :[join $gettopic]" } 68 | } 69 | } 70 | } 71 | 72 | proc topic:return {chan} { 73 | global black 74 | set gettopic "" 75 | set file [open $black(join_file) r] 76 | while {[gets $file line] != -1} { 77 | set read_modul [lindex [split $line] 0] 78 | set read_chan [lindex [split $line] 1] 79 | if {[string equal -nocase $read_modul "topic"] && [string equal -nocase $chan $read_chan]} { 80 | set read_msg [lrange [split $line] 2 end] 81 | set gettopic [encoding convertfrom utf-8 $read_msg] 82 | } 83 | } 84 | close $file 85 | return $gettopic 86 | } 87 | 88 | ############## 89 | ######################################################################### 90 | ## END ## 91 | ######################################################################### 92 | -------------------------------------------------------------------------------- /BlackTools/README/FAQ.txt: -------------------------------------------------------------------------------- 1 | ================================================================================== 2 | -= BLaCkShaDoW Production Presents =- 3 | BlackTools - The Ultimate Channel Control Script 4 | One TCL. One smart Eggdrop 5 | ================================================================================== 6 | 7 | Frequently Asked Questions 8 | ============================== 9 | The best solution is often the most simple one 10 | 11 | 12 | ------------------------------------------------------------------------------ 13 | o I have just installed your script and restart my eggdrop, what I do now ? 14 | 15 | If you don't have set the eggdrop UnderNet's username in 16 | * BlackTools.tcl: 17 | set black(username) 18 | set black(password) 19 | * Verify with BlackTools.tcl 'scripts' folder if is the right one. 20 | * Now, you can run your eggdrop and use script: 21 | type .h in any channel to start using the script. 22 | * As a owner you can use the '.h' command to manage all the settings. 23 | By default script's protections and modules are disabled. 24 | 25 | ------------------------------------------------------------------------------ 26 | o What's happend when eggdrop received "Can't join (Banned) " message from 27 | IRC server ? 28 | 29 | When eggdrop can't join for any reason sends an invite request to X. 30 | (When someone is invited on a channel he can join even if he is banned, 31 | channel is invite only, is full or have a key). 32 | 33 | ----------------------------------------------------------------------------- 34 | o Whats does this message mean : "There was an error. Please check if your 35 | eggdrop config exists or if BlackTools.tcl is found in scripts directory" ? 36 | 37 | This message is an important warning. This means that one of global 38 | setting is empty and cause probably the script can't work. 39 | Please verify setting "scripts" directory from BlackTools.tcl. 40 | Please do what the script says :) and so verify global setting. 41 | 42 | ------------------------------------------------------------------------------ 43 | o What does this message mean : "Sorry $yournick, no help available on that" ? 44 | 45 | This means that the information you asked for is not a Blacktools command 46 | or setting, or there is simply no information about it. 47 | 48 | ------------------------------------------------------------------------------ 49 | o The script send me notes to inform me every time the eggdrop is banned or 50 | can't join a channel. How can I disable this ? 51 | 52 | Eggdrop sends those notes ONLY to global owner(s). You can enable/disable 53 | them by using the command: note 54 | 55 | ------------------------------------------------------------------------------ 56 | 57 | You can post your question to http://tclscripts.net forum in english or in romanian. 58 | 59 | We offer a lot of support for BlackTools - however you can also support us: 60 | 61 | Donations will help me to keep working on this project. 62 | 63 | ---------------------------------------------------------------------------------- 64 | BlackTools - The Ultimate Channel Control Script. 65 | Copyright (c) 2008-2018 Daniel Voipan (aka BLaCkShaDoW). 66 | ---------------------------------------------------------------------------------- 67 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.noproxy.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################### NoProxy 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 | ### 18 | proc noproxy:protect {nick host hand chan} { 19 | global black 20 | if {![validchan $chan]} { return } 21 | if {[setting:get $chan noproxy]} { 22 | if {[matchattr $hand $black(exceptflags) $chan]} { return } 23 | set bl_protect [blacktools:protect $nick $chan] 24 | if {$bl_protect == "1"} { return } 25 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 26 | set uhost [lindex [split $host @] 1] 27 | set is_except 0 28 | foreach ex $black(noproxy:excepts) { 29 | if {[string match -nocase $ex $uhost]} { 30 | set is_except 1 31 | } 32 | } 33 | if {$is_except == 1} {return} 34 | set check_proxy [blacktools:noproxy_data $uhost] 35 | if {$check_proxy == 0} {return} 36 | set isp [lindex $check_proxy 0] 37 | set proxy_status [lindex $check_proxy 1] 38 | if {$proxy_status == "false"} {return} 39 | blacktools:banner:2 $nick "noproxy" $chan $chan $host "0" [list $isp] 40 | if {[link:status $chan] == "1"} { 41 | foreach c [link:chan:get $chan] { 42 | blacktools:banner:2 $nick "noproxy" $c $c $host "1" [list $isp] 43 | } 44 | blacktools:link_ban2 [link:get] 0 45 | } else { who:chan $chan } 46 | } 47 | } 48 | 49 | ### 50 | proc blacktools:noproxy_data {host} { 51 | global black 52 | if {![info exists black(http_ok)]} { 53 | if {[catch {package require http} no_http] != 0} { 54 | source $black(backdir)/BlackTools/Addons/http.tcl 55 | package require http 56 | set black(http_ok) 1 57 | } else { 58 | set black(http_ok) 1 59 | } 60 | } 61 | set link "http://ip-api.com/json/${host}?fields=proxy,status,isp" 62 | set ipq [::http::config -useragent "lynx"] 63 | set ipq [::http::geturl "$link" -timeout 10000] 64 | set check_it [catch {set ipq [::http::geturl $link -timeout 3000]} error] 65 | if {$check_it == "1"} { return 0 } 66 | set data [::http::data $ipq] 67 | ::http::cleanup $ipq 68 | regexp -nocase {\"status\":\"(.+)\"} $data -> status 69 | regsub -all {\",(.*)} $status "" status 70 | if {$status != "success"} { 71 | return 0 72 | } 73 | set proxy_status "false" 74 | set isp "" 75 | regexp {"proxy":(.+)\}} $data -> proxy_status 76 | regsub {,(.*)} $proxy_status "" proxy_status 77 | regexp {"isp":\"(.+)\"} $data -> isp 78 | regsub {\",(.*)} $isp "" isp 79 | return [list $isp $proxy_status] 80 | } 81 | 82 | ############## 83 | ######################################################################### 84 | ## END ## 85 | ######################################################################### -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antipub.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################## ANTIPUB 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 antipub:protect {nick host hand chan arg} { 18 | global black botnick 19 | set text [color:filter [split $arg]] 20 | set found_pub 0 21 | set handle [nick2hand $nick] 22 | set found_pub "" 23 | set banword "" 24 | if {![validchan $chan]} { return } 25 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 26 | set bl_protect [blacktools:protect $nick $chan] 27 | if {$bl_protect == "1"} { return } 28 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 29 | set text [check:except $text $chan $black(antipubword) $black(antipubexcept) "ANTIPUB"] 30 | set check_word [check:file:word $chan $text "ANTIPUB"] 31 | if {$check_word != ""} { 32 | blacktools:banner:1 $nick "ANTIPUB:$check_word" $chan $host [get:banmethod "antipub" $chan] [link:chan:get $chan] 33 | return 1 34 | } 35 | } 36 | 37 | proc check:except {text chan type except prot} { 38 | global black 39 | set text [split $text] 40 | set counter_word 0 41 | set counter_except 0 42 | set found_it 0 43 | 44 | foreach ex $except { 45 | set position [lsearch -exact [string tolower $text] [string tolower $ex]] 46 | if {$position > -1} { 47 | set text [lreplace $text $position $position] 48 | } 49 | } 50 | set file [open $black(add_file) r] 51 | set size [file size $black(add_file)] 52 | set data [split [read $file $size] \n] 53 | close $file 54 | foreach line $data { 55 | if {$line != ""} { 56 | set channel [lindex [split $line] 0] 57 | set getype [lindex [split $line] 1] 58 | set link [join [lrange [split $line] 3 end]] 59 | foreach word $text { 60 | if {[string equal -nocase $channel $chan] && [string equal -nocase $getype $prot] && [regexp {^[+]} $link] && [string match -nocase [string map {"+" ""} $link] $word]} { 61 | set position [lsearch -exact [string tolower $text] [string tolower $word]] 62 | if {$position > -1} { 63 | set text [lreplace $text $position $position] 64 | } 65 | } 66 | } 67 | } 68 | } 69 | return $text 70 | } 71 | 72 | proc antipub:module {nick host hand chan arg} { 73 | global black lastbind 74 | set type 0 75 | set chan1 "$chan" 76 | set why [lindex [split $arg] 0] 77 | set except [join [lrange [split $arg] 1 end]] 78 | set number [lindex [split $arg] 1] 79 | if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} { 80 | set chan "$why" 81 | set why [lindex [split $arg] 1] 82 | set except [join [lrange [split $arg] 2 end]] 83 | set number [lindex [split $arg] 2] 84 | } 85 | set return [blacktools:mychar $lastbind $hand] 86 | if {$return == "0"} { 87 | return 88 | } 89 | prot:module:process $nick $host $hand $chan $chan1 $why $except $type $number "antipub" 90 | } 91 | 92 | ############## 93 | ######################################################################### 94 | ## END ## 95 | ######################################################################### 96 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antibadtext.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ######################## ANTIBADTEXT 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 | ############################# AntiColor ################################ 18 | 19 | proc colortext:process {nick host hand chan arg type} { 20 | global black 21 | if {![validchan $chan]} { return } 22 | set handle [nick2hand $nick] 23 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 24 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 25 | if {[isbotnick $nick]} { return } 26 | set bl_protect [blacktools:protect $nick $chan] 27 | if {$bl_protect == "1"} { return } 28 | switch $type { 29 | anticolor { 30 | set textfind "\003" 31 | } 32 | 33 | antibold { 34 | set textfind "\002" 35 | } 36 | 37 | antiunderline { 38 | set textfind "\037" 39 | } 40 | } 41 | if {$type == "anticolor" && $black(anticolor:specific_colors) != ""} { 42 | foreach c $black(anticolor:specific_colors) { 43 | if {[string match "*$c*" $arg]} { 44 | blacktools:banner:1 $nick [string toupper "$type"] $chan $host [get:banmethod $type $chan] [link:chan:get $chan] 45 | break 46 | } 47 | } 48 | return 49 | } 50 | if {[string match "*$textfind*" $arg]} { 51 | blacktools:banner:1 $nick [string toupper "$type"] $chan $host [get:banmethod $type $chan] [link:chan:get $chan] 52 | return 1 53 | } 54 | } 55 | 56 | proc anticolor:protect {nick host hand chan arg} { 57 | colortext:process $nick $host $hand $chan $arg "anticolor" 58 | } 59 | 60 | ############################# AntiBold ################################ 61 | 62 | proc antibold:protect {nick host hand chan arg} { 63 | colortext:process $nick $host $hand $chan $arg "antibold" 64 | } 65 | 66 | ############################ AntiUnderline ############################### 67 | 68 | proc antiunderline:protect {nick host hand chan arg} { 69 | colortext:process $nick $host $hand $chan $arg "antiunderline" 70 | } 71 | 72 | ############################## AntiCaps ################################# 73 | 74 | proc anticaps:protect {nick host hand chan arg} { 75 | global black botnick 76 | set handle [nick2hand $nick] 77 | set found_caps 0 78 | set argz [split $arg] 79 | if {![validchan $chan]} { return } 80 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 81 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 82 | set bl_protect [blacktools:protect $nick $chan] 83 | if {$bl_protect == "1"} { return } 84 | if {[isbotnick $nick]} { return } 85 | set caps($nick:$host) 0 86 | foreach a [split $arg] { 87 | if {[onchan $a $chan]} { 88 | set search [lsearch -exact $argz $a] 89 | set argz [lreplace $argz $search $search] 90 | } 91 | } 92 | foreach word [split $argz {}] { 93 | if [string match \[A-Z\] $word] { 94 | incr caps($nick:$host) 95 | } 96 | } 97 | 98 | if {$caps($nick:$host) == 0} { 99 | return 100 | } 101 | 102 | if {[string length $argz] < 20} {return} 103 | set capchar [string length $argz] 104 | if {[expr 100 * $caps($nick:$host) / $capchar] > $black(anticapscount)} { 105 | set found_caps 1 106 | } 107 | if {$found_caps == "1"} { 108 | blacktools:banner:1 $nick "ANTICAPS" $chan $host [get:banmethod "anticaps" $chan] [link:chan:get $chan] 109 | return 1 110 | } 111 | } 112 | 113 | 114 | ############## 115 | ######################################################################### 116 | ## END ## 117 | ######################################################################### 118 | -------------------------------------------------------------------------------- /BlackTools/BT.Loader.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################## LOADER 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 | if {[info exists black(backup_update)]} { 18 | set black(backdir) $black(backup_dir) 19 | } else { 20 | set black(backdir) $black(dirname) 21 | } 22 | 23 | if {[info exists black(update_disabled)]} { 24 | unset black(update_disabled) 25 | } 26 | 27 | #Load modules 28 | 29 | set modules_files [glob -directory "$black(backdir)/BlackTools/Modules/" "*.tcl"] 30 | foreach file $modules_files { 31 | set split_file [split $file "."] 32 | set themodule [lindex $split_file 1] 33 | set black(module_error_$themodule) [catch {source $file} black(module_error_stats_$themodule)] 34 | if {$black(module_error_$themodule) == "1"} { 35 | if {$themodule == "AutoUpdate"} { 36 | putlog "\[BT\] :Couldn't load the AutoUpdate module. Reason: $black(module_error_stats_$themodule)." 37 | set black(update_disabled) $black(module_error_stats_$themodule) 38 | continue 39 | } 40 | die "\[BT\] :Couldn't load the module file \"$file\".Reason: \"$black(module_error_stats_$themodule)\"" 41 | } 42 | } 43 | 44 | 45 | #Load cmds 46 | 47 | set cmds_files [glob -directory "$black(backdir)/BlackTools/Commands/" "*.tcl"] 48 | foreach file $cmds_files { 49 | set split_file [split $file "."] 50 | set themodule [lindex $split_file 1] 51 | set black(cmds_error_$themodule) [catch {source $file} black(cmds_error_stats_$themodule)] 52 | if {$black(cmds_error_$themodule) == "1"} { 53 | die "\[BT\] :Couldn't load the cmds file \"$file\".Reason: \"$black(cmds_error_stats_$themodule)\"" 54 | } 55 | } 56 | 57 | #Load protections 58 | 59 | set prot_files [glob -directory "$black(backdir)/BlackTools/Protections/" "*.tcl"] 60 | foreach file $prot_files { 61 | set split_file [split $file "."] 62 | set themodule [lindex $split_file 1] 63 | set black(prot_error_$themodule) [catch {source $file} black(prot_error_stats_$themodule)] 64 | if {$black(prot_error_$themodule) == "1"} { 65 | die "\[BT\] :Couldn't load the prot. file \"$file\".Reason: \"$black(prot_error_stats_$themodule)\"" 66 | } 67 | } 68 | 69 | #Load script files 70 | 71 | set black(timers_error) [catch {source $black(backdir)/BlackTools/BT.Timers.tcl} black(timers_error_stats)] 72 | set black(binds_error) [catch {source $black(backdir)/BlackTools/BT.Binds.tcl} black(binds_error_stats)] 73 | set black(ban_error) [catch {source $black(backdir)/BlackTools/BT.Ban.tcl} black(ban_error_stats)] 74 | set black(core_error) [catch {source $black(backdir)/BlackTools/BT.Core.tcl} black(core_error_stats)] 75 | set black(loader_error) [catch {source $black(backdir)/BlackTools/lang/loader.tcl} black(loader_error_stats)] 76 | 77 | #Check for errors in script files 78 | if {$black(timers_error) == "1"} { 79 | die "\[BT\] Error. Couldn't load the \"BT Timers\". Reason: \"$black(timers_error_stats)\"" 80 | } 81 | if {$black(binds_error) == "1"} { 82 | die "\[BT\] Error. Couldn't load the \"BT Binds\". Reason: \"$black(binds_error_stats)\"" 83 | } 84 | if {$black(core_error) == "1"} { 85 | die "\[BT\] Error. Couldn't load the \"BT Core\". Reason: \"$black(core_error_stats)\"" 86 | } 87 | if {$black(ban_error) == "1"} { 88 | die "\[BT\] Error. Couldn't load the \"BT Ban\". Reason: \"$black(ban_error_stats)\"" 89 | } 90 | if {$black(loader_error) == "1"} { 91 | die "\[BT\] Error. Couldn't load the \"BT Language\". Reason: \"$black(loader_error_stats)\"" 92 | } 93 | 94 | ################# 95 | ########################################################################### 96 | ## END ## 97 | ########################################################################### 98 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | * to implement X rejoin if not on channel [ pending ] 2 | * to implement "Excesive character protection" [ pending ] 3 | * to implement category TCL in witch you have all tcl and also .tcl info 4 | to get info like bind pub, flags, strings from that TCL. [ pending ] 5 | * to implement .update reinstall [ pending ] 6 | 2021-04-19 BLaCkShaDoW 7 | * implemented spanish language 8 | 2021-04-16 BLaCkShaDoW 9 | * small language manual correction for TopWords module 10 | * the command topwords now works for all users 11 | 2021-04-11 BLaCkShaDoW 12 | * small fixes related to VOTE module 13 | 2021-04-09 BLaCkShaDoW 14 | * implemented VOTE module 15 | * added a variable if you want the update process to stop completely 16 | * solved some minor bugs 17 | 2021-03-15 BLaCkShaDoW 18 | * removed guestnick module 19 | * solved small potentially bugs related to autoupdate. 20 | * solved issue related to quote, now you can choose if you want users with access 21 | or all to add quotes/list/remove. 22 | + restart required after this update. 23 | 2021-03-12 BLaCkShaDoW 24 | * solved NICKSERV login issue 25 | * solved update on/off issue 26 | 2021-03-10 BLaCkShaDoW 27 | * Added support for AutoUpdate in case there are more then 1 eggdrop on same archive. 28 | 2021-03-09 BLaCkShaDoW 29 | * no longer needs latest tls package. 30 | * added a setting that automatic restarts the eggdrop on autoupdate 31 | check if 'the update requires that'. For manual check, it will 32 | show a message that a restart is required to complete the update. 33 | 2021-03-08 BLaCkShaDoW 34 | * solved AutoUpdate issue for slower connections (when downloading from github) 35 | * removed some remaining old binds for badchan module 36 | * changed the bot 'private msg antiflood action' from silence +*!*@* to IGNORE *!*@* 37 | 2021-03-07 BLaCkShaDoW 38 | * now all commands work trough DCC by using .bt [#channel] [arguments] 39 | if ".myset mychan" is set you dont have to specify the channel 40 | * solved other minor bugs 41 | 2021-03-06 BLaCkShaDoW 42 | * added the posibility to add badchan by using REGEX, see .man badchan 43 | * modified the badchan working mode, now its faster and more safe 44 | * solved some bugs related to BADCHAN module 45 | 2021-03-05 BLaCkShaDoW 46 | * added antibotidle (see .man antibotidle) 47 | * added noproxy protection (see .man noproxy) 48 | * solved some other minor bugs 49 | 2021-03-04 BLaCkShaDoW 50 | * optimised the ban module to work more faster 51 | * added .banlist regex to to show only the regex added 52 | * added .sb -regex to check details of the regex added 53 | * added .ub -regex to remove the regex stored with .b -regex 54 | * added .b -regex in wich you can specify regex for !@/[realname]/[ban mask] 55 | (fields with [ ] are optional). To se available banmask use .man banmask. 56 | The regex is added in banlist and everyone who matches it will get banned (just chanban) 57 | * solved other minor bugs 58 | 2021-02-28 BLaCkShaDoW 59 | ? * add backchan alert when a "k", "w" is being made 60 | * solved issue related to .gag command. Users can specify any time 61 | they want no matter what is their access. 62 | * added 'change alias handle' in file when the user's handle is chander trough .chuser 63 | * added 'remove alias commands' from file on delete or autoexpire users 64 | * fixed 'remove notes, suspension' from files on autoexpire users 65 | 2021-02-27 BLaCkShaDoW 66 | * added a new module "Alias" that offers the posibility for the users 67 | to create their own personalized commands based on BT commands. For more info 68 | see .man alias 69 | * added a new module "AutoUpdate" that makes the eggdrop update itself 70 | to the latest version. For more info see .man AutoUpdate 71 | * solved issue related to Idle Module, the module was working when securemode 72 | was enabled and channel +mD. Now it waits until the channel is no longer +mD 73 | * added chanserv mass ban detector (trough X) that suspends the user that made 74 | the massban 75 | * added variable that enables or disables the DNS onjoin 76 | * solved an issue related to clonescan ban 77 | 78 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.Timer.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ############################# TIMER 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 timer:process {nick host hand chan chan1 cmd pid timer_args type} { 18 | global black 19 | set counter 0 20 | if {[matchattr $hand q]} { blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none 21 | return 22 | } 23 | if {[matchattr $hand -|q $chan]} { blacktools:tell $nick $host $hand $chan $chan1 gl.suspend none 24 | return 25 | } 26 | if {$cmd == ""} { 27 | switch $type { 28 | 0 { 29 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "timer" 30 | } 31 | 1 { 32 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "timer" 33 | } 34 | 2 { 35 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "timer" 36 | } 37 | } 38 | return 39 | } 40 | switch [string tolower $cmd] { 41 | list { 42 | blacktools:tell $nick $host $hand $chan $chan1 timer.1 none 43 | foreach tmr [timers] { 44 | set counter [expr $counter + 1] 45 | set time [lindex $tmr 0] 46 | set process [join [lindex $tmr 1]] 47 | set pid [lindex $tmr 2] 48 | blacktools:tell $nick $host $hand $chan $chan1 timer.2 "$counter $pid $time $process" 49 | } 50 | foreach tmr [utimers] { 51 | set counter [expr $counter + 1] 52 | set time [lindex $tmr 0] 53 | set process [join [lindex $tmr 1]] 54 | set pid [lindex $tmr 2] 55 | blacktools:tell $nick $host $hand $chan $chan1 timer.3 "$counter $pid $time $process" 56 | } 57 | blacktools:tell $nick $host $hand $chan $chan1 timer.4 none 58 | } 59 | 60 | kill { 61 | set found_pid 0 62 | if {$pid == ""} { 63 | switch $type { 64 | 0 { 65 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "timer" 66 | } 67 | 1 { 68 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "timer" 69 | } 70 | 2 { 71 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "timer" 72 | } 73 | } 74 | return 75 | } 76 | 77 | foreach tmr [timers] { 78 | set getpid [lindex $tmr 2] 79 | if {[string equal -nocase $getpid $pid]} { 80 | set found_pid 1 81 | killtimer $getpid 82 | break 83 | } 84 | } 85 | foreach tmr [utimers] { 86 | set getpid [lindex $tmr 2] 87 | if {[string equal -nocase $getpid $pid]} { 88 | set found_pid 1 89 | killutimer $getpid 90 | break 91 | } 92 | } 93 | if {$found_pid == "1"} { 94 | blacktools:tell $nick $host $hand $chan $chan1 timer.5 $pid 95 | } else { 96 | blacktools:tell $nick $host $hand $chan $chan1 timer.6 $pid 97 | } 98 | } 99 | start { 100 | set return_time [time_return_minute $pid] 101 | set found_timer 0 102 | if {$timer_args == "" || $return_time == "-1"} { 103 | switch $type { 104 | 0 { 105 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "timer" 106 | } 107 | 1 { 108 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "timer" 109 | } 110 | 2 { 111 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "timer" 112 | } 113 | } 114 | return 115 | } 116 | 117 | foreach tm [timers] { 118 | set process [join [lindex $tm 1]] 119 | if {[string equal -nocase $process [lindex [split $timer_args] 0]]} { 120 | set found_timer 1 121 | } 122 | } 123 | if {$found_timer == "1"} { 124 | blacktools:tell $nick $host $hand $chan $chan1 timer.8 none 125 | return 126 | } 127 | set check_timer [timer $return_time $timer_args] 128 | blacktools:tell $nick $host $hand $chan $chan1 timer.7 $check_timer 129 | } 130 | } 131 | } 132 | 133 | ############## 134 | ######################################################################### 135 | ## END ## 136 | ######################################################################### 137 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.GreetLeave.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ######################## GREET & LEAVE 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 greetpublic:join {nick host hand chan} { 18 | global black 19 | if {[setting:get $chan greet]} { 20 | if {[isbotnick $nick]} { return } 21 | if {[info exists black(turnOnFlood:$chan)]} { 22 | return 23 | } 24 | set getgreet "" 25 | set get_time [setting:get $chan jointime] 26 | if {$get_time == ""} { set jointime [unixtime] } 27 | set replace(%nick%) $nick 28 | set replace(%chan%) $chan 29 | set replace(%countchan%) $chan 30 | set replace(%count%) [setting:get $chan joincount] 31 | set replace(%time%) [clock format $get_time -format %D-%H:%M:%S] 32 | set greet_method [string toupper [setting:get $chan greet-method]] 33 | if {$greet_method == ""} { 34 | set greet_method $black(greet:method) 35 | } 36 | set file [open $black(join_file) r] 37 | while {[gets $file line] != -1} { 38 | set read_modul [lindex [split $line] 0] 39 | set read_chan [lindex [split $line] 1] 40 | set enc_chan [encoding convertfrom utf-8 $read_chan] 41 | if {[string equal -nocase $read_modul "greet"] && [string equal -nocase $chan $enc_chan]} { 42 | set read_msg [lrange [split $line] 2 end] 43 | set getgreet [encoding convertfrom utf-8 $read_msg] 44 | } 45 | } 46 | close $file 47 | if {$getgreet != ""} { 48 | set split_greet [split $getgreet "~"] 49 | foreach line $split_greet { 50 | set line [string map [array get replace] $line] 51 | if {$greet_method == "NOTICE"} { 52 | putserv "NOTICE $nick :[join $line]" 53 | } else { putserv "PRIVMSG $nick :[join $line]" } 54 | } 55 | } 56 | } 57 | } 58 | 59 | proc leavepublic:part {nick host hand chan args} { 60 | global black 61 | set number [scan $black(leaveflood) %\[^:\]] 62 | set time [scan $black(leaveflood) %*\[^:\]:%s] 63 | if {[isbotnick $nick]} { return } 64 | if {[setting:get $chan leave]} { 65 | if {[isbotnick $nick]} { return } 66 | set getleave "" 67 | foreach tmr [utimers] { 68 | if {[string match "*black(leaveflood:$chan)*" [join [lindex $tmr 1]]]} { 69 | killutimer [lindex $tmr 2] 70 | } 71 | } 72 | if {[info exists black(leavestopped:$chan)]} { 73 | return 74 | } 75 | 76 | if {![info exists black(leaveflood:$chan)]} { 77 | set black(leaveflood:$chan) 0 78 | } 79 | set black(leaveflood:$chan) [expr $black(leaveflood:$chan) + 1] 80 | utimer $time [list unset black(leaveflood:$chan)] 81 | 82 | if {$black(leaveflood:$chan) >= $number} { 83 | set black(leavestopped:$chan) 1 84 | utimer 60 [list unset black(leavestopped:$chan)] 85 | return 86 | } 87 | set replace(%nick%) $nick 88 | set replace(%chan%) $chan 89 | set leave_method [string toupper [setting:get $chan leave-method]] 90 | if {$leave_method == ""} { 91 | set leave_method "NOTICE" 92 | } 93 | set file [open $black(join_file) r] 94 | while {[gets $file line] != -1} { 95 | set read_modul [lindex [split $line] 0] 96 | set read_chan [lindex [split $line] 1] 97 | set enc_chan [encoding convertfrom utf-8 $read_chan] 98 | if {[string equal -nocase $read_modul "leave"] && [string equal -nocase $chan $enc_chan]} { 99 | set read_msg [lrange [split $line] 2 end] 100 | set getleave [encoding convertfrom utf-8 $read_msg] 101 | } 102 | } 103 | close $file 104 | if {$getleave != ""} { 105 | set split_leave [split $getleave "~"] 106 | foreach line $split_leave { 107 | set line [string map [array get replace] $line] 108 | if {$leave_method == "NOTICE"} { 109 | putserv "NOTICE $nick :[join $line]" 110 | } else { putserv "PRIVMSG $nick :[join $line]" } 111 | } 112 | } 113 | } 114 | } 115 | 116 | ############## 117 | ######################################################################### 118 | ## END ## 119 | ######################################################################### 120 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antijoinflood.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ####################### ANTIJOINFLOOD 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 joinflood:unlock {chan modes} { 18 | global black 19 | putquick "MODE $chan -$modes" 20 | if {[info exists black(floodjoin:on:$chan)]} { 21 | unset black(floodjoin:on:$chan) 22 | } 23 | } 24 | 25 | proc joinflood:unset {chan} { 26 | global black 27 | if {[info exists black(antijoinflood:$chan)]} { 28 | unset black(antijoinflood:$chan) 29 | } 30 | } 31 | 32 | proc joinflood:unset:host {chan host} { 33 | global black 34 | if {[info exists black(antijoinflood:$host:$chan)]} { 35 | unset black(antijoinflood:$host:$chan) 36 | } 37 | } 38 | 39 | proc joinflood:protect {nick host hand chan} { 40 | global black 41 | if {[setting:get $chan antijoinflood]} { 42 | if {[isbotnick $nick]} { return } 43 | set check_webchat [check:webchat $host] 44 | if {$check_webchat == "1"} { 45 | set ident [lindex [split $host "@"] 0] 46 | set host "*!$ident@*" 47 | } 48 | set user_getset [setting:get $chan antijoinflood-userset] 49 | set getset [setting:get $chan joinflood] 50 | if {$user_getset == ""} { set user_getset $black(antijoinflood_user_joins) } 51 | if {$getset == ""} { set getset $black(joinflood:protect) } 52 | set user_num [scan $user_getset %\[^:\]] 53 | set user_time [scan $user_getset %*\[^:\]:%s] 54 | set num [scan $getset %\[^:\]] 55 | set time [scan $getset %*\[^:\]:%s] 56 | set replace(%chan%) $chan 57 | 58 | if {![info exists black(floodjoin:on:$chan)]} { 59 | foreach tmr [utimers] { 60 | if {[string match "*joinflood:unset $chan*" [join [lindex $tmr 1]]]} { 61 | killutimer [lindex $tmr 2] 62 | } 63 | } 64 | if {![info exists black(antijoinflood:$chan)]} { 65 | set black(antijoinflood:$chan) 0 66 | } 67 | incr black(antijoinflood:$chan) 68 | utimer $time [list joinflood:unset $chan] 69 | if {$black(antijoinflood:$chan) >= "$num"} { 70 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 71 | set black(floodjoin:on:$chan) 1 72 | set modes [joinflood:getmodes $chan] 73 | if {$modes != ""} { 74 | putquick "MODE $chan +$modes" ; utimer $black(nomodetime) [list joinflood:unlock $chan $modes] 75 | } 76 | if {$black(fjoinhow) == "1"} { 77 | set getlang [string tolower [setting:get $chan lang]] 78 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 79 | set getmessage $black(say.$getlang.antijoinflood.2) 80 | set message [string map [array get replace] $getmessage] 81 | puthelp "NOTICE @$chan :$message" 82 | } 83 | } 84 | } 85 | foreach tmr [utimers] { 86 | if {[string match "*joinflood:unset:host $chan $host*" [join [lindex $tmr 1]]]} { 87 | killutimer [lindex $tmr 2] 88 | } 89 | } 90 | if {![info exists black(antijoinflood:$host:$chan)]} { 91 | set black(antijoinflood:$host:$chan) 0 92 | } 93 | incr black(antijoinflood:$host:$chan) 94 | utimer $user_time [list joinflood:unset:host $chan $host] 95 | if {$black(antijoinflood:$host:$chan) >= "$user_num"} { 96 | blacktools:banner:2 $nick "ANTIJOINFLOOD" $chan $chan $host "0" "" 97 | who:chan $chan 98 | if {[info exists black(antijoinflood:$host:$chan)]} { 99 | unset black(antijoinflood:$host:$chan) 100 | } 101 | } 102 | } 103 | } 104 | 105 | proc joinflood:getmodes {chan} { 106 | global black 107 | set current_modes [getchanmode $chan] 108 | set putmode "" 109 | set chanmodes [string map {"+" ""} [split [lindex $current_modes 0] ""]] 110 | foreach mod [split $black(modes) ""] { 111 | if {[lsearch $chanmodes $mod] < 0} { 112 | lappend putmode $mod 113 | } 114 | } 115 | return $putmode 116 | } 117 | 118 | ############## 119 | ######################################################################### 120 | ## END ## 121 | ######################################################################### 122 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.CloneScan.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################### CLONESCAN 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 scanner:process {nick host hand chan chan1 type} { 18 | global botnick black 19 | set cmd_status [btcmd:status $chan $hand "clonescan" 0] 20 | if {$cmd_status == "1"} { 21 | return 22 | } 23 | array set clones [list] 24 | if {$chan == ""} { 25 | switch $type { 26 | 0 { 27 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "clonescan" 28 | } 29 | 1 { 30 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "clonescan" 31 | } 32 | 2 { 33 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "clonescan" 34 | } 35 | } 36 | return 0 37 | } 38 | if {![validchan $chan]} { 39 | blacktools:tell $nick $host $hand $chan $chan1 gl.novalidchan none 40 | return 41 | } 42 | if {![onchan $botnick $chan]} { 43 | blacktools:tell $nick $host $hand $chan $chan1 gl.notonchan none 44 | return 45 | } 46 | blacktools:tell $nick $host $hand $chan $chan1 clonescan.11 none 47 | clonescan:act $chan $nick $host $hand $chan1 0 0 48 | } 49 | 50 | proc clonescan:timer {chans} { 51 | global black 52 | set type 1 53 | foreach chan $chans { 54 | if {[validchan $chan]} { 55 | lappend channels $chan 56 | } 57 | } 58 | if {$channels != ""} { 59 | clonescan:act $channels "nick" "" "" "chan1" $type 0 60 | } 61 | } 62 | 63 | proc clonescan:act {channels nick h hand chan1 type counter} { 64 | global black 65 | set chan [lindex $channels $counter] 66 | set cc [expr $counter + 1] 67 | set found_clones 0 68 | set found_mask "" 69 | set theclones "" 70 | array set clones [list] 71 | if {$chan != ""} { 72 | set replace(%chan%) $chan 73 | set getlang [string tolower [setting:get $chan lang]] 74 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 75 | if {[setting:get $chan clonescan-maxclone] == "0" || [setting:get $chan clonescan-maxclone] == ""} { 76 | set maxclone $black(maxclone) 77 | } else { set maxclone [setting:get $chan clonescan-maxclone] } 78 | if {$maxclone < "2"} { return } 79 | foreach user [chanlist $chan] { 80 | set host [string tolower [lindex [split [getchanhost $user $chan] @] 1]] 81 | set findword [prot:findword $chan "CLONESCAN-EXCEPT" $host] 82 | if {$findword == "1"} { 83 | continue 84 | } 85 | if {[string match "*undernet.org*" $host]} { 86 | continue 87 | } 88 | 89 | set replace(%host%) $host 90 | lappend clones($host) $user 91 | } 92 | foreach clone [array names clones] { 93 | set userlist [join $clones($clone)] 94 | if {[llength [split $userlist]] >= $maxclone} { 95 | set found_clones 1 96 | lappend found_mask $clone 97 | lappend theclones $clones($clone) 98 | if {$type == "0"} { 99 | blacktools:tell $nick $h $hand $chan $chan1 clonescan.10 "[llength [split $userlist]] $clone [join $clones($clone) ", "]" 100 | } 101 | } 102 | } 103 | if {$found_clones == "1"} { 104 | if {$type == "1"} { 105 | set replace(%msg.1%) [llength [split $theclones]] 106 | set replace(%msg.2%) $found_mask 107 | set replace(%msg.7%) [join $theclones " ,"] 108 | set replace(%chan%) $chan 109 | set text [black:color:set "" $black(say.$getlang.clonescan.10)] 110 | set message [string map [array get replace] $text] 111 | putserv "NOTICE @$chan :$message" 112 | foreach m $found_mask { 113 | set mask "*!*@$m" 114 | blacktools:banner:2 $nick "CLONESCAN" $chan $chan1 $mask "0" "" 115 | } 116 | who:chan $chan 117 | } 118 | } 119 | } 120 | 121 | if {([lindex $channels $cc] != "") && ($type == "1")} { 122 | utimer 5 [list clonescan:act $channels $nick $h $hand $chan1 $type $cc] 123 | } 124 | if {($type == "0") && ($found_clones == "0")} { 125 | blacktools:tell $nick $h $hand $chan $chan1 clonescan.2 none 126 | } 127 | } 128 | 129 | ############## 130 | ######################################################################### 131 | ## END ## 132 | ######################################################################### 133 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.ChanLink.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################### CHANLINK 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 link:process {nick host hand chan chan1 type what channels delchan} { 18 | global black 19 | 20 | if {$what == ""} { 21 | switch $type { 22 | 0 { 23 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "link" 24 | } 25 | 1 { 26 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "link" 27 | } 28 | 2 { 29 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "link" 30 | } 31 | } 32 | } 33 | 34 | switch $what { 35 | 36 | list { 37 | set return [link:show] 38 | if {$return == "0"} { 39 | blacktools:tell $nick $host $hand $chan $chan1 chanlink.5 none 40 | return 41 | } 42 | blacktools:tell $nick $host $hand $chan $chan1 chanlink.3 [join $return] 43 | } 44 | 45 | reset { 46 | link:reset 47 | blacktools:tell $nick $host $hand $chan $chan1 chanlink.2 none 48 | } 49 | 50 | all { 51 | link:set $what 52 | blacktools:tell $nick $host $hand $chan $chan1 chanlink.4 none 53 | } 54 | 55 | del { 56 | if {![validchan $delchan]} { 57 | blacktools:tell $nick $host $hand $chan $chan1 gl.novalidchan none 58 | return 59 | } 60 | set return [link:del $delchan] 61 | if {$return == "1"} { 62 | blacktools:tell $nick $host $hand $chan $chan1 chanlink.7 $delchan 63 | } else { 64 | blacktools:tell $nick $host $hand $chan $chan1 chanlink.8 $delchan 65 | } 66 | } 67 | 68 | default { 69 | set return [link:set $channels] 70 | set split_return [split $return ":"] 71 | set validchan [lindex $split_return 0] 72 | set notvalid [lindex $split_return 1] 73 | if {$validchan != ""} { 74 | blacktools:tell $nick $host $hand $chan $chan1 chanlink.1 [join $validchan] 75 | } 76 | if {$notvalid != ""} { 77 | blacktools:tell $nick $host $hand $chan $chan1 chanlink.6 [join $notvalid] 78 | } 79 | } 80 | } 81 | } 82 | 83 | proc link:show {} { 84 | global black botnick 85 | set return [link:get] 86 | if {$return == ""} { 87 | return 0 88 | } 89 | return $return 90 | } 91 | 92 | proc link:set {channels} { 93 | global black botnick 94 | set validchan "" 95 | set notvalid "" 96 | if {[string equal -nocase $channels "all"]} { 97 | foreach chan [channels] { 98 | if {[setting:get $chan chanlink] == "0"} { 99 | setting:set $chan +chanlink "" 100 | } 101 | } 102 | return 1 103 | } 104 | foreach chan $channels { 105 | if {[validchan $chan]} { 106 | lappend validchan $chan 107 | if {[setting:get $chan chanlink] == "0"} { 108 | setting:set $chan +chanlink "" 109 | } 110 | } else { 111 | lappend notvalid $chan 112 | } 113 | } 114 | return "$validchan:$notvalid" 115 | } 116 | 117 | proc link:reset {} { 118 | global black botnick 119 | foreach chan [channels] { 120 | if {[setting:get $chan chanlink]} { 121 | setting:set $chan -chanlink "" 122 | } 123 | } 124 | } 125 | 126 | proc link:del {chan} { 127 | global black 128 | if {[setting:get $chan chanlink]} { 129 | setting:set $chan -chanlink "" 130 | return 1 131 | } else { 132 | return 0 133 | } 134 | } 135 | 136 | proc link:get {} { 137 | global black botnick 138 | set channels "" 139 | foreach chan [channels] { 140 | if {[setting:get $chan chanlink]} { 141 | lappend channels $chan 142 | } 143 | } 144 | return $channels 145 | } 146 | 147 | proc link:status {chan} { 148 | global black 149 | if {[setting:get $chan chanlink]} { 150 | return 1 151 | } else { 152 | return 0 153 | } 154 | } 155 | 156 | proc link:chan:get {readchan} { 157 | global black 158 | set channels "" 159 | set readchan [string tolower $readchan] 160 | if {[setting:get $readchan chanlink] == "0"} { 161 | return "" 162 | } 163 | foreach chan [string tolower [channels]] { 164 | if {[setting:get $chan chanlink]} { 165 | if {$readchan != $chan} { 166 | lappend channels $chan 167 | } 168 | } 169 | } 170 | return $channels 171 | } 172 | 173 | ############## 174 | ######################################################################### 175 | ## END ## 176 | ######################################################################### 177 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.Limit.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ############################# LIMIT TCL ############################# 6 | ######################################################################### 7 | ## ## 8 | ## BlackTools : http://blacktools.tclscripts.net ## 9 | ## Bugs report : http://www.tclscripts.net/ ## 10 | ## GitHub page : https://github.com/tclscripts/BlackToolS-TCL-script ## 11 | ## Online Help : irc://irc.undernet.org/tcl-help ## 12 | ## #TCL-HELP / UnderNet ## 13 | ## You can ask in english or romanian ## 14 | ## ## 15 | ######################################################################### 16 | 17 | proc limit:process {nick host hand chan chan1 why lm type} { 18 | global botnick black 19 | set cmd_status [btcmd:status $chan $hand "limit" 0] 20 | if {$cmd_status == "1"} { 21 | return 22 | } 23 | if {[matchattr $hand q]} { blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none 24 | return 25 | } 26 | if {[matchattr $hand -|q $chan]} { blacktools:tell $nick $host $hand $chan $chan1 gl.suspend none 27 | return 28 | } 29 | if {$why == ""} { 30 | switch $type { 31 | 0 { 32 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "limit" 33 | } 34 | 1 { 35 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "limit" 36 | } 37 | 2 { 38 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "limit" 39 | } 40 | } 41 | return 42 | } 43 | 44 | if {![validchan $chan]} { 45 | blacktools:tell $nick $host $hand $chan $chan1 gl.novalidchan none 46 | return 47 | } 48 | 49 | if {![onchan $botnick $chan]} { 50 | blacktools:tell $nick $host $hand $chan $chan1 gl.notonchan none 51 | return 52 | } 53 | set usersnum [llength [chanlist $chan]] 54 | 55 | switch [string tolower $why] { 56 | 57 | on { 58 | set limt [setting:get $chan limit-default] 59 | setting:set $chan +limit "" 60 | blacktools:tell $nick $host $hand $chan $chan1 limit.5 none 61 | if {[regexp {^[0-9]+$} $limt] && ($limt != "0")} { 62 | putserv "MODE $chan +l [expr $usersnum + $limt]" 63 | } else { 64 | putserv "MODE $chan +l [expr $usersnum + $black(limit:default)]" 65 | setting:set $chan limit-default $black(limit:default) 66 | blacktools:tell $nick $host $hand $chan $chan1 limit.6 $black(limit:default) 67 | } 68 | set black(limit:$chan:timer_start) 1 69 | } 70 | off { 71 | setting:set $chan -limit "" 72 | blacktools:tell $nick $host $hand $chan $chan1 limit.7 none 73 | putquick "MODE $chan -l" 74 | if {[info exists black(limit:$chan:timer_start)]} { 75 | unset black(limit:$chan:timer_start) 76 | } 77 | } 78 | 79 | set { 80 | if {![regexp {^[0-9]} $lm]} { 81 | if {$type == "0"} { 82 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "limit" 83 | } 84 | if {$type == "1"} { 85 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "limit" 86 | } 87 | return 88 | } 89 | if {$lm < 2} { blacktools:tell $nick $host $hand $chan $chan1 limit.9 none 90 | set lm [expr $lm + 1] 91 | setting:set $chan limit-default 2 92 | putserv "MODE $chan +l [expr $usersnum + $lm]" 93 | blacktools:tell $nick $host $hand $chan $chan1 limit.10 none 94 | return 95 | } 96 | if {$lm > 500} { blacktools:tell $nick $host $hand $chan $chan1 limit.11 none 97 | return 98 | } 99 | setting:set $chan limit-default $lm 100 | blacktools:tell $nick $host $hand $chan $chan1 limit.12 $lm 101 | putserv "MODE $chan +l [expr $usersnum + $lm]" 102 | } 103 | } 104 | } 105 | 106 | proc limit:timer {chans} { 107 | global black 108 | set channels "" 109 | foreach chan $chans { 110 | lappend channels $chan 111 | } 112 | if {$channels != ""} { 113 | limit:act $channels 0 114 | } 115 | } 116 | 117 | proc limit:act {channels counter} { 118 | global black 119 | set chan [lindex $channels $counter] 120 | if {[botisop $chan]} { 121 | set usersnum [llength [chanlist $chan]] 122 | set setnum [setting:get $chan limit-default] 123 | if {$setnum == "0" || $setnum == ""} { set setnum $black(limit:default) } 124 | set limitcount [expr $usersnum + $setnum] 125 | set chanmode [getchanmode $chan] 126 | if {[string match "*l*" "$chanmode"]} { 127 | set lim [lindex $chanmode 1] 128 | } else { set lim 0} 129 | if {$lim != $limitcount} { 130 | if {$usersnum > $lim} { set dif [expr $usersnum - $lim] } else { set dif [expr $lim - $usersnum] } 131 | if {($dif >= $setnum) || ($dif <= $setnum)} { 132 | puthelp "MODE $chan +l $limitcount" 133 | } 134 | } 135 | } 136 | set cc [expr $counter + 1] 137 | if {[lindex $channels $cc] != ""} { 138 | utimer 5 [list limit:act $channels $cc] 139 | } 140 | } 141 | 142 | ############## 143 | ######################################################################### 144 | ## END ## 145 | ######################################################################### 146 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.Private.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################### PRIVATE 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 private:process {nick host hand chan chan1 why user shost type} { 18 | global botnick black 19 | set cmd_status [btcmd:status $chan $hand "private" 0] 20 | if {$cmd_status == "1"} { 21 | return 22 | } 23 | if {[matchattr $hand q]} { blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none 24 | return 25 | } 26 | if {[matchattr $hand -|q $chan]} { blacktools:tell $nick $host $hand $chan $chan1 gl.suspend none 27 | return 28 | } 29 | set flags "-|P" 30 | set cmd "private" 31 | set show_user $user 32 | 33 | if {$why == ""} { 34 | switch $type { 35 | 0 { 36 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "private" 37 | } 38 | 1 { 39 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "private" 40 | } 41 | 2 { 42 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "private" 43 | } 44 | } 45 | return 46 | } 47 | switch $why { 48 | 49 | add { 50 | if {($user == "") && ($type == "0")} { 51 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr $cmd 52 | return 53 | } 54 | if {($user == "") && ($type == "1")} { 55 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick $cmd 56 | return 57 | } 58 | if {[onchan $user $chan]} { 59 | set getuser [nick2hand $user] 60 | if {$getuser != "*"} { 61 | set user $getuser 62 | } 63 | } 64 | 65 | if {[validuser $user]} { 66 | if {[matchattr $user $flags $chan]} { 67 | blacktools:tell $nick $host $hand $chan $chan1 private.10 $show_user 68 | return 69 | } 70 | chattr $user $flags $chan 71 | blacktools:tell $nick $host $hand $chan $chan1 private.7 $show_user 72 | } else { 73 | if {[onchan $user $chan]} { 74 | set hosts [getchanhost $user $chan] 75 | set uhost [return_mask $black(hostdefaultadd) $hosts $user] 76 | if {[userlist] != ""} { 77 | foreach usr [userlist] { 78 | set hst [getuser $usr hosts] 79 | foreach hhost $hst { 80 | if {[string match -nocase $hhost $uhost] && (![string match -nocase $usr $user])} { 81 | blacktools:tell $nick $host $hand $chan $chan1 add.5 $usr 82 | set user $usr 83 | set show_user $usr 84 | } 85 | } 86 | } 87 | } 88 | } else {set uhost $shost} 89 | 90 | if {[validuser $user]} { 91 | chattr $user $flags $chan 92 | blacktools:tell $nick $host $hand $chan $chan1 private.7 $show_user 93 | return 94 | } 95 | if {$uhost == ""} { 96 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr $cmd 97 | return 0 98 | } 99 | adduser $user $uhost 100 | chattr $user $flags $chan 101 | blacktools:tell $nick $host $hand $chan $chan1 private.8 "$show_user $uhost" 102 | } 103 | } 104 | 105 | del { 106 | if {($user == "") && ($type == "0")} { 107 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr $cmd 108 | return 109 | } 110 | if {($user == "") && ($type == "1")} { 111 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick $cmd 112 | return 113 | } 114 | if {[onchan $user $chan]} { 115 | set getuser [nick2hand $user] 116 | if {$getuser != "*"} { 117 | set user $getuser 118 | } 119 | } 120 | 121 | if {[validuser $user]} { 122 | if {[matchattr $user $flags $chan]} { 123 | chattr $user -|-P $chan 124 | blacktools:tell $nick $host $hand $chan $chan1 private.9 $show_user 125 | } else { blacktools:tell $nick $host $hand $chan $chan1 private.6 $show_user 126 | } 127 | } else { blacktools:tell $nick $host $hand $chan $chan1 gl.nomem none } 128 | } 129 | 130 | list { 131 | set list [join [userlist $flags $chan]] 132 | if {$list == ""} { set list "NONE" } 133 | blacktools:tell $nick $host $hand $chan $chan1 private.11 none 134 | blacktools:tell $nick $host $hand $chan $chan1 private.5 $list 135 | } 136 | 137 | default { 138 | if {$type == "0"} { 139 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr $cmd 140 | return 141 | } 142 | if {$type == "1"} { 143 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick $cmd 144 | return 145 | } 146 | } 147 | } 148 | } 149 | 150 | proc private:module {nick host hand chan} { 151 | global black botnick 152 | set handle [nick2hand $nick] 153 | if {![validchan $chan]} { 154 | return 155 | } 156 | set chan1 $chan 157 | if {[setting:get $chan private]} { 158 | if {[matchattr $handle nmo|oMASOVP $chan]} { 159 | return 160 | } 161 | blacktools:banner:2 $nick "PRIVATE" $chan $chan1 $host "0" "" 162 | who:chan $chan 163 | } 164 | } 165 | 166 | ############## 167 | ######################################################################### 168 | ## END ## 169 | ######################################################################### 170 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.VoiceMe.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################### VOICEME 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 voiceme:join {nick host hand chan} { 18 | global black 19 | if {[isbotnick $nick]} { 20 | if {[setting:get $chan voiceme]} { 21 | utimer 30 [list voiceme:check:valid $chan] 22 | } 23 | } 24 | } 25 | 26 | proc voiceme:mode {nick host hand chan mod who} { 27 | global black 28 | if {[setting:get $chan voiceme]} { 29 | if {$mod == "+m"} { 30 | utimer 30 [list voiceme:check:valid $chan] 31 | } 32 | if {$mod == "-m"} { 33 | utimer 15 [list voiceme:check:nomod $chan] 34 | } 35 | } 36 | } 37 | 38 | proc voiceme:check:nomod {chan} { 39 | global black botnick 40 | set getlang [string tolower [setting:get $chan lang]] 41 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 42 | set chanmode [getchanmode $chan] 43 | if {[string match "*m*" $chanmode]} { 44 | return 45 | } 46 | if {[info exists black(voiceme:stat:$chan)]} { 47 | set replace(%chan%) $chan 48 | set replace(%botnick%) $botnick 49 | set text [black:color:set "" $black(say.$getlang.voiceme.2)] 50 | set text [join $text] 51 | puthelp "PRIVMSG $chan :[string map [array get replace] $text]" 52 | if {[info exists black(voiceme:stat:$chan)]} { 53 | unset black(voiceme:stat:$chan) 54 | } 55 | if {[info exists black(voiceme:$chan:timer_start)]} { 56 | unset black(voiceme:$chan:timer_start) 57 | } 58 | } 59 | } 60 | 61 | proc voiceme:get:time {chan} { 62 | global black 63 | if {[setting:get $chan voiceme-showtime] != ""} { 64 | set return_time [time_return_minute [setting:get $chan voiceme-showtime]] 65 | } else { 66 | set return_time [time_return_minute $black(voiceme:msgtime)] 67 | } 68 | return $return_time 69 | } 70 | 71 | proc voiceme:check:valid {chan} { 72 | global black botnick 73 | set found_timer 0 74 | set getlang [string tolower [setting:get $chan lang]] 75 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 76 | set replace(%chan%) $chan 77 | set replace(%botnick%) $botnick 78 | set replace(%chanserv%) $black(chanserv) 79 | set chanmode [getchanmode $chan] 80 | if {[info exists black(voiceme:stat:$chan)]} { 81 | return 82 | } 83 | if {[string match "*m*" $chanmode]} { 84 | set black(voiceme:stat:$chan) 1 85 | if {[setting:get $chan nologged]} { 86 | set text [black:color:set "" $black(say.$getlang.voiceme.6)] 87 | } else { 88 | set text [black:color:set "" $black(say.$getlang.voiceme.1)] 89 | } 90 | set text [join $text] 91 | puthelp "PRIVMSG $chan :[string map [array get replace] $text]" 92 | if {![info exists black(voiceme:$chan:timer_start)]} { 93 | set black(voiceme:$chan:timer_start) [voiceme:get:time $chan] 94 | } 95 | } 96 | } 97 | 98 | proc voiceme:showmsg_timer {chans} { 99 | global black botnick 100 | set found_entry 0 101 | set unixtime [unixtime] 102 | foreach chan $chans { 103 | if {[setting:get $chan voiceme]} { 104 | 105 | if {[info exists black(lastaction:$chan)]} { 106 | set total_anunt 0 107 | set unixtime [unixtime] 108 | if {[setting:get $chan voiceme-showtime] != ""} { 109 | set return_time [time_return_minute [setting:get $chan voiceme-showtime]] 110 | } else { 111 | set return_time [time_return_minute $black(voiceme:msgtime)] 112 | } 113 | set time [expr [expr [expr $return_time * $black(entry:shown)] * 60] + $unixtime] 114 | if {[expr $unixtime - $black(lastaction:$chan)] > [expr $time - $unixtime]} { 115 | continue 116 | } 117 | } else { continue } 118 | set getlang [string tolower [setting:get $chan lang]] 119 | set replace(%botnick%) $botnick 120 | set replace(%chanserv%) $black(chanserv) 121 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 122 | set replace(%chan%) $chan 123 | if {![info exists black(voiceme:stat:$chan)]} { 124 | continue 125 | } else { 126 | if {[setting:get $chan nologged]} { 127 | set text [black:color:set "" $black(say.$getlang.voiceme.6)] 128 | } else { 129 | set text [black:color:set "" $black(say.$getlang.voiceme.1)] 130 | } 131 | set text [join $text] 132 | puthelp "PRIVMSG $chan :[string map [array get replace] $text]" 133 | set found_entry 1 134 | } 135 | } else { 136 | if {[info exists black(voiceme:stat:$chan)]} { 137 | unset black(voiceme:stat:$chan) 138 | } 139 | if {[info exists black(voiceme:$chan:timer_start)]} { 140 | unset black(voiceme:$chan:timer_start) 141 | } 142 | } 143 | } 144 | } 145 | 146 | ############## 147 | ######################################################################### 148 | ## END ## 149 | ######################################################################### 150 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antibadquitpart.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ###################### ANTIBADQUITPART 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 badquitpart:protect {nick host hand chan arg} { 18 | global botnick black 19 | set chan1 $chan 20 | set arg [split $arg] 21 | set found_pub "" 22 | set found_color 0 23 | set found_msgflood 0 24 | set banmask [return_mask [return_host_num "antibadquitpart" $chan $host] $host $nick] 25 | if {![validchan $chan]} { return } 26 | if {[setting:get $chan badquitpart]} { 27 | set handle [nick2hand $nick] 28 | foreach usr [userlist "-|AOMV" $chan] { 29 | set hst [getuser $usr hosts] 30 | foreach hhost $hst { 31 | if {[string match -nocase $hhost $banmask]} { 32 | return 33 | } 34 | } 35 | } 36 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 37 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 38 | set bl_protect [blacktools:protect $nick $chan] 39 | if {$bl_protect == "1"} { return } 40 | if {[isbotnick $nick]} { return } 41 | set text [check:except $arg $chan $black(badquitpartwords) $black(badquitpartexcept) "BADQUITPART"] 42 | set check_word [check:file:word $chan $text "BADQUITPART"] 43 | if {$check_word != ""} { 44 | set found_pub $check_word 45 | } 46 | if {$found_pub != ""} { 47 | blacktools:banner:2 $nick "ANTIBADQUITPART:$found_pub" $chan $chan1 $host "0" "" 48 | if {[link:status $chan] == "1"} { 49 | foreach c [link:chan:get $chan] { 50 | blacktools:banner:2 $nick "ANTIBADQUITPART:$found_pub" $c $c $host "1" "" 51 | } 52 | blacktools:link_ban2 [link:get] 0 53 | } else { who:chan $chan } 54 | return 55 | } 56 | } 57 | if {[setting:get $chan quitpartcolor]} { 58 | set handle [nick2hand $nick] 59 | foreach usr [userlist "-|AOMV" $chan] { 60 | set hst [getuser $usr hosts] 61 | foreach hhost $hst { 62 | if {[string match -nocase $hhost $banmask]} { 63 | return 64 | } 65 | } 66 | } 67 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 68 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 69 | set bl_protect [blacktools:protect $nick $chan] 70 | if {$bl_protect == "1"} { return } 71 | if {[isbotnick $nick]} { return } 72 | foreach color $black(badcolors) { 73 | if {[setting:get $chan quitpartcolor] && [string match -nocase $color $arg]} { 74 | set found_color 1 75 | } 76 | } 77 | if {$found_color == "1"} { 78 | blacktools:banner:2 $nick "ANTIBADQUITPART:COLOR" $chan $chan $host "0" "" 79 | if {[link:status $chan] == "1"} { 80 | foreach c [link:chan:get $chan] { 81 | blacktools:banner:2 $nick "ANTIBADQUITPART:COLOR" $c $c $host "1" "" 82 | } 83 | } 84 | return 85 | } 86 | } 87 | if {[setting:get $chan quitpartmsgflood]} { 88 | set handle [nick2hand $nick] 89 | foreach usr [userlist "-|AOMV" $chan] { 90 | set hst [getuser $usr hosts] 91 | foreach hhost $hst { 92 | if {[string match -nocase $hhost $banmask]} { 93 | return 94 | } 95 | } 96 | } 97 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 98 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 99 | set bl_protect [blacktools:protect $nick $chan] 100 | if {$bl_protect == "1"} { return } 101 | if {[isbotnick $nick]} { return } 102 | set getlongchar [setting:get $chan quitpartmsgflood-char] 103 | if {$getlongchar == ""} { set getlongchar "$black(badquitpartmsgchar)" } 104 | if {[string length $arg] >= $getlongchar} { 105 | set found_msgflood 1 106 | } 107 | if {$found_msgflood == "1"} { 108 | if {$black(badquitpartmode) != ""} { 109 | putserv "MODE $chan +$black(badquitpartmode)" 110 | utimer $black(badquitpartsecunde) [list badquitpart:removemode $chan] 111 | } 112 | blacktools:banner:2 $nick "ANTIBADQUITPART:MSGFLOOD" $chan $chan $host "0" "" 113 | if {[link:status $chan] == "1"} { 114 | foreach c [link:chan:get $chan] { 115 | blacktools:banner:2 $nick "ANTIBADQUITPART:MSGFLOOD" $c $c $host "1" "" 116 | } 117 | } 118 | return 119 | } 120 | } 121 | } 122 | 123 | proc badquitpart:removemode {chan} { 124 | global black 125 | putserv "MODE $chan -$black(badquitpartmode)" 126 | } 127 | 128 | proc badquitpartsign:protect {nick host hand chan arg} { 129 | badquitpart:protect $nick $host $hand $chan $arg 130 | } 131 | 132 | proc badquitpart:module {nick host hand chan arg} { 133 | global black lastbind 134 | set type 0 135 | set chan1 "$chan" 136 | set why [lindex [split $arg] 0] 137 | set except [join [lrange [split $arg] 1 end]] 138 | set number [lindex [split $arg] 1] 139 | if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} { 140 | set chan "$why" 141 | set why [lindex [split $arg] 1] 142 | set except [join [lrange [split $arg] 2 end]] 143 | set number [lindex [split $arg] 2] 144 | } 145 | set return [blacktools:mychar $lastbind $hand] 146 | if {$return == "0"} { 147 | return 148 | } 149 | prot:module:process $nick $host $hand $chan $chan1 $why $except $type $number "badquitpart" 150 | } 151 | 152 | ############## 153 | ######################################################################### 154 | ## END ## 155 | ######################################################################### 156 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.antispam.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################## ANTISPAM 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 antispam:protect {nick host hand arg} { 18 | global botnick black 19 | set handle [nick2hand $nick] 20 | set channels "" 21 | foreach chans [channels] { 22 | if {[setting:get $chans antispam]} { 23 | set found_spam "" 24 | set text [color:filter $arg] 25 | set text [check:except $text $chans $black(spamword) $black(spamwordexcept) "ANTISPAM"] 26 | set check_word [check:file:word $chans $text "ANTISPAM"] 27 | if {$check_word == ""} { 28 | continue 29 | } else { 30 | set found_spam $check_word 31 | } 32 | set chan1 $chans 33 | if {![validchan $chans]} { return } 34 | if {[matchattr $handle $black(exceptflags) $chans]} { return } 35 | set bl_protect [blacktools:protect $nick $chans] 36 | if {$bl_protect == "1"} { return } 37 | if {[onchan $nick $chans]} { 38 | if {![botisop $chans] && ![setting:get $chans xonly]} { return } 39 | if {[isbotnick $nick]} { return } 40 | lappend channels $chans 41 | if {[link:status $chans] == "1"} { 42 | foreach c [link:chan:get $chans] { 43 | lappend channels $c 44 | } 45 | } 46 | } 47 | } 48 | } 49 | if {$channels != ""} { 50 | antispam:act:ban [join $channels] 0 $nick $host $found_spam 51 | } 52 | } 53 | 54 | proc antispam:act:ban {channels num nick host found_spam} { 55 | global black 56 | set chan [join [lindex [split $channels] $num]] 57 | set inc 0 58 | if {$chan == ""} { 59 | return 60 | } 61 | if {[onchan $nick $chan]} { 62 | blacktools:banner:2 $nick "ANTISPAM:$found_spam" $chan $chan $host "0" "" 63 | who:chan $chan 64 | } 65 | set inc [expr $num + 1] 66 | if {[lindex $channels $inc] != ""} { 67 | utimer 5 [list antispam:act:ban $channels $inc $nick $host $found_spam] 68 | } 69 | } 70 | 71 | proc antispam:protect:msg {nick host hand chan} { 72 | global black 73 | if {![validchan $chan]} { return } 74 | if {[setting:get $chan antispam]} { 75 | if {[isbotnick $nick]} { return } 76 | if {[info exists black(turnOnFlood:$chan)]} { 77 | return 78 | } 79 | if {[setting:get $chan spamjoinmessage]} { 80 | if {[matchattr $hand $black(exceptflags) $chan]} { return } 81 | set getmsg [setting:get $chan antispam-message] 82 | if {$getmsg == ""} { 83 | set getlang [string tolower [setting:get $chan lang]] 84 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 85 | set getmsg $black(say.$getlang.antispam.2) 86 | } 87 | set replace(%nick%) $nick 88 | set replace(%chan%) $chan 89 | set text [black:color:set "" $getmsg] 90 | set reply [join $text] 91 | set reply [string map [array get replace] $reply] 92 | puthelp "PRIVMSG $nick :$reply" 93 | } 94 | } 95 | } 96 | 97 | proc antispam:protect:cycle {channels} { 98 | global black 99 | set chans "" 100 | foreach chan $channels { 101 | if {![channel get $chan inactive]} { 102 | lappend chans $chan 103 | } 104 | } 105 | if {$chans != ""} { 106 | antispam:act $chans 0 107 | } 108 | } 109 | 110 | proc antispam:act {channels counter} { 111 | global black 112 | set notcycle 0 113 | set chan [join [lindex [split $channels] $counter]] 114 | set cc [expr $counter + 1] 115 | if {[info exists black(lastaction:$chan)]} { 116 | set total_anunt 0 117 | set unixtime [unixtime] 118 | if {[setting:get $chan antispam-scantime] != ""} { 119 | set return_time [time_return_minute [setting:get $chan antispam-scantime]] 120 | } else { 121 | set return_time [time_return_minute $black(spamcycle)] 122 | } 123 | set time [expr [expr [expr $return_time * $black(entry:shown)] * 60] + $unixtime] 124 | if {[expr $unixtime - $black(lastaction:$chan)] > [expr $time - $unixtime]} { 125 | set notcycle 1 126 | } 127 | } else { set notcycle 1 } 128 | if {$notcycle != "1"} { 129 | set getlang [string tolower [setting:get $chan lang]] 130 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 131 | set reason $black(say.$getlang.antispam.11) 132 | set len [llength $reason] 133 | set random [expr int(rand()*$len)] 134 | set reason [lindex $reason $random] 135 | set text [black:color:set "" $reason] 136 | set reply [join $text] 137 | putserv "PART $chan :$reply"; putserv "JOIN $chan" 138 | } 139 | if {[lindex $channels $cc] == ""} { 140 | return 141 | } else { 142 | utimer 10 [list antispam:act $channels $cc] 143 | } 144 | } 145 | 146 | 147 | proc antispam:module {nick host hand chan arg} { 148 | global black lastbind 149 | set type 0 150 | set chan1 "$chan" 151 | set why [lindex [split $arg] 0] 152 | set antisp [join [lrange [split $arg] 1 end]] 153 | set number [lindex [split $arg] 1] 154 | if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} { 155 | set chan "$why" 156 | set why [lindex [split $arg] 1] 157 | set antisp [join [lrange [split $arg] 2 end]] 158 | set number [lindex [split $arg] 2] 159 | } 160 | set return [blacktools:mychar $lastbind $hand] 161 | if {$return == "0"} { 162 | return 163 | } 164 | prot:module:process $nick $host $hand $chan $chan1 $why $badh $type $number "antispam" 165 | } 166 | 167 | ############## 168 | ######################################################################### 169 | ## END ## 170 | ######################################################################### 171 | -------------------------------------------------------------------------------- /BlackTools/BT.Binds.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################### BINDS 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 | if {[info exists black(notlogged)]} { 18 | unset black(notlogged) 19 | } 20 | 21 | bind pubm - * blacktools:protect:pub 22 | bind pubm - * voiceonmsg:public 23 | bind pubm - * topwords:module 24 | bind pubm - * seen:lastmsg 25 | bind pubm - * notes:announce:pub 26 | bind pubm - "**" comand:pubme 27 | bind pubm - "**" comand:pubme:for 28 | bind pubm - "***" comand:chan 29 | 30 | bind msgm - * forward:redirect 31 | bind msgm - "*" command:pubpriv 32 | bind dcc - bt command:pubdcc 33 | bind ctcp - ACTION blacktools:protect:me 34 | bind ctcp - ACTION voiceonmsg:public:me 35 | bind ctcp - ACTION topwords:module:me 36 | bind msgm - * msg:flood:protection 37 | bind notc - * notc:flood:protection 38 | bind time - "* * * * *" maxuptime 39 | bind time - "* * * * *" blacktools:expirebans 40 | bind time - "* * * * *" seen:save_file 41 | 42 | bind notc - * antinotice:protect 43 | bind ctcp - * antictcp:protect 44 | bind part - * badquitpart:protect 45 | bind sign - * badquitpartsign:protect 46 | bind join - * antispam:protect:msg 47 | bind msgm - * antispam:protect 48 | bind time - "20 00 * * *" seen:entry:delete 49 | bind time - "20 00 * * *" remove:chan:timer 50 | bind time - "30 00 * * *" user:autoexpire 51 | bind time - "00 00 * * *" topwords:day:reset 52 | bind time - "00 00 * * *" bans:day:reset 53 | bind time - "10 00 * * *" secured:allowlist:reset 54 | bind time - "00 00 * * *" notes:autoexpire 55 | bind ctcp - * blackreply 56 | bind join - * badrealname:protect:join 57 | bind join - * badnick:protect:join 58 | bind join - * badident:protect:join 59 | bind join - * badhost:protect 60 | bind join - * noproxy:protect 61 | bind nick - * badnick:protect:change 62 | bind nick - * nickflood:protect 63 | bind mode - "*+b*" protectpublic 64 | bind join - * joinflood:protect 65 | bind join - * rebanpublic 66 | bind need - * toolspublic 67 | bind need - * keyneed 68 | bind join - * badchanpublic:join 69 | bind join - * seen:join 70 | bind part - * seen:part 71 | bind sign - * seen:sign 72 | bind kick - * seen:kick 73 | bind splt - * seen:split 74 | bind nick - * seen:changenick 75 | bind join - * greetpublic:join 76 | bind part - * leavepublic:part 77 | bind evnt - init-server setaway 78 | bind join - * autovonjoin 79 | bind join - * autoponjoin 80 | bind join - * auto:join 81 | bind join - * private:module 82 | bind join - * reason:details:module 83 | bind join - * troll:show 84 | bind ctcr - VERSION ctcpvers 85 | bind mode - *+o* dontoppublic 86 | bind mode - *-o* dontdeoppublic 87 | 88 | bind nick - * badchan:nickchange 89 | 90 | bind kick - * massban:kick 91 | 92 | bind join - * flood:join:protection 93 | bind join - * join:count 94 | bind join - * first:join 95 | bind join - * topic:autotopic 96 | bind mode - *-b* gag:reban 97 | 98 | bind join - * black:next:join 99 | bind part - * black:next:part 100 | bind sign - * black:next:sign 101 | bind splt - * black:next:split 102 | bind kick - * black:next:kick 103 | bind mode - * black:next:mode 104 | bind nick - * black:next:chnick 105 | 106 | bind part - * voiceonmsg:part 107 | bind sign - * voiceonmsg:part 108 | bind splt - * voiceonmsg:split 109 | bind kick - * voiceonmsg:kick 110 | 111 | bind part - * gag:part 112 | bind sign - * gag:part 113 | bind splt - * gag:split 114 | bind kick - * gag:kick 115 | 116 | bind kick - * autoinvite:kick 117 | 118 | bind mode - * voiceme:mode 119 | bind join - * voiceme:join 120 | bind join - * notes:announce 121 | 122 | 123 | bind kick - * securemode:kickremove 124 | bind mode - * securemode:reply 125 | 126 | bind join - * blacktools:join:ban 127 | bind mode - * blacktools:mode:ban 128 | bind nick - * blacktools:chnick:ban 129 | 130 | bind join - * blacktools:backchan:verify 131 | 132 | bind join - * blacktools:vote:greetshow 133 | 134 | bind raw - invite inviteban:protect 135 | 136 | bind raw - 474 abuse:ban:note 137 | bind raw - 475 abuse:key:note 138 | bind raw - 473 abuse:inviteonly:note 139 | bind raw - 471 abuse:channelfull:note 140 | bind raw - 477 abuse:restricted:note 141 | bind raw - 478 blacktools:banlistfull 142 | 143 | #chanserv 144 | 145 | bind notc - "*AUTENTIFICARE REUSITA*" black:login:yes 146 | bind notc - "*AUTHENTICATION SUCCESSFUL*" black:login:yes 147 | bind notc - "*AUTENTIFICARE ESUATA*" black:login:no 148 | bind notc - "*AUTHENTICATION FAILED*" black:login:no:failed 149 | bind notc - "*You are already authenticated*" black:login:yes 150 | bind notc - "*Esti deja autentificat*" black:login:yes 151 | bind notc - "*SYNTAX: LOGIN*" black:login:no:user 152 | bind notc - "*I don't know*" black:login:no:invalid 153 | bind notc - "*Maximum concurrent logins exceeded*" black:login:max 154 | # 155 | 156 | #nickserv 157 | 158 | bind notc - "*registered and protected*" black:nickserv:yes 159 | bind notc - "*Password accepted*" black:nickserv:identify 160 | bind notc - "*The password supplied*" black:nickserv:wrongpass 161 | bind notc - "*registered to someone else*" black:nickserv:registered 162 | bind nick - * black:nickserv:release 163 | # 164 | 165 | bind join - * blacktools:getlastaction:join 166 | bind kick - * blacktools:getlastaction:kick 167 | bind pubm - * blacktools:getlastaction:text 168 | bind splt - * blacktools:getlastaction:split 169 | bind sign - * blacktools:getlastaction:sign 170 | bind mode - *+b* blacktools:getlastaction:ban 171 | bind ctcp - ACTION blacktools:getlastaction:me 172 | bind part - * blacktools:getlastaction:part 173 | 174 | unbind msg - hello *msg:hello 175 | unbind msg - pass *msg:pass 176 | unbind msg - addhost *msg:addhost 177 | 178 | ############## 179 | ########################################################## 180 | ## END # 181 | ########################################################## 182 | -------------------------------------------------------------------------------- /BlackTools/README/README.txt: -------------------------------------------------------------------------------- 1 | =========================================================================================================== 2 | -= BLaCkShaDoW Production Presents =- 3 | BlackTools - The Ultimate Channel Control Script 4 | One TCL. One smart Eggdrop 5 | =========================================================================================================== 6 | 7 | BlackTools is the most complete channel management script who can manage channels from all 8 | the IRC networks, although some modules are specifically designed only for Undernet network. 9 | 10 | ----------------------- 11 | 12 | Download : http://blacktools.tclscripts.net 13 | Bugs report : http://www.tclscripts.net 14 | History : http://www.tclscripts.net/release-notes 15 | GitHub page : https://github.com/tclscripts/BlackToolS-TCL 16 | Online help : irc://irc.undernet.org/tcl-help 17 | #TCL-HELP / UnderNet 18 | You can ask in english or romanian 19 | 20 | / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ 21 | ( T | C | L | S | C | R | I | P | T | S | . | N | E | T ) 22 | \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / 23 | 24 | You want a customised TCL Script for your eggdrop? 25 | Easy-peasy, just tell us what you need! 26 | We can create almost anything in TCL based on your ideas and donations. 27 | Email: blackshadow@tclscripts.net or info@tclscripts.net with your request informations 28 | and we'll contact you as soon as possible. 29 | 30 | ----------------------- 31 | 32 | Ideas, suggestions, comments ? 33 | 34 | This script is free of charge but I accept donations, old computers, free shells :)) 35 | In any case, if you have any comment (good or bad) go to www.tclscripts.net. 36 | 37 | Minimum requirements: 38 | o Eggdrop 1.8.x 39 | o Tcl 8.5 or higher. 40 | 41 | Most important features: 42 | 43 | o Multi-channels support: intelligent IRC channel management, every owner(s)/manager(s) can 44 | customise this script and its component settings for each channel to his liking. 45 | (add/remove users, activate or disable desired protections, modules or commands) 46 | o Global boss owner(s) now have the possibility of being able to modify, directly into, their 47 | eggdrop config file (eggdrop.conf) without having to log on to the shell machine to do that. 48 | (i.e. nickname, realname, homechan, chanserv, chanserv username, chanserv password, etc.) 49 | o Designed for flexibility and ease of use: BlackTools is now 100% flexible to be configured 50 | via channel, you can set different settings for each channel. 51 | o Owner(s) timer module system which allows to start timers to execute certain processes (proc) 52 | and in case you want to kill/stop a timer you can do this through this module too. 53 | Also provides and a list of active timers running. 54 | o Allows you to upload files that match the pattern *.tcl from a url inside your 55 | eggdrop's scripts directory. 56 | o Note module system where users can send messages to each other or save personal notes. 57 | Also, eggdrop will send notes to global owner(s) to inform them every time is abused 58 | (banned/can't join a channel). 59 | o CIDR support, dnslookup support and webirc hosts support. 60 | o All commands works through private message (PRIVMSG) and possibility that all users, who have 61 | access to eggdrop, can set their own cmdchar such as '!'. 62 | o All the warn/kick/ban reasons are highly customizable. 63 | Every channel manager can add or remove anything as want easily. 64 | o The new BlackTools version brings also a new and very well-implemented ban system which performs 65 | accurate and efficient searches through global banlist and every channel banlists for a better 66 | management and an easier removal/unban. 67 | o Perfect navigational system through the pages of every module which has this option and a 68 | quote support system module. 69 | o Protection against botnet (mass) and private floods. 70 | o And lots of cool features for your eggdrop :) 71 | 72 | Important: 73 | 74 | Read BlackTools MANUAL (.man command) for help and information about configuration. 75 | Read INSTALL file to know how to install it. 76 | Read FAQ file for the most frequently asked questions. 77 | 78 | Credits: 79 | 80 | o Settore for hosting the tclscripts.net project website. 81 | settore@tclscripts.net [ www.codegeenie.world ] 82 | 83 | o Florian (most craziest imagination guy) for spotting some major and important issues, also for 84 | provinding all the required and necessary materials needed for this script to be ready. 85 | florian@tclscripts.net [ www.tntradio.ro ] 86 | 87 | Utenti italiani: 88 | --------------------- 89 | Italian Language: Nessuna traduzione ufficiale ancora (puo essere fatta su richiesta). 90 | 91 | Usuarios espanoles: 92 | --------------------- 93 | Spanish Language: Sin traduccion oficial todavia (se puede realizar a peticion). 94 | 95 | ----------------------------------------------------------------------------------------------------------- 96 | Copyright (c) 2008-2021 Daniel Voipan (aka BLaCkShaDoW). 97 | ----------------------------------------------------------------------------------------------------------- 98 | AUTHOR : Daniel Voipan 99 | NICK : BLaCkShaDoW 100 | MEET ME : On *UnderNet.org: #TCL-HELP, #UnBan, #TNTRadio 101 | EMAIL : blackshadow@tclscripts.net 102 | URL : https://github.com/DanielVoipan/ 103 | GREETS : o Special thanks to QueenElsa and Florian for testing, suggesting fixes and new features 104 | inspiration for many parts of BlackTools.tcl that led to the improvement of this script. 105 | o Thanks also to Time2Go > Ionut (retired..) without whom this script would not have gone 106 | so far. 107 | - admin of #TCL-HELP Channel 108 | o As well, many thanks to psycho & WildMan for the interest shown in testing & searching 109 | for errors. 110 | o Thank you to all those people who found bugs in the script and reported them and to all 111 | the users who joined #TCL-HELP and shared their ideas and suggestions. 112 | - Website: wWw.TclScriptS.NeT 113 | - #TCL-HELP (BlackTools TCL Project Official Channel) 114 | ----------------------------------------------------------------------------------------------------------- 115 | -------------------------------------------------------------------------------- /BlackTools/Protections/BT.badnick.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################### BADNICK 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 badnick:protect:join {nick host hand chan} { 18 | global black botnick 19 | set found_nick "" 20 | if {![validchan $chan]} { return } 21 | set chan1 $chan 22 | if {[setting:get $chan badnick]} { 23 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 24 | set bl_protect [blacktools:protect $nick $chan] 25 | if {$bl_protect == "1"} { return } 26 | if {[matchattr $hand $black(exceptflags) $chan]} { return } 27 | set getnick [check:except $nick $chan $black(badnickwords) $black(badnickexcept) "BADNICK"] 28 | set check_word [check:file:word $chan $getnick "BADNICK"] 29 | if {$check_word != ""} { 30 | set found_nick $check_word 31 | } 32 | if {$found_nick != ""} { 33 | set getlang [string tolower [setting:get $chan lang]] 34 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 35 | if {[setting:get $chan badnick-bmethod] == ""} { 36 | set bmethod $black(badnbanmethod) 37 | } else { set bmethod [setting:get $chan badnick-bmethod] } 38 | 39 | if {$bmethod == "2"} { 40 | blacktools:banner:2 $nick "BADNICK:$found_nick" $chan $chan1 $host "0" "" 41 | if {[link:status $chan] == "1"} { 42 | foreach c [link:chan:get $chan] { 43 | blacktools:banner:2 $nick "BADNICK:$found_nick" $c $c $host "1" "" 44 | } 45 | blacktools:link_ban2 [link:get] 0 46 | } else { who:chan $chan } 47 | return 48 | } 49 | foreach tmr [utimers] { 50 | if {[string match "*badnick:check:again $nick $chan*" [join [lindex $tmr 1]]]} { 51 | killutimer [lindex $tmr 2] 52 | } 53 | } 54 | if {[setting:get $chan badnick-banwait] == ""} { 55 | set wait_time $black(badnbanwait) 56 | utimer $black(badnbanwait) [list badnick:check:again $nick $chan $host] 57 | } else { 58 | set wait_time [setting:get $chan badnick-banwait] 59 | utimer $wait_time [list badnick:check:again $nick $chan $host] 60 | } 61 | set text [black:color:set "" $black(say.$getlang.badnick.10)] 62 | set reply [join $text] 63 | set replace(%time%) $wait_time 64 | set message [string map [array get replace] $reply] 65 | putquick "PRIVMSG $nick :\[$chan\] $message" 66 | } 67 | } 68 | } 69 | 70 | proc badnick:check:again {nick chan host} { 71 | global black 72 | if {[onchan $nick $chan]} { 73 | blacktools:banner:2 $nick "BADNICK:$nick" $chan $chan $host "0" "" 74 | if {[link:status $chan] == "1"} { 75 | foreach c [link:chan:get $chan] { 76 | blacktools:banner:2 $nick "BADNICK:$nick" $c $c $host "1" "" 77 | } 78 | blacktools:link_ban2 [link:get] 0 79 | } else { who:chan $chan } 80 | } 81 | } 82 | 83 | proc badnick:protect:change {nick host hand chan newnick} { 84 | global black botnick 85 | set handle [nick2hand $nick] 86 | set found_nick "" 87 | if {![validchan $chan]} { return } 88 | if {[setting:get $chan badnick]} { 89 | set chan1 $chan 90 | if {![botisop $chan] && ![setting:get $chan xonly]} { return } 91 | if {[matchattr $handle $black(exceptflags) $chan]} { return } 92 | set bl_protect [blacktools:protect $nick $chan] 93 | if {$bl_protect == "1"} { return } 94 | set newnick [check:except $newnick $chan $black(badnickwords) $black(badnickexcept) "BADNICK"] 95 | set check_word [check:file:word $chan $newnick "BADNICK"] 96 | if {$check_word != ""} { 97 | set found_nick $check_word 98 | } 99 | foreach badnick [string tolower $black(badnickwords)] { 100 | if {[string match $badnick [string tolower $newnick]]} { 101 | set found_nick $badnick 102 | } 103 | } 104 | if {$found_nick != ""} { 105 | set getlang [string tolower [setting:get $chan lang]] 106 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 107 | if {[setting:get $chan badnick-bmethod] == ""} { 108 | set bmethod $black(badnbanmethod) 109 | } else { set bmethod [setting:get $chan badnick-bmethod] } 110 | 111 | if {$bmethod == "2"} { 112 | blacktools:banner:2 $newnick "BADNICK:$found_nick" $chan $chan $host "0" "" 113 | if {[link:status $chan] == "1"} { 114 | foreach c [link:chan:get $chan] { 115 | blacktools:banner:2 $newnick "BADNICK:$found_nick" $c $c $host "1" "" 116 | } 117 | blacktools:link_ban2 [link:get] 0 118 | } else { who:chan $chan } 119 | return 120 | } 121 | foreach tmr [utimers] { 122 | if {[string match "*badnick:check:again $newnick $chan*" [join [lindex $tmr 1]]]} { 123 | killutimer [lindex $tmr 2] 124 | } 125 | } 126 | if {[setting:get $chan badnick-banwait] == ""} { 127 | set wait_time $black(badnbanwait) 128 | utimer $black(badnbanwait) [list badnick:check:again $newnick $chan $host] 129 | } else { 130 | set wait_time [setting:get $chan badnick-banwait] 131 | utimer $wait_time [list badnick:check:again $newnick $chan $host] 132 | } 133 | set text [black:color:set "" $black(say.$getlang.badnick.10)] 134 | set reply [join $text] 135 | set replace(%time%) $wait_time 136 | set message [string map [array get replace] $reply] 137 | putquick "PRIVMSG $newnick :\[$chan\] $message" 138 | } 139 | } 140 | } 141 | proc badnick:module {nick host hand chan arg} { 142 | global black lastbind 143 | set type 0 144 | set chan1 "$chan" 145 | set why [lindex [split $arg] 0] 146 | set badn [join [lrange [split $arg] 1 end]] 147 | set number [lindex [split $arg] 1] 148 | if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} { 149 | set chan "$why" 150 | set why [lindex [split $arg] 1] 151 | set badn [join [lrange [split $arg] 2 end]] 152 | set number [lindex [split $arg] 2] 153 | } 154 | set return [blacktools:mychar $lastbind $hand] 155 | if {$return == "0"} { 156 | return 157 | } 158 | prot:module:process $nick $host $hand $chan $chan1 $why $badn $type $number "badnick" 159 | } 160 | 161 | ############## 162 | ######################################################################### 163 | ## END ## 164 | ######################################################################### 165 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | =========================================================================================================== 2 | -= BLaCkShaDoW Production Presents =- 3 | BlackTools - The Ultimate Channel Control Script 4 | One TCL. One smart Eggdrop 5 | =========================================================================================================== 6 | 7 | BlackTools is the most complete channel management script who can manage channels from all 8 | the IRC networks. 9 | 10 | ----------------------- 11 | 12 | Bugs report : http://www.tclscripts.net 13 | History : http://www.tclscripts.net/release-notes 14 | GitHub page : https://github.com/tclscripts/BlackToolS-TCL 15 | Online help : irc://irc.undernet.org/tcl-help 16 | #TCL-HELP / UnderNet 17 | You can ask in english or romanian 18 | 19 | / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ 20 | ( T | C | L | S | C | R | I | P | T | S | . | N | E | T ) 21 | \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / 22 | 23 | You want a customised TCL Script for your eggdrop? 24 | Easy-peasy, just tell us what you need! 25 | We can create almost anything in TCL based on your ideas and donations. 26 | Email: blackshadow@tclscripts.net or info@tclscripts.net with your request informations 27 | and we'll contact you as soon as possible. 28 | 29 | ----------------------- 30 | 31 | Ideas, suggestions, comments ? 32 | 33 | This script is free of charge but I accept donations, old computers, free shells :)) 34 | In any case, if you have any comment (good or bad) go to www.tclscripts.net. 35 | 36 | Minimum requirements: 37 | o Eggdrop 1.8.x or higher. 38 | o Tcl 8.5 or higher. 39 | o TLS package (for autoupdate module to work,if not, it will be disabled) 40 | 41 | Most important features: 42 | o Multiple languages support (EN,RO,ES) 43 | o AutoUpdate that gives the eggdrop the ability to download and install the BT if a new version 44 | or bug fix version is on github. All BT files and settings are saved and restored after install. 45 | o Capability to create aliases (commands based on BT official commands) foreach user. 46 | o Multi-channels support: intelligent IRC channel management, every owner(s)/manager(s) can 47 | customise this script and its component settings for each channel to his liking. 48 | (add/remove users, activate or disable desired protections, modules or commands) 49 | o Global boss owner(s) now have the possibility of being able to modify, directly into, their 50 | eggdrop config file (eggdrop.conf) without having to log on to the shell machine to do that. 51 | (i.e. nickname, realname, homechan, chanserv, chanserv username, chanserv password, etc.) 52 | o Designed for flexibility and ease of use: BlackTools is now 100% flexible to be configured 53 | via channel, you can set different settings for each channel. 54 | o Owner(s) timer module system which allows to start timers to execute certain processes (proc) 55 | and in case you want to kill/stop a timer you can do this through this module too. 56 | Also provides and a list of active timers running. 57 | o Allows you to upload files that match the pattern *.tcl from a url inside your 58 | eggdrop's scripts directory. 59 | o Note module system where users can send messages to each other or save personal notes. 60 | Also, eggdrop will send notes to global owner(s) to inform them every time is abused 61 | (banned/can't join a channel). 62 | o CIDR support, dnslookup support and webirc hosts support. 63 | o All commands works through private message (PRIVMSG) and possibility that all users, who have 64 | access to eggdrop, can set their own cmdchar such as '!'. 65 | o All the warn/kick/ban reasons are highly customizable. 66 | Every channel manager can add or remove anything as want easily. 67 | o The new BlackTools version brings also a new and very well-implemented ban system which performs 68 | accurate and efficient searches through global banlist and every channel banlists for a better 69 | management and an easier removal/unban. 70 | o Perfect navigational system through the pages of every module which has this option and a 71 | quote support system module. 72 | o Protection against botnet (mass) and private floods. 73 | o And lots of cool features for your eggdrop :) 74 | 75 | Important: 76 | 77 | Read BlackTools MANUAL (.man command) for help and information about configuration. 78 | Read INSTALL file to know how to install it. 79 | Read FAQ file for the most frequently asked questions. 80 | 81 | Credits: 82 | 83 | o Settore for hosting the tclscripts.net project website. 84 | settore@tclscripts.net [ www.codegeenie.world ] 85 | 86 | o Florian (most craziest imagination guy) for spotting some major and important issues, also for 87 | provinding all the required and necessary materials needed for this script to be ready. 88 | florian@tclscripts.net [ www.tntradio.ro ] 89 | 90 | Utenti italiani: 91 | --------------------- 92 | Italian Language: Nessuna traduzione ufficiale ancora (puo essere fatta su richiesta). 93 | 94 | ----------------------------------------------------------------------------------------------------------- 95 | Copyright (c) 2008-2022 Daniel Voipan (aka BLaCkShaDoW). 96 | ----------------------------------------------------------------------------------------------------------- 97 | AUTHOR : Daniel Voipan 98 | NICK : BLaCkShaDoW 99 | MEET ME : On *UnderNet.org: #TCL-HELP, #UnBan, #TNTRadio 100 | EMAIL : blackshadow@tclscripts.net 101 | URL : https://github.com/DanielVoipan/ 102 | GREETS : o Special thanks to QueenElsa and Florian for testing, suggesting fixes and new features 103 | inspiration for many parts of BlackTools.tcl that led to the improvement of this script. 104 | o Thanks also to Time2Go > Ionut (retired..) without whom this script would not have gone 105 | so far. 106 | - admin of #TCL-HELP Channel 107 | o As well, many thanks to psycho & WildMan for the interest shown in testing & searching 108 | for errors. 109 | o Thank you to all those people who found bugs in the script and reported them and to all 110 | the users who joined #TCL-HELP and shared their ideas and suggestions. 111 | - Website: wWw.TclScriptS.NeT 112 | - #TCL-HELP (BlackTools TCL Project Official Channel) 113 | ----------------------------------------------------------------------------------------------------------- 114 | -------------------------------------------------------------------------------- /BlackTools/Addons/json.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # JSON parser for Tcl. 3 | # 4 | # See http://www.json.org/ && http://www.ietf.org/rfc/rfc4627.txt 5 | # 6 | # Copyright 2006 ActiveState Software Inc. 7 | # 8 | # $Id: json.tcl,v 1.2 2006/08/25 23:19:53 hobbs Exp $ 9 | # 10 | 11 | if {$::tcl_version < 8.5} { 12 | package require dict 13 | } 14 | 15 | package provide json 1.0 16 | 17 | namespace eval json {} 18 | 19 | proc json::getc {{txtvar txt}} { 20 | # pop single char off the front of the text 21 | upvar 1 $txtvar txt 22 | if {$txt eq ""} { 23 | return -code error "unexpected end of text" 24 | } 25 | 26 | set c [string index $txt 0] 27 | set txt [string range $txt 1 end] 28 | return $c 29 | } 30 | 31 | proc json::json2dict {txt} { 32 | return [_json2dict] 33 | } 34 | 35 | proc json::_json2dict {{txtvar txt}} { 36 | upvar 1 $txtvar txt 37 | 38 | set state TOP 39 | 40 | set txt [string trimleft $txt] 41 | while {$txt ne ""} { 42 | set c [string index $txt 0] 43 | 44 | # skip whitespace 45 | while {[string is space $c]} { 46 | getc 47 | set c [string index $txt 0] 48 | } 49 | 50 | if {$c eq "\{"} { 51 | # object 52 | switch -- $state { 53 | TOP { 54 | # we are dealing with an Object 55 | getc 56 | set state OBJECT 57 | set dictVal [dict create] 58 | } 59 | VALUE { 60 | # this object element's value is an Object 61 | dict set dictVal $name [_json2dict] 62 | set state COMMA 63 | } 64 | LIST { 65 | # next element of list is an Object 66 | lappend listVal [_json2dict] 67 | set state COMMA 68 | } 69 | default { 70 | return -code error "unexpected open brace in $state mode" 71 | } 72 | } 73 | } elseif {$c eq "\}"} { 74 | getc 75 | if {$state ne "OBJECT" && $state ne "COMMA"} { 76 | return -code error "unexpected close brace in $state mode" 77 | } 78 | return $dictVal 79 | } elseif {$c eq ":"} { 80 | # name separator 81 | getc 82 | 83 | if {$state eq "COLON"} { 84 | set state VALUE 85 | } else { 86 | return -code error "unexpected colon in $state mode" 87 | } 88 | } elseif {$c eq ","} { 89 | # element separator 90 | if {$state eq "COMMA"} { 91 | getc 92 | if {[info exists listVal]} { 93 | set state LIST 94 | } elseif {[info exists dictVal]} { 95 | set state OBJECT 96 | } 97 | } else { 98 | return -code error "unexpected comma in $state mode" 99 | } 100 | } elseif {$c eq "\""} { 101 | # string 102 | # capture quoted string with backslash sequences 103 | set reStr {(?:(?:\")(?:[^\\\"]*(?:\\.[^\\\"]*)*)(?:\"))} 104 | set string "" 105 | if {![regexp $reStr $txt string]} { 106 | set txt [string replace $txt 32 end ...] 107 | return -code error "invalid formatted string in $txt" 108 | } 109 | set txt [string range $txt [string length $string] end] 110 | # chop off outer ""s and substitute backslashes 111 | # This does more than the RFC-specified backslash sequences, 112 | # but it does cover them all 113 | set string [subst -nocommand -novariable \ 114 | [string range $string 1 end-1]] 115 | 116 | switch -- $state { 117 | TOP { 118 | return $string 119 | } 120 | OBJECT { 121 | set name $string 122 | set state COLON 123 | } 124 | LIST { 125 | lappend listVal $string 126 | set state COMMA 127 | } 128 | VALUE { 129 | dict set dictVal $name $string 130 | unset name 131 | set state COMMA 132 | } 133 | } 134 | } elseif {$c eq "\["} { 135 | # JSON array == Tcl list 136 | switch -- $state { 137 | TOP { 138 | getc 139 | set state LIST 140 | } 141 | LIST { 142 | lappend listVal [_json2dict] 143 | set state COMMA 144 | } 145 | VALUE { 146 | dict set dictVal $name [_json2dict] 147 | set state COMMA 148 | } 149 | default { 150 | return -code error "unexpected open bracket in $state mode" 151 | } 152 | } 153 | } elseif {$c eq "\]"} { 154 | # end of list 155 | getc 156 | if {![info exists listVal]} { 157 | #return -code error "unexpected close bracket in $state mode" 158 | # must be an empty list 159 | return "" 160 | } 161 | 162 | return $listVal 163 | } elseif {0 && $c eq "/"} { 164 | # comment 165 | # XXX: Not in RFC 4627 166 | getc 167 | set c [getc] 168 | switch -- $c { 169 | / { 170 | # // comment form 171 | set i [string first "\n" $txt] 172 | if {$i == -1} { 173 | set txt "" 174 | } else { 175 | set txt [string range $txt [incr i] end] 176 | } 177 | } 178 | * { 179 | # /* comment */ form 180 | getc 181 | set i [string first "*/" $txt] 182 | if {$i == -1} { 183 | return -code error "incomplete /* comment" 184 | } else { 185 | set txt [string range $txt [incr i] end] 186 | } 187 | } 188 | default { 189 | return -code error "unexpected slash in $state mode" 190 | } 191 | } 192 | } elseif {[string match {[-0-9]} $c]} { 193 | # one last check for a number, no leading zeros allowed, 194 | # but it may be 0.xxx 195 | string is double -failindex last $txt 196 | if {$last > 0} { 197 | set num [string range $txt 0 [expr {$last - 1}]] 198 | set txt [string range $txt $last end] 199 | 200 | switch -- $state { 201 | TOP { 202 | return $num 203 | } 204 | LIST { 205 | lappend listVal $num 206 | set state COMMA 207 | } 208 | VALUE { 209 | dict set dictVal $name $num 210 | set state COMMA 211 | } 212 | default { 213 | getc 214 | return -code error "unexpected number '$c' in $state mode" 215 | } 216 | } 217 | } else { 218 | getc 219 | return -code error "unexpected '$c' in $state mode" 220 | } 221 | } elseif {[string match {[ftn]} $c] 222 | && [regexp {^(true|false|null)} $txt val]} { 223 | # bare word value: true | false | null 224 | set txt [string range $txt [string length $val] end] 225 | 226 | switch -- $state { 227 | TOP { 228 | return $val 229 | } 230 | LIST { 231 | lappend listVal $val 232 | set state COMMA 233 | } 234 | VALUE { 235 | dict set dictVal $name $val 236 | set state COMMA 237 | } 238 | default { 239 | getc 240 | return -code error "unexpected '$c' in $state mode" 241 | } 242 | } 243 | } else { 244 | # error, incorrect format or unexpected end of text 245 | return -code error "unexpected '$c' in $state mode" 246 | } 247 | } 248 | } 249 | 250 | proc json::dict2json {dictVal} { 251 | # XXX: Currently this API isn't symmetrical, as to create proper 252 | # XXX: JSON text requires type knowledge of the input data 253 | set json "" 254 | 255 | dict for {key val} $dictVal { 256 | # key must always be a string, val may be a number, string or 257 | # bare word (true|false|null) 258 | if {0 && ![string is double -strict $val] 259 | && ![regexp {^(?:true|false|null)$} $val]} { 260 | set val "\"$val\"" 261 | } 262 | append json "\"$key\": $val," \n 263 | } 264 | 265 | return "\{${json}\}" 266 | } 267 | 268 | proc json::list2json {listVal} { 269 | return "\[$[join $listVal ,]\]" 270 | } 271 | 272 | proc json::string2json {str} { 273 | return "\"$str\"" 274 | } 275 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.VoiceOnMsg.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ########################### VOICEONMSG 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 voiceonmsg:public:me {nick host hand chan keyword arg} { 18 | global black 19 | if {[string equal -nocase $keyword "ACTION"]} { 20 | voiceonmsg:public $nick $host $hand $chan $arg 21 | } 22 | } 23 | 24 | proc voiceonmsg:public {nick host hand chan arg} { 25 | global black 26 | if {![validchan $chan]} { 27 | return 28 | } 29 | if {[setting:get $chan voiceonmsg]} { 30 | if {[matchattr $hand "nmo|MAOV" $chan]} { 31 | return 32 | } 33 | 34 | if {![info exists black(voiceonmsg:list:$chan)]} { 35 | set black(voiceonmsg:list:$chan) "" 36 | } 37 | if {[isvoice $nick $chan]} { return } 38 | if {[isop $nick $chan]} { return } 39 | if {![botisop $chan]} { return } 40 | if {![info exists black(voiceonmsg:$host:$chan)]} { 41 | if {[lsearch -exact [string tolower $black(voiceonmsg:list:$chan)] [string tolower $host]] == -1} { 42 | lappend black(voiceonmsg:list:$chan) $host 43 | } 44 | set black(voiceonmsg:$host:$chan) 1 45 | utimer 300 [list voiceonmsg:remove $host $chan] 46 | return 47 | } 48 | if {[lsearch -exact [string tolower $black(voiceonmsg:list:$chan)] [string tolower $host]] == -1} { 49 | lappend black(voiceonmsg:list:$chan) $host 50 | } 51 | set current_count $black(voiceonmsg:$host:$chan) 52 | set black(voiceonmsg:$host:$chan) [expr $current_count + 1] 53 | 54 | foreach tmr [utimers] { 55 | if {[string match -nocase "*voiceonmsg:remove:expire $host $chan*" [join [lindex $tmr 1]]]} { 56 | killutimer [lindex $tmr 2] 57 | } 58 | } 59 | utimer 300 [list voiceonmsg:remove:expire $host $chan] 60 | set linenum [setting:get $chan voiceonmsg-linenum] 61 | if {$linenum == ""} { 62 | set linenum $black(voiceonmsg:linenum) 63 | } 64 | if {$black(voiceonmsg:$host:$chan) >= $linenum} { 65 | if {[setting:get $chan xonly] && [onchan $black(chanserv) $chan]} { 66 | putserv "PRIVMSG $black(chanserv) :voice $chan $nick" 67 | } else { 68 | pushmode $chan +v $nick 69 | } 70 | voiceonmsg:remove $host $chan 71 | } 72 | } 73 | } 74 | 75 | proc voiceonmsg:remove {host chan} { 76 | global black 77 | foreach tmr [utimers] { 78 | if {[string match "*voiceonmsg:remove:expire $host $chan*" [join [lindex $tmr 1]]]} { 79 | killutimer [lindex $tmr 2] 80 | } 81 | if {[string match "*voiceonmsg:remove $host $chan*" [join [lindex $tmr 1]]]} { 82 | killutimer [lindex $tmr 2] 83 | } 84 | } 85 | } 86 | 87 | proc voiceonmsg:remove:the_list {h chan} { 88 | global black 89 | if {[info exists black(voiceonmsg:list:$chan)]} { 90 | if {[lsearch -exact [string tolower $black(voiceonmsg:list:$chan)] [string tolower $h]] > -1} { 91 | set position [lsearch -exact [string tolower $black(voiceonmsg:list:$chan)] [string tolower $h]] 92 | set black(voiceonmsg:list:$chan) [lreplace $black(voiceonmsg:list:$chan) $position $position] 93 | } 94 | } 95 | } 96 | 97 | proc voiceonmsg:remove:expire {host chan} { 98 | global black 99 | foreach tmr [utimers] { 100 | if {[string match "*voiceonmsg:remove:expire $host $chan*" [join [lindex $tmr 1]]]} { 101 | killutimer [lindex $tmr 2] 102 | } 103 | } 104 | if {[info exists black(voiceonmsg:$host:$chan)]} { 105 | unset black(voiceonmsg:$host:$chan) 106 | } 107 | } 108 | 109 | proc voiceonmsg:changenick {nick host hand chan newnick} { 110 | global black 111 | if {![validchan $chan]} { 112 | return 113 | } 114 | if {[setting:get $chan voiceonmsg]} { 115 | if {[info exists black(voiceonmsg:list:$chan)] && $black(voiceonmsg:list:$chan) != ""} { 116 | set h $nick 117 | if {[lsearch -exact [string tolower $black(voiceonmsg:list:$chan)] [string tolower $h]] > -1} { 118 | set position [lsearch -exact [string tolower $black(voiceonmsg:list:$chan)] [string tolower $h]] 119 | set black(voiceonmsg:list:$chan) [lreplace $black(voiceonmsg:list:$chan) $position $position] 120 | } 121 | lappend black(voiceonmsg:list:$chan) $newnick 122 | if {[info exists black(voiceonmsg:$h:$chan)]} { 123 | set black(voiceonmsg:$newnick:$chan) $black(voiceonmsg:$h:$chan) 124 | unset black(voiceonmsg:$h:$chan) 125 | } 126 | } 127 | } 128 | } 129 | 130 | proc voiceonmsg:part {nick host hand chan arg} { 131 | global black 132 | voiceonmsg:remove:expire $host $chan 133 | voiceonmsg:remove:the_list $host $chan 134 | } 135 | 136 | proc voiceonmsg:split {nick host hand chan args} { 137 | global black 138 | voiceonmsg:remove:expire $host $chan 139 | voiceonmsg:remove:the_list $host $chan 140 | } 141 | 142 | proc voiceonmsg:kick {nick host hand chan kicked reason} { 143 | global black 144 | set kickhost [getchanhost $kicked $chan] 145 | voiceonmsg:remove:expire $kickhost $chan 146 | voiceonmsg:remove:the_list $kickhost $chan 147 | } 148 | 149 | proc voiceonmsg:timer {chans} { 150 | global black 151 | set channels "" 152 | foreach chan $chans { 153 | lappend channels $chan 154 | } 155 | if {$channels != ""} { 156 | voiceonmsg:act $channels 0 157 | } 158 | } 159 | 160 | proc voiceonmsg:act {channels counter} { 161 | global black 162 | set chan [lindex $channels $counter] 163 | set cc [expr $counter + 1] 164 | if {[info exists black(voiceonmsg:list:$chan)] && $black(voiceonmsg:list:$chan) != ""} { 165 | foreach nick [chanlist $chan] { 166 | set h [getchanhost $nick $chan] 167 | set position [lsearch -exact [string tolower $black(voiceonmsg:list:$chan)] [string tolower $h]] 168 | if {$position > -1} { 169 | set handle [nick2hand $nick $chan] 170 | if {![matchattr $handle "-|gf" $chan]} { 171 | set idletime [setting:get $chan voiceonmsg-idletime] 172 | if {$idletime == ""} { 173 | set idletime $black(voiceonmsg:idletime) 174 | } 175 | set idletime [time_return_minute $idletime] 176 | if {[getchanidle $nick $chan] >= $idletime} { 177 | if {[isvoice $nick $chan]} { 178 | if {[setting:get $chan xonly] && [onchan $black(chanserv) $chan]} { 179 | putserv "PRIVMSG $black(chanserv) :devoice $chan $nick" 180 | } else { 181 | utimer 2 [list pushmode $chan -v $nick] 182 | } 183 | } 184 | voiceonmsg:remove:expire $h $chan 185 | voiceonmsg:remove:the_list $h $chan 186 | } 187 | } 188 | } else { 189 | 190 | if {![info exists black(voiceonmsg:$h:$chan)]} { 191 | voiceonmsg:remove:the_list $h $chan 192 | } else { 193 | voiceonmsg:remove:expire $h $chan 194 | voiceonmsg:remove:the_list $h $chan 195 | } 196 | } 197 | } 198 | } 199 | if {[lindex $channels $cc] == ""} { 200 | return 201 | } else { 202 | voiceonmsg:act $channels $cc 203 | } 204 | } 205 | 206 | proc remove:flood:join {chan} { 207 | global black 208 | if {[info exists black(countflood:join:$chan)]} { 209 | unset black(countflood:join:$chan) 210 | } 211 | } 212 | 213 | ############## 214 | ######################################################################### 215 | ## END ## 216 | ######################################################################### 217 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.Alias.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ############################ ALIAS 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 | ### 18 | proc alias:process {nick host hand chan chan1 type arg} { 19 | global botnick black username 20 | set cmd_status [btcmd:status $chan $hand "alias" 0] 21 | if {$cmd_status == "1"} { 22 | return 23 | } 24 | if {[matchattr $hand q]} { blacktools:tell_v2 $nick $host $hand $chan $chan1 gl.glsuspend none 25 | return 26 | } 27 | if {[matchattr $hand -|q $chan]} { blacktools:tell_v2 $nick $host $hand $chan $chan1 gl.suspend none 28 | return 29 | } 30 | set what [lindex $arg 0] 31 | set cmd [lindex $arg 1] 32 | set cmd_used [lindex $arg 2] 33 | set text [lindex $arg 3] 34 | set text2 [join [lrange $arg 2 3]] 35 | switch [string tolower $what] { 36 | add { 37 | if {$cmd == ""} { 38 | blacktools:tell_v2 $nick $host $hand $chan $chan1 alias.1 none 39 | return 40 | } 41 | if {$cmd_used == ""} { 42 | blacktools:tell_v2 $nick $host $hand $chan $chan1 alias.1 none 43 | return 44 | } 45 | set valid [blacktools:alias_valid $hand $cmd_used $chan] 46 | if {$valid == 1} { 47 | set exists [blacktools:alias_check $hand $cmd] 48 | if {$exists != 0} { 49 | blacktools:tell_v2 $nick $host $hand $chan $chan1 alias.3 [list $cmd $exists] 50 | return 51 | } else { 52 | if {$text == ""} { 53 | set text $cmd_used 54 | } else { 55 | set text $text2 56 | } 57 | blacktools:tell_v2 $nick $host $hand $chan $chan1 alias.4 [list $cmd $text] 58 | blacktools:alias_add $hand $cmd $text 59 | } 60 | } else { 61 | blacktools:tell_v2 $nick $host $hand $chan $chan1 alias.2 [list $cmd_used] 62 | } 63 | } 64 | del { 65 | set exists [blacktools:alias_check $hand $cmd] 66 | if {$exists == 0} { 67 | blacktools:tell_v2 $nick $host $hand $chan $chan1 alias.5 [list $cmd] 68 | return 69 | } 70 | blacktools:alias_del $hand $cmd 71 | blacktools:tell_v2 $nick $host $hand $chan $chan1 alias.6 [list $cmd] 72 | } 73 | default { 74 | if {$type == "0"} { 75 | blacktools:tell_v2 $nick $host $hand $chan $chan1 gl.instr [list "alias"] 76 | } 77 | if {$type == "1"} { 78 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick [list "alias"] 79 | } 80 | if {$type == "2"} { 81 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv [list "alias"] 82 | } 83 | } 84 | } 85 | } 86 | 87 | ### 88 | proc blacktools:alias_check {hand command} { 89 | global black 90 | set file [open $black(alias_file) r] 91 | set data [read -nonewline $file] 92 | close $file 93 | set found "" 94 | set split_data [split $data "\n"] 95 | foreach line $split_data { 96 | set read_hand [lindex [split $line] 0] 97 | set read_cmd [lindex [split $line] 1] 98 | if {[string equal -nocase $read_cmd $command] && [string equal -nocase $read_hand $hand]} { 99 | set found [lrange [split $line] 2 end] 100 | break 101 | } 102 | } 103 | if {$found == ""} {return 0} else { 104 | return $found 105 | } 106 | } 107 | 108 | ### 109 | proc blacktools:alias_get {hand chan} { 110 | global black 111 | set file [open $black(alias_file) r] 112 | set data [read -nonewline $file] 113 | close $file 114 | set split_data [split $data "\n"] 115 | set output "" 116 | foreach line $split_data { 117 | set read_hand [lindex [split $line] 0] 118 | if {[string equal -nocase $hand $read_hand]} { 119 | set cmd [lindex [split $line] 1] 120 | set cmd_used [lindex [split $line] 2] 121 | set rest [lrange [split $line] 2 end] 122 | set check_valid [blacktools:alias_valid $hand $cmd_used $chan] 123 | if {$check_valid == 0} {continue} 124 | lappend output "[black:color 1 $hand $cmd] \[[black:color 6 $hand $rest]\]" 125 | } 126 | } 127 | if {$output == ""} {return 0} else { 128 | return [join $output " ; "] 129 | } 130 | } 131 | 132 | ### 133 | proc blacktools:alias_valid {hand cmd chan} { 134 | set cmds_op "alias note q troll vr dr bot n id spam bw mb b ub sb banlist r man h version seen info userlist mode cycle ho o t k w ungag gag clonescan myset i next helped noidle skip" 135 | set cmds_admin "alias note q troll vr dr bot n id spam bw mb black bl b ub sb banlist r man auto h ignore version stats seen us s info userlist delhost delacc add omsg mode cycle say v ho o t k w ungag gag clonescan topwords myset i next helped noidle skip" 136 | set cmds_manager "alias exempt anunt note q enable disable securemode troll guestnick badhost antispam badrealname badquitpart badident badnick badword unset greet leave topic vr dr n id spam bw mb black bl b stick ub sb banlist r man auto antipub private h ignore idle version stats seen limit badchan us s info userlist chuser delhost addhost del delacc add omsg set mode cycle purge act say v ho o t k w ungag gag show clonescan topwords myset i badword next helped noidle skip" 137 | set cmds_master "alias exempt anunt anunt note q enable disable securemode troll guestnick badhost antispam badrealname badquitpart badident badnick badword unset greet leave topic vr dr n id spam bw mb black bl b stick ub sb banlist r man auto antipub private h ignore idle version stats seen limit badchan us s info channels userlist chuser delhost addhost del delacc add unsuspend suspend delchan addchan msg omsg set mode cycle act say v ho o uptime status t k w gag show clonescan topwords myset i badword next helped noidle skip" 138 | set cmds_owner "alias exempt login anunt link note q enable disable securemode cp troll guestnick badhost antispam badrealname badquitpart badident badnick badword unset greet leave topic vr dr n id spam bw mb black bl b stick ub sb banlist r man auto antipub private h ignore idle version stats chat seen limit bt badchan us s info channels userlist chuser delhost addhost del delacc add unsuspend suspend delchan addchan die jump save restart rehash nick msg omsg set mode cycle broadcast act say v ho o uptime status t k w ungag gag show clonescan topwords myset timer i badword next helped noidle skip" 139 | set cmds_boss "alias exempt login anunt link note q enable disable securemode cp troll guestnick badhost antispam badrealname badquitpart badident badnick badword unset greet leave topic vr dr n id spam bw mb black bl b stick ub sb banlist r man auto antipub private tcl h ignore idle version stats chat seen limit bt badchan us s info channels userlist chuser delhost addhost del delacc add unsuspend suspend delchan addchan die jump save restart rehash update nick msg omsg set mode cycle broadcast act say v ho o uptime status t k w ungag gag show clonescan topwords myset timer i badword next helped noidle skip" 140 | if {[matchattr $hand n]} { 141 | if {[lsearch -nocase $cmds_boss $cmd] > -1} { 142 | return 1 143 | } else {return 0} 144 | } elseif {[matchattr $hand m]} { 145 | if {[lsearch -nocase $cmds_owner $cmd] > -1} { 146 | return 1 147 | } else {return 0} 148 | } elseif {[matchattr $hand o]} { 149 | if {[lsearch -nocase $cmds_master $cmd] > -1} { 150 | return 1 151 | } else {return 0} 152 | } elseif {[matchattr $hand -|M $chan]} { 153 | if {[lsearch -nocase $cmds_manager $cmd] > -1} { 154 | return 1 155 | } else {return 0} 156 | } elseif {[matchattr $hand -|A $chan]} { 157 | if {[lsearch -nocase $cmds_admin $cmd] > -1} { 158 | return 1 159 | } else {return 0} 160 | } elseif {[matchattr $hand -|O $chan]} { 161 | if {[lsearch -nocase $cmds_op $cmd] > -1} { 162 | return 1 163 | } else {return 0} 164 | } 165 | } 166 | 167 | ### 168 | proc blacktools:alias_add {hand command text} { 169 | global black 170 | set file [open $black(alias_file) a] 171 | puts $file "$hand $command $text" 172 | close $file 173 | return 1 174 | } 175 | 176 | ### 177 | proc blacktools:alias_del {hand command} { 178 | global black 179 | set file [open $black(alias_file) "r"] 180 | set timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}] 181 | set temp "$black(tempdir)/notes_temp.$timestamp" 182 | set tempwrite [open $temp w] 183 | while {[gets $file line] != -1} { 184 | set read_hand [lindex [split $line] 0] 185 | set read_cmd [lindex [split $line] 1] 186 | if {[string equal -nocase $read_hand $hand] && [string equal -nocase $read_cmd $command]} { 187 | continue 188 | } else { 189 | puts $tempwrite $line 190 | } 191 | } 192 | close $tempwrite 193 | close $file 194 | file rename -force $temp $black(alias_file) 195 | return 1 196 | } 197 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.Idle.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ############################# IDLE 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 antidle:process {why type user host nick hand chan chan1} { 18 | global botnick black 19 | set show_user $user 20 | set flag "-|+f" 21 | set handle [nick2hand $user] 22 | if {[matchattr $hand q]} { 23 | blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none 24 | return 25 | } 26 | if {[matchattr $hand -|q $chan]} { 27 | blacktools:tell $nick $host $hand $chan $chan1 gl.suspend none 28 | return 29 | } 30 | if {($why == "") && ($type == "0")} { 31 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "idle" 32 | return 33 | } 34 | if {($why == "") && ($type == "1")} { 35 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "idle" 36 | return 37 | } 38 | if {($why == "") && ($type == "2")} { 39 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "idle" 40 | return 41 | } 42 | if {![validchan $chan]} { 43 | blacktools:tell $nick $host $hand $chan $chan1 gl.novalidchan none 44 | return 45 | } 46 | 47 | if {![onchan $botnick $chan]} { 48 | blacktools:tell $nick $host $hand $chan $chan1 gl.notonchan none 49 | return 50 | } 51 | 52 | switch [string tolower $why] { 53 | 54 | +o { 55 | antidle:set $chan 56 | setting:set $chan +idleop "" 57 | blacktools:tell $nick $host $hand $chan $chan1 idle.11 none 58 | } 59 | -o { 60 | setting:set $chan -idleop "" 61 | blacktools:tell $nick $host $hand $chan $chan1 idle.12 none 62 | antidle:unset $chan 63 | } 64 | -ho { 65 | setting:set $chan -idlehalfop "" 66 | blacktools:tell $nick $host $hand $chan $chan1 idle.26 none 67 | antidle:unset $chan 68 | } 69 | +v { 70 | antidle:set $chan 71 | setting:set $chan +idlevoice "" 72 | blacktools:tell $nick $host $hand $chan $chan1 idle.14 none 73 | } 74 | +ho { 75 | antidle:set $chan 76 | setting:set $chan +idlehalfop "" 77 | blacktools:tell $nick $host $hand $chan $chan1 idle.25 none 78 | } 79 | -v { 80 | setting:set $chan -idlevoice "" 81 | blacktools:tell $nick $host $hand $chan $chan1 idle.15 none 82 | antidle:unset $chan 83 | } 84 | 85 | add { 86 | 87 | if {$user == ""} { 88 | if {$type == "0"} { 89 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "idle" 90 | return 91 | } 92 | if {$type == "1"} { 93 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "idle" 94 | } 95 | return 96 | } 97 | 98 | if {[onchan $user $chan]} { 99 | set getuser [nick2hand $user] 100 | if {$getuser != "*"} { 101 | set user $getuser 102 | } 103 | } 104 | 105 | if {[validuser $user]} { 106 | chattr $user $flag $chan 107 | blacktools:tell $nick $host $hand $chan $chan1 idle.18 $show_user 108 | } else { 109 | 110 | set hosts [getchanhost $user $chan] 111 | set uhost "*!*@[lindex [split $hosts @] 1]" 112 | adduser $user $uhost 113 | chattr $user $flag $chan 114 | blacktools:tell $nick $host $hand $chan $chan1 idle.19 "$show_user $uhost" 115 | } 116 | } 117 | 118 | list { 119 | set list [userlist "-|f" $chan] 120 | blacktools:tell $nick $host $hand $chan $chan1 idle.20 "none" 121 | if {$list == ""} {set list "NONE"} 122 | blacktools:tell $nick $host $hand $chan $chan1 idle.21 "$list" 123 | } 124 | 125 | del { 126 | 127 | if {$user == ""} { 128 | if {$type == "0"} { 129 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "idle" 130 | return 131 | } 132 | if {$type == "1"} { 133 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "idle" 134 | } 135 | return 136 | } 137 | 138 | if {[onchan $user $chan]} { 139 | set getuser [nick2hand $user] 140 | if {$getuser != "*"} { 141 | set user $getuser 142 | } 143 | } 144 | 145 | if {![validuser $user]} { 146 | blacktools:tell $nick $host $hand $chan $chan1 idle.22 "$show_user" 147 | return 148 | } 149 | 150 | if {![matchattr $user "-|f" $chan]} { 151 | blacktools:tell $nick $host $hand $chan $chan1 idle.23 "$show_user" 152 | return 153 | } 154 | chattr $user -|-f $chan 155 | blacktools:tell $nick $host $hand $chan $chan1 idle.24 "$show_user" 156 | } 157 | 158 | default { 159 | 160 | if {$type == "0"} { 161 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "idle" 162 | return 163 | } 164 | if {$type == "1"} { 165 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "idle" 166 | } 167 | } 168 | } 169 | } 170 | 171 | proc antidle:unset {chan} { 172 | global black 173 | set idle_activ 0 174 | set options {idleop idlevoice idlehalfop} 175 | foreach option $options { 176 | if {[setting:get $chan $option]} { 177 | set idle_activ 1 178 | } 179 | } 180 | if {$idle_activ == "0"} { 181 | if {[info exists black(idle:$chan:timer_start)]} { 182 | unset black(idle:$chan:timer_start) 183 | } 184 | if {[info exists black(idle:counter:$chan)]} { 185 | unset black(idle:counter:$chan) 186 | } 187 | } 188 | } 189 | 190 | proc antidle:set {chan} { 191 | global black 192 | set idle_activ 0 193 | set options {idleop idlevoice idlehalfop} 194 | foreach option $options { 195 | if {[setting:get $chan $option]} { 196 | set idle_activ 1 197 | } 198 | } 199 | 200 | if {$idle_activ == "0"} { 201 | if {[setting:get $chan idle-scantime] != ""} { 202 | set time [setting:get $chan idle-scantime] 203 | } else { 204 | set time $black(idleinterval) 205 | } 206 | set scan_time [time_return_minute $time] 207 | set black(idle:$chan:timer_start) $scan_time 208 | } 209 | } 210 | 211 | proc antidle:module {chans} { 212 | global black 213 | set channels "" 214 | foreach chan $chans { 215 | if {[validchan $chan]} { 216 | if {[info exists black(secure_mode:$chan)]} {continue} 217 | lappend channels $chan 218 | } 219 | } 220 | if {$channels != ""} { 221 | idlewhois $channels 0 222 | } 223 | } 224 | 225 | proc idlewhois {channels counter} { 226 | global black botnick 227 | set chan [lindex $channels $counter] 228 | set cc [expr $counter + 1] 229 | if {$chan != ""} { 230 | black:check:idle $chan 231 | utimer 30 [list idlewhois $channels $cc] 232 | } else { 233 | return 234 | } 235 | } 236 | 237 | proc black:check:idle {chan} { 238 | global black 239 | set ::idle_chan $chan 240 | foreach user [chanlist $chan] { 241 | set handle [nick2hand $user] 242 | if {[isop $user $chan] || [isvoice $user $chan] || [ishalfop $user $chan]} { 243 | if {![isbotnick $user]} { 244 | putserv "WHOIS $user $user" 245 | } 246 | } 247 | } 248 | bind raw - 317 idleprocespublic 249 | } 250 | 251 | proc idleprocespublic {nick int arg} { 252 | global black 253 | set nick [string tolower [lindex [split $arg] 1]] 254 | set handle [nick2hand $nick] 255 | set idler [string tolower [lindex [split $arg] 2]] 256 | set minutesidle [expr $idler / 60] 257 | set chan $::idle_chan 258 | if {[onchan $nick $chan]} { 259 | set idlevoicetime [setting:get $chan idlevoicemax] 260 | if {$idlevoicetime == ""} { set idlevoicetime "$black(idlevoicemax)" } 261 | set idleoptime [setting:get $chan idleopmax] 262 | if {$idleoptime == ""} { set idleoptime "$black(idleopmax)" } 263 | set idlehalfoptime [setting:get $chan idlehalfopmax] 264 | if {$idlehalfoptime == ""} { set idlehalfoptime "$black(idlehalfopmax)" } 265 | set idlevoicetime [time_return_minute $idlevoicetime] 266 | set idleoptime [time_return_minute $idleoptime] 267 | set idlehalfoptime [time_return_minute $idlehalfoptime] 268 | if {![info exists black(voiceonmsg:$nick:$chan)]} { 269 | if {[setting:get $chan idlevoice]} { 270 | if {(![matchattr $handle "-|gf" $chan]) && [isvoice $nick $chan]} { 271 | if {$minutesidle > $idlevoicetime} { 272 | if {[setting:get $chan xonly] && [onchan $black(chanserv) $chan]} { 273 | putserv "PRIVMSG $black(chanserv) :devoice $chan $nick" 274 | } else { 275 | pushmode $chan -v $nick 276 | } 277 | } 278 | } 279 | } 280 | 281 | if {[setting:get $chan idleop]} { 282 | if {(![matchattr $handle "-|af" $chan]) && [isop $nick $chan]} { 283 | if {$minutesidle > $idleoptime} { 284 | if {[setting:get $chan xonly] && [onchan $black(chanserv) $chan]} { 285 | putserv "PRIVMSG $black(chanserv) :deop $chan $nick" 286 | } else { 287 | pushmode $chan -o $nick 288 | } 289 | } 290 | } 291 | } 292 | if {[setting:get $chan idlehalfop]} { 293 | if {(![matchattr $handle "-|f" $chan]) && [ishalfop $nick $chan]} { 294 | if {$minutesidle > $idlehalfoptime} { 295 | if {[setting:get $chan xonly] && [onchan $black(chanserv) $chan]} { 296 | return 297 | } else { 298 | pushmode $chan -h $nick 299 | } 300 | } 301 | } 302 | } 303 | } 304 | } 305 | } 306 | 307 | ############## 308 | ######################################################################### 309 | ## END ## 310 | ######################################################################### 311 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.Anunt.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ######################## ANUNT/ADVERT 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 anunt:process {nick host hand chan chan1 who message number type} { 18 | global botnick black username 19 | set cmd_status [btcmd:status $chan $hand "anunt" 0] 20 | if {$cmd_status == "1"} { 21 | return 22 | } 23 | set show_message $message 24 | set num 0 25 | set temp_num 0 26 | if {[matchattr $hand q]} { blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none 27 | return 28 | } 29 | if {[matchattr $hand -|q $chan]} { blacktools:tell $nick $host $hand $chan $chan1 gl.suspend none 30 | return 31 | } 32 | if {$who == ""} { 33 | if {$type == "0"} { 34 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "anunt" 35 | } 36 | if {$type == "1"} { 37 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "anunt" 38 | } 39 | if {$type == "2"} { 40 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "anunt" 41 | } 42 | return 43 | } 44 | 45 | if {![validchan $chan]} { 46 | blacktools:tell $nick $host $hand $chan $chan1 gl.novalidchan none 47 | return 48 | } 49 | switch [string tolower $who] { 50 | on { 51 | setting:set $chan +anunt "" 52 | blacktools:tell $nick $host $hand $chan $chan1 anunt.3 none 53 | if {[setting:get $chan anunt-showtime] != ""} { 54 | set time [setting:get $chan anunt-showtime] 55 | } else { 56 | set time $black(anunttime) 57 | } 58 | set scan_time [time_return_minute $time] 59 | set black(anunt:$chan:timer_start) $scan_time 60 | } 61 | 62 | off { 63 | setting:set $chan -anunt "" 64 | blacktools:tell $nick $host $hand $chan $chan1 anunt.4 none 65 | if {[info exists black(anunt:$chan:timer_start)]} { 66 | unset black(anunt:$chan:timer_start) 67 | } 68 | if {[info exists black(anunt:counter:$chan)]} { 69 | unset black(anunt:counter:$chan) 70 | } 71 | } 72 | 73 | add { 74 | if {$message == ""} { 75 | if {$type == "0"} { 76 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "anunt" 77 | } 78 | if {$type == "1"} { 79 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "anunt" 80 | } 81 | if {$type == "2"} { 82 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "anunt" 83 | } 84 | return 85 | } 86 | 87 | while {$temp_num == 0} { 88 | set get [find:num $num $chan "ANUNT"] 89 | if {$get == "$num"} { 90 | set num [expr $num + 1] 91 | } else { set temp_num 1 } 92 | } 93 | set file [open $black(add_file) a] 94 | set encoded [encoding convertto utf-8 $message] 95 | set enc_chan [encoding convertto utf-8 $chan] 96 | puts $file "$enc_chan ANUNT $num $encoded" 97 | close $file 98 | blacktools:tell $nick $host $hand $chan $chan1 anunt.5 $num 99 | blacktools:tell $nick $host $hand $chan $chan1 anunt.1 $show_message 100 | } 101 | list { 102 | array set anuntlist [list] 103 | set timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}] 104 | set temp "$black(tempdir)/anunt_temp.$timestamp" 105 | set file [open $black(add_file) r] 106 | set size [file size $black(add_file)] 107 | set data [split [read $file $size] \n] 108 | close $file 109 | foreach line $data { 110 | set read_chan [lindex [split $line] 0] 111 | set enc_chan [encoding convertfrom utf-8 $read_chan] 112 | set read_type [lindex [split $line] 1] 113 | if {[string match -nocase $enc_chan $chan] && [string match -nocase $read_type "ANUNT"]} { 114 | set msg_num [lindex [split $line] 2] 115 | set message [join [lrange [split $line] 3 end]] 116 | lappend anuntlist($msg_num) $message 117 | } 118 | } 119 | set tempwrite [open $temp w] 120 | foreach msg [lsort -integer -increasing [array names anuntlist]] { 121 | puts $tempwrite "$msg [join $anuntlist($msg)]" 122 | } 123 | close $tempwrite 124 | set file [open $temp "r"] 125 | set w [read -nonewline $file] 126 | close $file 127 | set data [split $w "\n"] 128 | file delete $temp 129 | module:getinfo $nick $host $hand $chan $chan1 $type $data "anunt" "0" $number 130 | } 131 | 132 | del { 133 | 134 | if {![regexp {^[0-9]} $number]} { 135 | if {$type == "0"} { 136 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "anunt" 137 | } 138 | if {$type == "1"} { 139 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "anunt" 140 | } 141 | if {$type == "2"} { 142 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "anunt" 143 | } 144 | return 145 | } 146 | set ret [find:num $number $chan "ANUNT"] 147 | if {$ret == 0} { 148 | blacktools:tell $nick $host $hand $chan $chan1 anunt.13 $number 149 | return 150 | } 151 | set file [open $black(add_file) "r"] 152 | set timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}] 153 | set temp "$black(tempdir)/anunt_temp.$timestamp" 154 | set tempwrite [open $temp w] 155 | while {[gets $file line] != -1} { 156 | set read_num [lindex [split $line] 2] 157 | set read_chan [lindex [split $line] 0] 158 | set enc_chan [encoding convertfrom utf-8 $read_chan] 159 | set read_type [lindex [split $line] 1] 160 | if {[string equal $number $read_num] && [string equal -nocase $enc_chan $chan] && [string equal -nocase $read_type "ANUNT"]} { 161 | continue 162 | } else { 163 | puts $tempwrite $line 164 | } 165 | } 166 | close $tempwrite 167 | close $file 168 | file rename -force $temp $black(add_file) 169 | 170 | blacktools:tell $nick $host $hand $chan $chan1 anunt.10 $number 171 | } 172 | } 173 | } 174 | 175 | proc anuntpublic:show {chans} { 176 | global black 177 | set channels "" 178 | foreach chan $chans { 179 | if {[validchan $chan]} { 180 | lappend channels $chan 181 | } 182 | } 183 | if {$channels != ""} { 184 | anunt:time $channels 0 185 | } 186 | } 187 | 188 | proc anunt:time {channels counter} { 189 | global black 190 | set chan [lindex $channels $counter] 191 | set cc [expr $counter + 1] 192 | if {$chan != ""} { 193 | anunt:show $chan 194 | } 195 | if {[lindex $channels $cc] == ""} { 196 | return 197 | } else { 198 | anunt:time $channels $cc 199 | } 200 | } 201 | 202 | proc anunt:show {chan} { 203 | global black botnick 204 | set replace(%botnick%) $botnick 205 | set replace(%chan%) $chan 206 | if {[info exists black(lastaction:$chan)]} { 207 | set total_anunt 0 208 | set unixtime [unixtime] 209 | if {[setting:get $chan anunt-showtime] != ""} { 210 | set return_time [time_return_minute [setting:get $chan anunt-showtime]] 211 | } else { 212 | set return_time [time_return_minute $black(anunttime)] 213 | } 214 | set time [expr [expr [expr $return_time * $black(entry:shown)] * 60] + $unixtime] 215 | if {[expr $unixtime - $black(lastaction:$chan)] > [expr $time - $unixtime]} { 216 | return 217 | } 218 | } else { return } 219 | set timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}] 220 | set temp_dir "$black(tempdir)/anunt_temp.$timestamp" 221 | if {![file exists $temp_dir]} { 222 | set file [open $temp_dir w] 223 | close $file 224 | } 225 | set file [open $black(add_file) r] 226 | set size [file size $black(add_file)] 227 | set data [split [read $file $size] \n] 228 | close $file 229 | if {$data != ""} { 230 | set file [open $temp_dir "a"] 231 | foreach line $data { 232 | set read_chan [lindex [split $line] 0] 233 | set enc_chan [encoding convertfrom utf-8 $read_chan] 234 | set read_type [lindex [split $line] 1] 235 | if {[string match -nocase $enc_chan $chan] && [string match -nocase $read_type "ANUNT"]} { 236 | puts $file [lrange [split $line] 3 end] 237 | set total_anunt [expr $total_anunt + 1] 238 | } 239 | } 240 | close $file 241 | } 242 | set file [open $temp_dir "r"] 243 | set data [read -nonewline $file] 244 | close $file 245 | if {$data != ""} { 246 | 247 | if {![info exists black(anuntshow:$chan)]} { 248 | set black(anuntshow:$chan) 0 249 | } 250 | set lines [split $data "\n"] 251 | set line [lindex $lines $black(anuntshow:$chan)] 252 | 253 | if {$line == ""} { 254 | set black(anuntshow:$chan) 0 255 | set line [lindex $lines $black(anuntshow:$chan)] 256 | } 257 | set split_line [split $line "~"] 258 | set black(anuntshow:$chan) [expr $black(anuntshow:$chan) + 1] 259 | foreach mes $split_line { 260 | set mes [string map [array get replace] $mes] 261 | set encoded [encoding convertfrom utf-8 $mes] 262 | 263 | if {$black(anunthow) == "1"} { 264 | puthelp "PRIVMSG $chan :\001ACTION \[$black(anuntshow:$chan)/$total_anunt\] [join $encoded]\001" 265 | } else { 266 | puthelp "PRIVMSG $chan :\[$black(anuntshow:$chan)/$total_anunt\] [join $encoded]" 267 | } 268 | } 269 | } 270 | file delete $temp_dir 271 | } 272 | 273 | ############## 274 | ######################################################################### 275 | ## END ## 276 | ######################################################################### 277 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.TCL.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ############################### 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 tcl:process {nick host hand chan chan1 type the_script who} { 18 | global black config 19 | set cmd_status [btcmd:status $chan $hand "tcl" 0] 20 | if {$cmd_status == "1"} { 21 | return 22 | } 23 | set current_tcl "" 24 | set tcl_exists 0 25 | 26 | if {$who == ""} { 27 | if {$type == "0"} { 28 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "tcl" 29 | } 30 | if {$type == "1"} { 31 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "tcl" 32 | } 33 | if {$type == "2"} { 34 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "tcl" 35 | } 36 | return 37 | } 38 | 39 | switch $who { 40 | 41 | wget { 42 | if {$the_script == ""} { 43 | if {$type == "0"} { 44 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "tcl" 45 | } 46 | if {$type == "1"} { 47 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "tcl" 48 | } 49 | if {$type == "2"} { 50 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "tcl" 51 | } 52 | return 53 | } 54 | 55 | if {![string match -nocase "*.tcl" $the_script]} { 56 | if {$type == "0"} { 57 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "tcl" 58 | } 59 | if {$type == "1"} { 60 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "tcl" 61 | } 62 | if {$type == "2"} { 63 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "tcl" 64 | } 65 | return 66 | } 67 | set split_thescript [split $the_script "/"] 68 | foreach s $split_thescript { 69 | if {[string match -nocase "*.tcl" $s]} { 70 | if {[check:if:valid $s] == "1"} { 71 | set current_tcl $s 72 | set tcl_exists 1 73 | } else { 74 | set current_tcl $s 75 | } 76 | } 77 | } 78 | 79 | if {$tcl_exists == "1"} { 80 | blacktools:tell $nick $host $hand $chan $chan1 tcl.21 $s 81 | return 82 | } 83 | set wget [catch {exec wget $the_script -P $black(dirname)/ 2>/dev/null} wget_stat] 84 | if {[string match -nocase "*exited abnormally*" $wget_stat]} { 85 | blacktools:tell $nick $host $hand $chan $chan1 tcl.19 $current_tcl 86 | return 87 | } 88 | putserv "PRIVMSG $chan :$wget_stat" 89 | blacktools:tell $nick $host $hand $chan $chan1 tcl.20 $current_tcl 90 | } 91 | 92 | load { 93 | if {$the_script == ""} { 94 | if {$type == "0"} { 95 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "tcl" 96 | } 97 | if {$type == "1"} { 98 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "tcl" 99 | } 100 | if {$type == "2"} { 101 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "tcl" 102 | } 103 | return 104 | } 105 | set black(tcl_load) [catch {source "$black(dirname)/$the_script"} black(tcl_load_error)] 106 | 107 | if {$black(tcl_load) == "1"} { 108 | blacktools:tell $nick $host $hand $chan $chan1 tcl.3 "$the_script [split $black(tcl_load_error)]" 109 | return 110 | } 111 | set file [open "$config" r] 112 | set w [read -nonewline $file] 113 | close $file 114 | set counter -1 115 | set data [split $w "\n"] 116 | set tcl_position -1 117 | set found_it 0 118 | foreach line $data { 119 | if {[string match -nocase "source $black(dirname)/*" $line]} { 120 | set the_split [split $line "/"] 121 | set script [lindex $the_split 1] 122 | if {[string equal -nocase $script $the_script]} { 123 | set found_it 1 124 | } 125 | } 126 | } 127 | if {$found_it == 1} { 128 | blacktools:tell $nick $host $hand $chan $chan1 tcl.4 $the_script 129 | return 130 | } 131 | set file [open "$config" a] 132 | puts $file "source $black(dirname)/$the_script" 133 | close $file 134 | rehash 135 | blacktools:tell $nick $host $hand $chan $chan1 tcl.5 $the_script 136 | 137 | } 138 | unload { 139 | if {$the_script == ""} { 140 | if {$type == "0"} { 141 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "tcl" 142 | } 143 | if {$type == "1"} { 144 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "tcl" 145 | } 146 | if {$type == "2"} { 147 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "tcl" 148 | } 149 | return 150 | } 151 | if {[string match -nocase "*BlackTools*" $the_script]} { 152 | blacktools:tell $nick $host $hand $chan $chan1 tcl.18 none 153 | return 154 | } 155 | 156 | set file [open "$config" r] 157 | set w [read -nonewline $file] 158 | close $file 159 | set counter -1 160 | set data [split $w "\n"] 161 | set tcl_position -1 162 | set found_it 0 163 | foreach line $data { 164 | set counter [expr $counter + 1] 165 | if {[string match -nocase "*source $black(dirname)/*" $line]} { 166 | set the_split [split $line "/"] 167 | set script [lindex $the_split 1] 168 | if {[string equal -nocase $script $the_script]} { 169 | set found_it 1 170 | set tcl_position $counter 171 | } 172 | } 173 | } 174 | if {$found_it == 0} { 175 | blacktools:tell $nick $host $hand $chan $chan1 tcl.7 $the_script 176 | return 177 | } 178 | 179 | set delete [lreplace $data $tcl_position $tcl_position] 180 | set file [open "$config" "w"] 181 | puts $file [join $delete "\n"] 182 | close $file 183 | rehash 184 | blacktools:tell $nick $host $hand $chan $chan1 tcl.8 [split $the_script] 185 | } 186 | 187 | list { 188 | set the_files [glob -directory $black(dirname) "*.tcl"] 189 | set current_tcl "" 190 | set counter 0 191 | set found_tcl 0 192 | set timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}] 193 | set temp "$black(tempdir)/tcl_temp.$timestamp" 194 | array set tcllist [list] 195 | set num_l 1 196 | set num 0 197 | foreach file $the_files { 198 | set split_file [split $file "/"] 199 | set the_file [lindex $split_file 1] 200 | if {[string match -nocase "*.tcl" $the_file]} { 201 | set found_tcl 1 202 | } 203 | set status [check:if:load $the_file] 204 | if {$status == "1"} { 205 | lappend tcllist(1) $the_file 206 | } else { 207 | lappend tcllist(2) $the_file 208 | } 209 | unset status 210 | } 211 | 212 | if {$found_tcl == "0"} { 213 | blacktools:tell $nick $host $hand $chan $chan1 tcl.2 "tcl" 214 | return 215 | } 216 | 217 | set tempwrite [open $temp w] 218 | foreach n [lsort -integer -increasing [array names tcllist]] { 219 | foreach tcl $tcllist($n) { 220 | set counter [expr $counter + 1] 221 | if {$n == "1"} { 222 | puts $tempwrite "$counter \002$tcl\002" 223 | } elseif {$n == "2"} { 224 | puts $tempwrite "$counter $tcl" 225 | } 226 | } 227 | } 228 | close $tempwrite 229 | 230 | set file [open $temp "r"] 231 | set w [read -nonewline $file] 232 | close $file 233 | set data [split $w "\n"] 234 | file delete $temp 235 | module:getinfo $nick $host $hand $chan $chan1 $type $data "tcl" "0" $the_script 236 | } 237 | info { 238 | if {$the_script == ""} { 239 | if {$type == "0"} { 240 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "tcl" 241 | } 242 | if {$type == "1"} { 243 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "tcl" 244 | } 245 | if {$type == "2"} { 246 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "tcl" 247 | } 248 | return 249 | } 250 | set status_valid [check:if:valid $the_script] 251 | set status [check:if:load $the_script] 252 | if {$status_valid == "0"} { 253 | blacktools:tell $nick $host $hand $chan $chan1 tcl.12 $the_script 254 | return 255 | } 256 | if {$status == "0"} { 257 | blacktools:tell $nick $host $hand $chan $chan1 tcl.13 $the_script 258 | } else { 259 | blacktools:tell $nick $host $hand $chan $chan1 tcl.14 $the_script 260 | } 261 | } 262 | default { 263 | if {$type == "0"} { 264 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "tcl" 265 | } 266 | if {$type == "1"} { 267 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "tcl" 268 | } 269 | if {$type == "2"} { 270 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "tcl" 271 | } 272 | return 273 | } 274 | } 275 | } 276 | 277 | proc check:if:valid {tcl} { 278 | global black 279 | set the_files [glob -directory $black(dirname) "*.tcl"] 280 | foreach file $the_files { 281 | set split_file [split $file "/"] 282 | set the_file [lindex $split_file 1] 283 | if {[string equal -nocase $tcl $the_file]} { 284 | return 1 285 | } 286 | } 287 | return 0 288 | } 289 | 290 | proc check:if:load {tcl} { 291 | global black config 292 | set file [open "$config" r] 293 | set w [read -nonewline $file] 294 | close $file 295 | set data [split $w "\n"] 296 | set return [lsearch -all -inline $data "source scripts/$tcl"] 297 | if {$return != ""} { 298 | return 1 299 | } else { 300 | return 0 301 | } 302 | } 303 | 304 | ############## 305 | ######################################################################### 306 | ## END ## 307 | ######################################################################### 308 | -------------------------------------------------------------------------------- /BlackTools/Modules/BT.Gag.tcl: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | ## BlackTools - The Ultimate Channel Control Script ## 3 | ## One TCL. One smart Eggdrop ## 4 | ######################################################################### 5 | ############################# GAG 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 gag:process {gagger time reason nick hand host chan chan1 type} { 18 | global botnick black 19 | set cmd_status [btcmd:status $chan $hand "gag" 0] 20 | if {$cmd_status == "1"} { 21 | return 22 | } 23 | if {[matchattr $hand q]} { blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none 24 | return 25 | } 26 | if {[matchattr $hand -|q $chan]} { blacktools:tell $nick $host $hand $chan $chan1 gl.suspend none 27 | return 28 | } 29 | set split_hand [split $hand ":"] 30 | set gethand [lindex $split_hand 0] 31 | set getlang [string tolower [setting:get $chan lang]] 32 | set return_time [time_return_minute $time] 33 | set counter 0 34 | set num 0 35 | set temp_num 0 36 | set cmd "gag" 37 | set show_gagger $gagger 38 | set show_reason $reason 39 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 40 | set handle [nick2hand $gagger] 41 | if {$gagger == ""} { 42 | switch $type { 43 | 0 { 44 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr $cmd 45 | } 46 | 1 { 47 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick $cmd 48 | } 49 | 2 { 50 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv $cmd 51 | } 52 | } 53 | return 0 54 | } 55 | if {![validchan $chan]} { 56 | blacktools:tell $nick $host $hand $chan $chan1 gl.novalidchan none 57 | return 58 | } 59 | if {![onchan $botnick $chan]} { 60 | blacktools:tell $nick $host $hand $chan $chan1 gl.notonchan none 61 | return 62 | } 63 | 64 | if {[matchattr $handle $black(exceptflags) $chan]} { 65 | blacktools:tell $nick $host $hand $chan $chan1 gl.noban none 66 | return 67 | } 68 | 69 | if {[isbotnick $gagger]} { 70 | return 71 | } 72 | 73 | if {![botisop $chan]} { 74 | blacktools:tell $nick $host $hand $chan $chan1 gl.noop none 75 | return 76 | } 77 | 78 | if {[isop $gagger $chan]} { 79 | blacktools:tell $nick $host $hand $chan $chan1 gl.hasop none 80 | return 81 | } 82 | if {[onchan $gagger $chan]} { 83 | set mask [return_mask [return_host_num $cmd $chan [getchanhost $gagger $chan]] [getchanhost $gagger $chan] $gagger] 84 | } else { 85 | set mask "" 86 | } 87 | 88 | if {[blacktools:isban $mask $chan] == "1"} { 89 | blacktools:tell $nick $host $hand $chan $chan1 gag.4 $show_gagger 90 | return 91 | } 92 | if {[blacktools:isgag $mask $chan] == "1"} { 93 | blacktools:tell $nick $host $hand $chan $chan1 gag.3 $show_gagger 94 | return 95 | } 96 | set split_hand [split $hand ":"] 97 | set handle [lindex $split_hand 0] 98 | set type [lindex $split_hand 1] 99 | if {($return_time > "20160" || $return_time == "0") && [matchattr $handle -|O $chan]} { 100 | blacktools:tell $nick $host $hand $chan $chan1 gag.7 none 101 | return 102 | } 103 | if {$return_time == "-1"} { 104 | set return_time $black(gag_time) 105 | } 106 | set return_time [time_return_minute $return_time] 107 | 108 | if {$mask == ""} { 109 | blacktools:tell $nick $host $hand $chan $chan1 gl.usernotonchan $show_gagger 110 | return 111 | } 112 | 113 | if {$show_reason == ""} { 114 | set getreason [setting:get $chan gag-reason] 115 | if {$getreason == ""} { 116 | set show_reason $black(say.$getlang.gag.6) 117 | } else { 118 | set show_reason $getreason 119 | } 120 | } 121 | 122 | if {[isvoice $gagger $chan]} { 123 | pushmode $chan -v $gagger 124 | } 125 | set getlang [string tolower [setting:get $chan lang]] 126 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 127 | set replace(%chan%) $chan 128 | set replace(%time%) [return_time $getlang [expr [expr [unixtime] + [expr $return_time * 60]] - [unixtime]]] 129 | set replace(%gagger%) $gagger 130 | set text1 [black:color:set "" $black(say.$getlang.gag.10)] 131 | set text2 [black:color:set "" $black(say.$getlang.gag.11)] 132 | set reply1 [join $text1] 133 | set reply2 [join $text2] 134 | set gag_user_message [string map [array get replace] $reply1] 135 | set gag_chan_message [string map [array get replace] $reply2] 136 | putserv "PRIVMSG $chan :$gag_chan_message" 137 | putserv "PRIVMSG $gagger :$gag_user_message" 138 | pushmode $chan +b $mask 139 | set num [blacktools:ban:find_id] 140 | blacktools:addban $nick $mask $hand $chan $chan1 $return_time "GAG" "0" "0" $show_reason "0" "" "" "" 0 $num 141 | 142 | set backchan [join [setting:get $chan backchan]] 143 | if {$backchan == ""} { 144 | return 145 | } 146 | if {!([validchan $backchan]) || !([onchan $botnick $backchan])} { 147 | return 148 | } 149 | set bantime [time_return_minute $return_time] 150 | set bantime [expr $bantime * 60] 151 | set expire [return_time_2 $getlang $bantime] 152 | if {$reason == ""} { set reason "N/A" } 153 | set replace(%banmask%) $mask 154 | set replace(%bantime%) $expire 155 | set replace(%reason%) $reason 156 | set replace(%chan%) $chan 157 | set replace(%nick%) $gethand 158 | set text [black:color:set "" $black(say.$getlang.reportchan.2)] 159 | set reply [join $text] 160 | puthelp "PRIVMSG $backchan :[string map [array get replace] $reply]" 161 | } 162 | 163 | proc gag:part {nick host hand chan arg} { 164 | global black 165 | if {![validchan $chan]} { 166 | return 167 | } 168 | set uhost "$nick![getchanhost $nick $chan]" 169 | gag:leave $nick $uhost $chan 170 | } 171 | 172 | proc gag:split {nick host hand chan args} { 173 | global black 174 | if {![validchan $chan]} { 175 | return 176 | } 177 | set uhost "$nick![getchanhost $nick $chan]" 178 | gag:leave $nick $uhost $chan 179 | } 180 | 181 | proc gag:kick {nick host hand chan kicked reason} { 182 | global black 183 | if {![validchan $chan]} { 184 | return 185 | } 186 | set uhost "$kicked![getchanhost $kicked $chan]" 187 | gag:leave $kicked $uhost $chan 188 | } 189 | 190 | proc gag:leave {nick host chan} { 191 | global black 192 | if {![validchan $chan]} { 193 | return 194 | } 195 | foreach g [blacktools:gaglist $chan] { 196 | set read_host [lindex [split $g] 3] 197 | if {[string match -nocase $read_host $host]} { 198 | pushmode $chan -b $read_host 199 | } 200 | } 201 | } 202 | 203 | ################################# ungag ############################### 204 | 205 | proc ungag:process {gagger nick hand host chan chan1 type} { 206 | global black botnick 207 | set cmd_status [btcmd:status $chan $hand "ungag" 0] 208 | if {$cmd_status == "1"} { 209 | return 210 | } 211 | if {[matchattr $hand q]} { blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none 212 | return 213 | } 214 | if {[matchattr $hand -|q $chan]} { blacktools:tell $nick $host $hand $chan $chan1 gl.suspend none 215 | return 216 | } 217 | set show_gagger $gagger 218 | set getlang [string tolower [setting:get $chan lang]] 219 | if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" } 220 | if {$gagger == ""} { 221 | switch $type { 222 | 0 { 223 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr "ungag" 224 | } 225 | 1 { 226 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_nick "ungag" 227 | } 228 | 2 { 229 | blacktools:tell $nick $host $hand $chan $chan1 gl.instr_priv "ungag" 230 | } 231 | } 232 | return 0 233 | } 234 | 235 | if {![validchan $chan]} { 236 | return 237 | } 238 | if {[onchan $gagger $chan]} { 239 | set mask [return_mask [return_host_num "gag" $chan [getchanhost $gagger $chan]] [getchanhost $gagger $chan] $gagger] 240 | } else { 241 | blacktools:tell $nick $host $hand $chan $chan1 gl.usernotonchan $show_gagger 242 | return 243 | } 244 | 245 | if {[blacktools:isgag $mask $chan] == "0"} { 246 | blacktools:tell $nick $host $hand $chan $chan1 ungag.5 $show_gagger 247 | return 248 | } else { 249 | blacktools:delban $mask $chan "0" "1" 250 | if {[ischanban $mask $chan]} { 251 | pushmode $chan -b $mask 252 | } 253 | set replace(%chan%) $chan 254 | set replace(%gagger%) $gagger 255 | set textgagger [black:color:set "" $black(say.$getlang.ungag.7)] 256 | set textchan [black:color:set "" $black(say.$getlang.ungag.8)] 257 | set reply1 [join $textgagger] 258 | set reply2 [join $textchan] 259 | set ungag_user_message [string map [array get replace] $reply1] 260 | set ungag_chan_message [string map [array get replace] $reply2] 261 | 262 | putserv "PRIVMSG $gagger :$ungag_user_message" 263 | putserv "PRIVMSG $chan :$ungag_chan_message" 264 | set backchan [join [setting:get $chan backchan]] 265 | if {$backchan == ""} { 266 | return 267 | } 268 | if {!([validchan $backchan]) || !([onchan $botnick $backchan])} { 269 | return 270 | } 271 | set replace(%banmask%) $mask 272 | set replace(%chan%) $chan 273 | set replace(%nick%) $hand 274 | set text [black:color:set "" $black(say.$getlang.reportchan.4)] 275 | set reply [join $text] 276 | puthelp "PRIVMSG $backchan :[string map [array get replace] $reply]" 277 | } 278 | } 279 | 280 | proc gag:reban {nick host hand chan args} { 281 | global black 282 | set bans [lindex $args 1] 283 | if {![botisop $chan]} { return } 284 | set check_gag [blacktools:isgag $bans $chan] 285 | if {$check_gag == "1"} { 286 | foreach user [chanlist $chan] { 287 | set gethost "$nick![getchanhost $user $chan]" 288 | if {[string match -nocase $gethost $bans] || [string match -nocase $bans $gethost]} { 289 | pushmode $chan +b $bans 290 | } 291 | } 292 | } 293 | } 294 | 295 | ############## 296 | ######################################################################### 297 | ## END ## 298 | ######################################################################### 299 | --------------------------------------------------------------------------------