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...")
|
log("Loading RedstonerUtils...")
|
||||||
|
|
||||||
# Import all modules, in this order
|
# Import all modules, in this order
|
||||||
load_modules = [
|
shared["load_modules"] = [
|
||||||
"misc",
|
"misc",
|
||||||
"adminchat",
|
"adminchat",
|
||||||
"lagchunks",
|
"lagchunks",
|
||||||
@@ -46,7 +46,7 @@ load_modules = [
|
|||||||
"forcefield"
|
"forcefield"
|
||||||
]
|
]
|
||||||
shared["modules"] = {}
|
shared["modules"] = {}
|
||||||
for module in load_modules:
|
for module in shared["load_modules"]:
|
||||||
try:
|
try:
|
||||||
shared["modules"][module] = __import__(module)
|
shared["modules"][module] = __import__(module)
|
||||||
log("Module %s loaded." % module)
|
log("Module %s loaded." % module)
|
||||||
|
|||||||
8
misc.py
8
misc.py
@@ -143,3 +143,11 @@ def on_pyeval_command(sender, args):
|
|||||||
else:
|
else:
|
||||||
noperm(sender)
|
noperm(sender)
|
||||||
return True
|
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