diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-08-15 15:45:28 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-08-15 15:45:28 +0200 |
commit | 3bed0981d058b512bfb8aeeeeed235c9ee9385af (patch) | |
tree | 8f3b06e1ac849fecf684af1ba7bb2e72eaed4b5d /clientmods/mapbot/api.lua | |
parent | 622d547262ee6800810b228d9641edff63848e0c (diff) | |
download | dragonfireclient-3bed0981d058b512bfb8aeeeeed235c9ee9385af.tar.xz |
UI Update; Added AutoTool
Diffstat (limited to 'clientmods/mapbot/api.lua')
-rw-r--r-- | clientmods/mapbot/api.lua | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/clientmods/mapbot/api.lua b/clientmods/mapbot/api.lua deleted file mode 100644 index 8d7398b56..000000000 --- a/clientmods/mapbot/api.lua +++ /dev/null @@ -1,41 +0,0 @@ -mapbot.bots = {} - -mapbot.paramtypes = { - ["pos"] = { - "<X>,<Y>,<Z>", - function (param) - local _, pos = minetest.parse_relative_pos(param) - return pos - end - }, - ["nodes"] = { - "<node1> [<node2>] ...", - function (param) - return param:split(" ") - end - }, -} - -function mapbot.register_bot(name, description, paramtype, func) - local pt = mapbot.paramtypes[paramtype] - if not pt then return end - minetest.register_chatcommand(name, { - param = pt[1], - description = description .. " Empty parameter to stop.", - func = function(param) - mapbot.storage:set_string(name, param) - return true, "Changed " .. name .. " config." - end - }) - table.insert(mapbot.bots, {name, pt, func}) -end - -function mapbot.loop() - for _, bot in pairs(mapbot.bots) do - local param = mapbot.storage:get_string(bot[1]) - param = (param == "") and nil or bot[2][2](param) - if param and bot[3](param) end - end -end - -minetest.register_on_connect(mapbot.loop) |