瀏覽代碼

Create BT.Loader.tcl

Florian 8 年之前
父節點
當前提交
9c4f9a8d74
共有 1 個文件被更改,包括 74 次插入0 次删除
  1. 74 0
      BlackTools2.5/BlackTools/BT.Loader.tcl

+ 74 - 0
BlackTools2.5/BlackTools/BT.Loader.tcl

@@ -0,0 +1,74 @@
+###########################################################################
+##             BlackTools - The Ultimate Channel Control Script          ##
+##                       One TCL. One smart Eggdrop                      ##
+###########################################################################
+##############################   LOADER TCL   #############################
+###########################################################################
+##						                         ##
+##   BlackTools  : http://blacktools.tclscripts.net	                 ##
+##   Bugs report : http://www.tclscripts.net/	                         ##
+##   Online Help : irc://irc.undernet.org/tcl-help 	                 ##
+##                 #TCL-HELP / UnderNet                                  ##
+##                 You can ask in english or romanian                    ##
+##					                                 ##
+###########################################################################
+
+#Load modules
+
+	set modules_files [glob -directory "$black(dirname)/BlackTools/Modules/" "*.tcl"]
+foreach file $modules_files {
+	set split_file [split $file "."]
+	set themodule [lindex $split_file 1]
+	set black(module_error_$themodule) [catch {source $file} black(module_error_stats_$themodule)]
+if {$black(module_error_$themodule) == "1"} {
+	die "\[BT\] :Couldn't load the module file \"$file\".Reason: \"$black(module_error_stats_$themodule)\""
+	} 
+}
+
+
+#Load cmds
+
+	set cmds_files [glob -directory "$black(dirname)/BlackTools/Commands/" "*.tcl"]
+foreach file $cmds_files {
+	set split_file [split $file "."]
+	set themodule [lindex $split_file 1]
+	set black(cmds_error_$themodule) [catch {source $file} black(cmds_error_stats_$themodule)]
+if {$black(cmds_error_$themodule) == "1"} {
+	die "\[BT\] :Couldn't load the cmds file \"$file\".Reason: \"$black(cmds_error_stats_$themodule)\""
+	} 
+}
+
+#Load protections
+
+	set prot_files [glob -directory "$black(dirname)/BlackTools/Protections/" "*.tcl"]
+foreach file $prot_files {
+	set split_file [split $file "."]
+	set themodule [lindex $split_file 1]
+	set black(prot_error_$themodule) [catch {source $file} black(prot_error_stats_$themodule)]
+if {$black(prot_error_$themodule) == "1"} {
+	die "\[BT\] :Couldn't load the prot. file \"$file\".Reason: \"$black(prot_error_stats_$themodule)\""
+	} 
+}
+
+#Load script files
+
+set black(binds_error) [catch {source $black(dirname)/BlackTools/BT.Binds.tcl} black(binds_error_stats)]
+set black(core_error) [catch {source $black(dirname)/BlackTools/BT.Core.tcl} black(core_error_stats)]
+set black(loader_error) [catch {source $black(dirname)/BlackTools/lang/loader.tcl} black(loader_error_stats)]
+
+#Check for errors in script files
+
+if {$black(binds_error) == "1"} {
+	die "\[BT\] Error. Couldn't load the \"BT Binds\". Reason: \"$black(core_error_stats)\""
+}
+if {$black(core_error) == "1"} {
+	die "\[BT\] Error. Couldn't load the \"BT Core\". Reason: \"$black(core_error_stats)\""
+}
+if {$black(loader_error) == "1"} {
+	die "\[BT\] Error. Couldn't load the \"BT Language\". Reason: \"$black(loader_error_stats)\""
+}
+
+#################
+###########################################################################
+##   END                                                                 ##
+###########################################################################