Scripter
What does it do?
Using LuaToBukkit, Bukkit plugins can be written in Lua. They can control many aspects of the server, as well as listen to events. It has 4 script types:
Commands
Directory: plugins/LuaToBukkit/commands
Here the files for commands should be placed. However, when they are placed here, they still have to be registered in, for example, a startup script.
Listeners
Directory: plugins/LuaToBukkit/listeners
All listeners should be placed here. Whenever an event is fired the plugin will only look for event listeners here.
Startup
Directory: plugins/LuaToBukkit/startup
These scripts are automatically run at startup.
Scripts
Directory: plugins/LuaToBukkit/scripts
These scripts can be executed using the `/lua execute` command.
APIs
Server API
Functions
server:banIP(ip)
Bans an IP.
server:unbanIP(ip)
Unbans an IP, the reverse of server.banIP
server:broadcast(message, permission [,color])
Broadcasts a message to all players having sufficient permissons with an optional color.
server:broadcastMessage(message [, color])
Broadcasts a message to all players with an optional color
server:kick(player)
Kicks a player.
server:getOnlinePlayers()
Gets all online player names in a table.
server:sendMessage(player, message)
Sends a message to a specific player
Constants
- server.IP
- server.NAME
- server.MOTD
- server.MAX_PLAYERS
- server.VIEW_DISTANCE
- server.ALLOW_END
- server.ALLOW_FLIGHT
- server.ALLOW_NETHER
- server.AMBIENT_SPAWN_LIMIT
- server.ANIMAL_SPAWN_LIMIT
-
View User Profile
-
Send Message
Posted Jul 13, 2013A couple more APIs have already been added, but I've not documented them here yet. I'll do this later.
The first version of this plugin still needs approval, but then it's ready to use.
-
View User Profile
-
Send Message
Posted Jul 12, 2013This is a very interesting idea. I could use learning Lua for garys mod.
-
View User Profile
-
Send Message
Posted Jul 12, 2013Wow, this is cool. It's great for those who knows how to code lua pretty well. :)