add /modules command
lists all modules. green if loaded, red otherwise
This commit is contained in:
4
main.py
4
main.py
@@ -30,7 +30,7 @@ def on_disable():
|
||||
log("Loading RedstonerUtils...")
|
||||
|
||||
# Import all modules, in this order
|
||||
load_modules = [
|
||||
shared["load_modules"] = [
|
||||
"misc",
|
||||
"adminchat",
|
||||
"lagchunks",
|
||||
@@ -46,7 +46,7 @@ load_modules = [
|
||||
"forcefield"
|
||||
]
|
||||
shared["modules"] = {}
|
||||
for module in load_modules:
|
||||
for module in shared["load_modules"]:
|
||||
try:
|
||||
shared["modules"][module] = __import__(module)
|
||||
log("Module %s loaded." % module)
|
||||
|
||||
8
misc.py
8
misc.py
@@ -143,3 +143,11 @@ def on_pyeval_command(sender, args):
|
||||
else:
|
||||
noperm(sender)
|
||||
return True
|
||||
|
||||
|
||||
@hook.command("modules")
|
||||
def on_modules_command(sender, args):
|
||||
plugin_header("Modules")
|
||||
for mod in shared["load_modules"]:
|
||||
color = "a" if mod in shared["modules"] else "c"
|
||||
msg(sender, "&" + color + mod)
|
||||
Reference in New Issue
Block a user