| 1 | #bMotion core |
|---|
| 2 | # |
|---|
| 3 | # $Id$ |
|---|
| 4 | # |
|---|
| 5 | |
|---|
| 6 | # |
|---|
| 7 | # #5270 +(28)- [X] |
|---|
| 8 | # |
|---|
| 9 | # <Procyan> is there like 1 person on earth that knows tcl/tk and is writing all of the apps? |
|---|
| 10 | # <unSlider> procyan: no, there are a bunch of people who dont know tcl/tk but are writing apps for it anyway |
|---|
| 11 | # |
|---|
| 12 | |
|---|
| 13 | set bMotionRoot "scripts/bmotion" |
|---|
| 14 | set bMotionModules "$bMotionRoot/modules" |
|---|
| 15 | set bMotionPlugins "$bMotionRoot/plugins" |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | if {![info exists bMotion_testing]} { |
|---|
| 19 | putloglev d * "bMotion: bMotion_testing is not defined, setting to 0." |
|---|
| 20 | set bMotion_testing 0 |
|---|
| 21 | } |
|---|
| 22 | |
|---|
| 23 | if {$bMotion_testing == 1} { |
|---|
| 24 | putlog "bMotion: INFO: Code loading in testing mode" |
|---|
| 25 | } else { |
|---|
| 26 | putloglev 1 * "bMotion: INFO: Code loading in running mode" |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | proc bMotion_putloglev { level star text } { |
|---|
| 30 | global bMotion_testing |
|---|
| 31 | if {$bMotion_testing == 0} { |
|---|
| 32 | putloglev $level $star $text |
|---|
| 33 | } |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | # init default variables |
|---|
| 37 | if {$bMotion_testing == 1} { |
|---|
| 38 | putlog "... loading variables" |
|---|
| 39 | } |
|---|
| 40 | source "$bMotionModules/variables.tcl" |
|---|
| 41 | |
|---|
| 42 | # load abstracts file (formerly randoms) |
|---|
| 43 | if {$bMotion_testing == 1} { |
|---|
| 44 | putlog "... loading abstracts" |
|---|
| 45 | } |
|---|
| 46 | source "$bMotionModules/abstracts.tcl" |
|---|
| 47 | |
|---|
| 48 | # load settings |
|---|
| 49 | if {$bMotion_testing == 1} { |
|---|
| 50 | putlog "... loading settings" |
|---|
| 51 | } |
|---|
| 52 | source "$bMotionModules/settings.tcl" |
|---|
| 53 | |
|---|
| 54 | #load system functions |
|---|
| 55 | if {$bMotion_testing == 1} { |
|---|
| 56 | putlog "... loading system" |
|---|
| 57 | } |
|---|
| 58 | source "$bMotionModules/system.tcl" |
|---|
| 59 | |
|---|
| 60 | # load output functions |
|---|
| 61 | if {$bMotion_testing == 1} { |
|---|
| 62 | putlog "... loading output" |
|---|
| 63 | } |
|---|
| 64 | source "$bMotionModules/output.tcl" |
|---|
| 65 | |
|---|
| 66 | # load mood functions |
|---|
| 67 | if {$bMotion_testing == 1} { |
|---|
| 68 | putlog "... loading mood" |
|---|
| 69 | } |
|---|
| 70 | source "$bMotionModules/mood.tcl" |
|---|
| 71 | |
|---|
| 72 | # load event functions |
|---|
| 73 | if {$bMotion_testing == 1} { |
|---|
| 74 | putlog "... loading events" |
|---|
| 75 | } |
|---|
| 76 | source "$bMotionModules/events.tcl" |
|---|
| 77 | |
|---|
| 78 | if {$bMotion_testing == 1} { |
|---|
| 79 | putlog "... loading events support" |
|---|
| 80 | } |
|---|
| 81 | source "$bMotionModules/events_support.tcl" |
|---|
| 82 | |
|---|
| 83 | # load interbot bits |
|---|
| 84 | if {$bMotion_testing == 1} { |
|---|
| 85 | putlog "... loading interbot" |
|---|
| 86 | } |
|---|
| 87 | source "$bMotionModules/interbot.tcl" |
|---|
| 88 | |
|---|
| 89 | # load friendship code |
|---|
| 90 | if {$bMotion_testing == 1} { |
|---|
| 91 | putlog "... loading friendship" |
|---|
| 92 | } |
|---|
| 93 | source "$bMotionModules/friendship.tcl" |
|---|
| 94 | |
|---|
| 95 | # load plugins |
|---|
| 96 | if {$bMotion_testing == 1} { |
|---|
| 97 | putlog "... loading plugins" |
|---|
| 98 | } |
|---|
| 99 | source "$bMotionModules/plugins.tcl" |
|---|
| 100 | |
|---|
| 101 | if {$bMotion_testing == 1} { |
|---|
| 102 | putlog "... loading plugin settings" |
|---|
| 103 | } |
|---|
| 104 | source "$bMotionModules/plugins_settings.tcl" |
|---|
| 105 | |
|---|
| 106 | # load anti-flood code |
|---|
| 107 | if {$bMotion_testing == 1} { |
|---|
| 108 | putlog "... loading flood" |
|---|
| 109 | } |
|---|
| 110 | source "$bMotionModules/flood.tcl" |
|---|
| 111 | |
|---|
| 112 | # load other bits |
|---|
| 113 | if {$bMotion_testing == 1} { |
|---|
| 114 | putlog "... loading leet" |
|---|
| 115 | } |
|---|
| 116 | source "$bMotionModules/leet.tcl" |
|---|
| 117 | |
|---|
| 118 | # Ignition! |
|---|
| 119 | bMotion_startTimers |
|---|
| 120 | if {$bMotion_testing == 0} { |
|---|
| 121 | set bMotionCache(rehash) "" |
|---|
| 122 | putlog "\002bMotion $cvsinfo AI online\002 (randoms file: $randomsVersion)" |
|---|
| 123 | } |
|---|