BT.Loader.tcl 3.2 KB

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