BT.Loader.tcl 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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-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. #Load modules
  17. set modules_files [glob -directory "$black(dirname)/BlackTools/Modules/" "*.tcl"]
  18. foreach file $modules_files {
  19. set split_file [split $file "."]
  20. set themodule [lindex $split_file 1]
  21. set black(module_error_$themodule) [catch {source $file} black(module_error_stats_$themodule)]
  22. if {$black(module_error_$themodule) == "1"} {
  23. die "\[BT\] :Couldn't load the module file \"$file\".Reason: \"$black(module_error_stats_$themodule)\""
  24. }
  25. }
  26. #Load cmds
  27. set cmds_files [glob -directory "$black(dirname)/BlackTools/Commands/" "*.tcl"]
  28. foreach file $cmds_files {
  29. set split_file [split $file "."]
  30. set themodule [lindex $split_file 1]
  31. set black(cmds_error_$themodule) [catch {source $file} black(cmds_error_stats_$themodule)]
  32. if {$black(cmds_error_$themodule) == "1"} {
  33. die "\[BT\] :Couldn't load the cmds file \"$file\".Reason: \"$black(cmds_error_stats_$themodule)\""
  34. }
  35. }
  36. #Load protections
  37. set prot_files [glob -directory "$black(dirname)/BlackTools/Protections/" "*.tcl"]
  38. foreach file $prot_files {
  39. set split_file [split $file "."]
  40. set themodule [lindex $split_file 1]
  41. set black(prot_error_$themodule) [catch {source $file} black(prot_error_stats_$themodule)]
  42. if {$black(prot_error_$themodule) == "1"} {
  43. die "\[BT\] :Couldn't load the prot. file \"$file\".Reason: \"$black(prot_error_stats_$themodule)\""
  44. }
  45. }
  46. #Load script files
  47. set black(timers_error) [catch {source $black(dirname)/BlackTools/BT.Timers.tcl} black(timers_error_stats)]
  48. set black(binds_error) [catch {source $black(dirname)/BlackTools/BT.Binds.tcl} black(binds_error_stats)]
  49. set black(core_error) [catch {source $black(dirname)/BlackTools/BT.Core.tcl} black(core_error_stats)]
  50. set black(loader_error) [catch {source $black(dirname)/BlackTools/lang/loader.tcl} black(loader_error_stats)]
  51. #Check for errors in script files
  52. if {$black(timers_error) == "1"} {
  53. die "\[BT\] Error. Couldn't load the \"BT Timers\". Reason: \"$black(timers_error_stats)\""
  54. }
  55. if {$black(binds_error) == "1"} {
  56. die "\[BT\] Error. Couldn't load the \"BT Binds\". Reason: \"$black(binds_error_stats)\""
  57. }
  58. if {$black(core_error) == "1"} {
  59. die "\[BT\] Error. Couldn't load the \"BT Core\". Reason: \"$black(core_error_stats)\""
  60. }
  61. if {$black(loader_error) == "1"} {
  62. die "\[BT\] Error. Couldn't load the \"BT Language\". Reason: \"$black(loader_error_stats)\""
  63. }
  64. #################
  65. ###########################################################################
  66. ## END ##
  67. ###########################################################################