init.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. readexec = readexec or {}
  2. readexec.modpath = minetest.get_modpath("readexec")
  3. --readexec.infile = "/tmp/minetest-command-input.txt"
  4. --local timer = 0
  5. --local delay = 1
  6. --readexec.run = function(dtime)
  7. -- timer = timer + dtime
  8. -- if timer < delay then return end
  9. -- timer = 0
  10. -- local file = io.open(readexec.infile, "r")
  11. -- if file then
  12. -- local data = file:read("*l")
  13. -- if data and string.len(data) > 0 then
  14. -- if string.sub(data, 1, 4) == "/me " then
  15. -- local act = string.sub(data, 5)
  16. -- local dname = rename.gpn("MustTest")
  17. -- minetest.chat_send_all("* <" .. dname .. "> " .. act)
  18. -- chat_logging.log_public_action("MustTest", act, "")
  19. -- elseif string.sub(data, 1, 6) == "/echo " then
  20. -- minetest.chat_send_all("# Server: " .. string.sub(data, 7))
  21. -- else
  22. -- local dname = rename.gpn("MustTest")
  23. -- minetest.chat_send_all("<" .. dname .. "> " .. data)
  24. -- chat_logging.log_public_chat("MustTest", data, "")
  25. -- end
  26. -- end
  27. -- file:close()
  28. -- file = nil
  29. -- os.remove(readexec.infile)
  30. -- end
  31. --end
  32. --if not readexec.registered then
  33. -- minetest.register_globalstep(function(...) return readexec.run(...) end)
  34. -- readexec.registered = true
  35. --end
  36. --if minetest.get_modpath("reload") then
  37. -- local c = "readexec:core"
  38. -- local f = readexec.modpath .. "/init.lua"
  39. -- if not reload.file_registered(c) then
  40. -- reload.register_file(c, f, false)
  41. -- end
  42. --end