Various Fixes

This commit is contained in:
Diego Martínez 2012-12-28 09:41:10 -02:00
parent 9de98a8e8b
commit 9ac5f86475
4 changed files with 27 additions and 0 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@ irc
*.zip
*.tar.gz
*.tar.bz2
*.marks
screenshot_*.png

View File

@ -20,6 +20,8 @@ mt_irc.register_bot_command = function ( name, def )
end
mt_irc.register_bot_command("help", {
params = "[<command>]";
description = "Get help about a command";
func = function ( from, args )
if (args ~= "") then
mt_irc.bot_help(from, args);
@ -35,6 +37,8 @@ mt_irc.register_bot_command("help", {
});
mt_irc.register_bot_command("who", {
params = nil;
description = "Tell who is playing";
func = function ( from, args )
local s = "";
for k, v in pairs(mt_irc.connected_players) do
@ -47,6 +51,8 @@ mt_irc.register_bot_command("who", {
});
mt_irc.register_bot_command("whereis", {
params = "<player>";
description = "Tell the location of <player>";
func = function ( from, args )
if (args == "") then

View File

@ -79,3 +79,12 @@ minetest.register_chatcommand("who", {
minetest.chat_send_player(name, "Players On Channel:"..s);
end;
});
minetest.register_chatcommand("uptime", {
params = "";
description = "Tell how much time the server has been up";
privs = { shout=true; };
func = function ( name, param )
local t = os.time();
end;
});

View File

@ -123,6 +123,16 @@ mt_irc.connect = function ( )
end
end
mt_irc.say = function ( to, msg )
if (not msg) then
msg = to;
to = mt_irc.channel;
end
to = to or mt_irc.channel;
msg = msg or "";
irc.say(to, msg);
end
dofile(MODPATH.."/callback.lua");
dofile(MODPATH.."/chatcmds.lua");
dofile(MODPATH.."/botcmds.lua");