----
This mod adds the useful debugging command /lua which executes its parameter string as a Lua chunk, as if it were being run in the body of a function inside some mod file. Errors are reported to the player via in-game chat, as is anything sent to the print() function. For example, entering the command:
Code: Select all
/lua print("Hello self");
Code: Select all
issued command: /lua print("Hello self");
Hello self
Code: Select all
/lua ^
Code: Select all
issued command: /lua ^
Server -!- ERROR: [string "/lua command"]:1: unexpected symbol near '^'
Code: Select all
/lua for _, player in ipairs(minetest.get_connected_players()) do
print(player:get_player_name()); end
Required Minetest Version: unknown (>=0.4.9 definitely OK)
Dependencies: (none)
Commands:
- /lua <luaStatement>
- /luaclear
Git Repo: https://github.com/prestidigitator/minetest-mod-luacmd
Change History
Version 1.0
- Released 2014-07-04
- First working version
- Release 2014-07-04
- Variable 'me': reference to current player object
- Variable 'myname': current player's name
- Variable 'here': current player's position as a printable vector
- Made the print(...) function a little more useful: converts args to strings
Code: Select all
/lua me:set_physics_override({ jump = 10.0 });
/lua print(myname);
/lua print(here);
- Release 2014-07-04
- Keeps "global" variables set by commands in a player-local context.
- Prevents setting of special variables (e.g. me, myname, here, print).
- Added /luaclear command to clear the player-local context.
Copyright and Licensing
All contents are the original creations of the mod author (prestidigitator).
Author: prestidigitator (as registered on forum.minetest.net)
License: WTFPL (all content)