summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index 2f03e1f..614feaf 100644
--- a/init.lua
+++ b/init.lua
@@ -1,10 +1,8 @@
furrybot = {}
-dofile(minetest.get_modpath("furrybot") .. "/bot.lua")
-
-furrybot.http = minetest.request_http_api()
-furrybot.storage = minetest.get_mod_storage()
-local env = assert(minetest.request_insecure_environment())
+local http = minetest.request_http_api()
+local env = minetest.request_insecure_environment()
+local storage = minetest.get_mod_storage()
minetest.register_on_receiving_chat_message(function(msg)
furrybot.recieve(msg)
@@ -12,7 +10,8 @@ end)
minetest.register_chatcommand("fbreload", {
func = function()
- local func = env.loadfile("clientmods/furrybot/bot.lua")
- func()
+ return furrybot.reload(http, env, storage)
end
})
+
+loadfile(minetest.get_modpath("furrybot") .. "/bot.lua")()(http, env, storage)