2012-12-01 04:06:15 +01:00
|
|
|
IRC Mod for Minetest
|
|
|
|
(C) 2012 Diego Martínez <kaeza@users.sf.net>
|
|
|
|
|
|
|
|
INTRODUCTION
|
|
|
|
------------
|
|
|
|
This mod is just a glue between luasocket, LuaIRC, and Minetest. It
|
|
|
|
provides a two-way communication between the in-game chat, and an
|
|
|
|
arbitrary IRC channel.
|
|
|
|
|
2012-12-16 11:47:17 +01:00
|
|
|
|
2012-12-02 14:16:27 +01:00
|
|
|
COMPILING
|
|
|
|
---------
|
|
|
|
Make sure you have CMake (http://cmake.org/), and of course, a C compiler,
|
|
|
|
on your system before proceeding.
|
2012-12-16 11:47:17 +01:00
|
|
|
For Windows, try MinGW32 (http://mingw.org/).
|
|
|
|
For Unix-based systems, you should not have any problems with the C compiler
|
|
|
|
since there's one (almost) always available. Puppy Linux users of course
|
|
|
|
need a separate `devx.sfs' (from the same place where you got the Puppy
|
|
|
|
ISO), since vanilla Puppy does not come with `gcc'. See your Puppy docs for
|
|
|
|
more info about how to install additional SFS files.
|
|
|
|
|
2012-12-19 03:55:03 +01:00
|
|
|
Quick one line build for linux.
|
|
|
|
|
|
|
|
git clone https://github.com/kaeza/minetest-irc.git && cd minetest-irc && mkdir build && cd build && cmake .. && make && make pack_mod && cp -R irc <your mod directory>
|
2013-01-06 12:43:20 +01:00
|
|
|
Please change the "cp -R irc" to fit your install of minetest.
|
2012-12-19 03:55:03 +01:00
|
|
|
|
2012-12-16 11:47:17 +01:00
|
|
|
To compile and "pack" the mod:
|
2012-12-02 14:16:27 +01:00
|
|
|
|
2012-12-16 11:47:17 +01:00
|
|
|
- Open a command prompt/terminal and CD to the minetest-irc directory.
|
2012-12-02 14:16:27 +01:00
|
|
|
- Create a directory named "Build", and CD into it:
|
2012-12-16 11:47:17 +01:00
|
|
|
mkdir Build
|
2012-12-02 14:16:27 +01:00
|
|
|
cd Build
|
|
|
|
- Run CMake to generate the build system (see your CMake docs for more
|
2012-12-16 11:47:17 +01:00
|
|
|
information about command line options, in particular the `-G' option).
|
2012-12-02 14:16:27 +01:00
|
|
|
cmake ..
|
|
|
|
- Use the build tool for the generated build system to compile the
|
|
|
|
native library. For example, if using Microsoft Visual Studio, open
|
|
|
|
the generated workspace and build from there. If using make, just run
|
|
|
|
"make" from within the Build directory.
|
2012-12-15 18:00:40 +01:00
|
|
|
- Again use the build tool to invoke the `pack_mod' target. For example,
|
|
|
|
if using `make', run "make pack_mod" from within the build directory.
|
2012-12-16 11:47:17 +01:00
|
|
|
This will create an `irc' directory inside the build directory.
|
2012-12-15 18:00:40 +01:00
|
|
|
This `irc' directory will be ready to be deployed to your Minetest mods
|
2012-12-16 11:47:17 +01:00
|
|
|
directory.
|
|
|
|
|
2012-12-02 14:16:27 +01:00
|
|
|
|
2012-12-01 04:06:15 +01:00
|
|
|
INSTALLING
|
|
|
|
----------
|
2012-12-15 18:00:40 +01:00
|
|
|
Just put the created `irc' directory in any of the directories where
|
|
|
|
Minetest looks for mods. For more information, see:
|
2013-01-01 09:56:00 +01:00
|
|
|
http://wiki.minetest.com/wiki/Installing_mods
|
2012-12-01 04:06:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
SETTINGS
|
|
|
|
--------
|
2012-12-15 18:00:40 +01:00
|
|
|
All settings are changed in the `config.lua' file. If any of these settings
|
2012-12-01 04:06:15 +01:00
|
|
|
are either nil or false, the default value is used.
|
|
|
|
|
2012-12-14 23:33:44 +01:00
|
|
|
mt_irc.server (string, default "irc.freenode.net")
|
2012-12-01 04:06:15 +01:00
|
|
|
This is the IRC server the mod connects to.
|
|
|
|
|
2013-01-06 12:43:20 +01:00
|
|
|
mt_irc.channel (string, default "##mt-irc-mod")
|
2012-12-01 04:06:15 +01:00
|
|
|
The IRC channel to join.
|
|
|
|
|
2012-12-14 23:33:44 +01:00
|
|
|
mt_irc.dtime (number, default 0.2)
|
2012-12-01 04:06:15 +01:00
|
|
|
This is the time in seconds between updates in the connection.
|
|
|
|
In order not to block the game, the mod must periodically "poll"
|
|
|
|
the connection to both send messages to, and receive messages
|
|
|
|
from the channel. A high value means slower connection to IRC,
|
|
|
|
but possibly better response from the game. A low value means
|
|
|
|
the mod "polls" the connection more often, but can make the
|
|
|
|
game hang. It allows fractional values.
|
|
|
|
|
2012-12-14 23:33:44 +01:00
|
|
|
mt_irc.timeout (number, default 60.0)
|
|
|
|
Underlying socket timeout in seconds. This is the time before
|
|
|
|
the system drops an idle connection.
|
|
|
|
|
|
|
|
mt_irc.server_nick (string, default "minetest-"..<server-id>)
|
|
|
|
Nickname used as "proxy" for the in-game chat.
|
|
|
|
"<server-id>" is the server IP address packed as a 32 bit integer.
|
|
|
|
(Currently, it's just a random 32 bit number).
|
|
|
|
|
|
|
|
mt_irc.password (string, default "")
|
|
|
|
Password to use when connecting to the server.
|
|
|
|
|
|
|
|
mt_irc.message_format_out (string, default "<$(name)> $(message)")
|
|
|
|
This specifies how to send the messages from in-game to IRC.
|
|
|
|
The strings can contain "macros" (or variable substitutions), which
|
|
|
|
are specified as "$(macro_name)".
|
|
|
|
Currently, these macros are supported:
|
|
|
|
$(name) The name of the player sending the message.
|
|
|
|
$(message) The actual message text.
|
|
|
|
Any unrecognized macro will be left in the message verbatim.
|
|
|
|
For example, if a user named "mtuser" is saying "Hello!", then:
|
|
|
|
"<$(name)> $(message)"
|
|
|
|
...will yield...
|
|
|
|
"<mtuser> Hello!"
|
|
|
|
...and...
|
|
|
|
"$(name): $(message) $(xyz)"
|
|
|
|
...will yield...
|
|
|
|
"mtuser: Hello! $(xyz)"
|
|
|
|
|
|
|
|
mt_irc.message_format_in (string,
|
|
|
|
default "<$(name)@IRC> $(message)")
|
|
|
|
This specifies how the messages gotten from the IRC channel are
|
|
|
|
displayed in-game.
|
|
|
|
The strings can contain "macros" (or variable substitutions), which
|
|
|
|
are specified as "$(macro_name)".
|
|
|
|
Currently, these macros are supported:
|
|
|
|
$(name) The nickname of the user sending the message.
|
|
|
|
$(message) The actual message text.
|
|
|
|
$(server) The IRC server.
|
|
|
|
$(port) The IRC server port.
|
|
|
|
$(channel) The IRC channel.
|
|
|
|
In the default configuration, this will yield:
|
|
|
|
<mtuser@IRC[#minetest-irc-testing]> Hello!
|
|
|
|
|
2012-12-16 16:56:02 +01:00
|
|
|
mt_irc.debug (boolean, default false)
|
|
|
|
Whether to output debug information.
|
2012-12-01 04:06:15 +01:00
|
|
|
|
2012-12-31 16:53:01 +01:00
|
|
|
mt_irc.auto_connect (boolean, default false)
|
|
|
|
If true, the bot is connected by default. If false, a player with
|
|
|
|
`irc_admin' privilege has to use the /irc_connect command to
|
|
|
|
connect to the server.
|
|
|
|
|
2013-01-06 12:43:20 +01:00
|
|
|
mt_irc.auto_join (boolean, default false)
|
2012-12-31 16:53:01 +01:00
|
|
|
If true, players join the channel automatically upon entering the
|
|
|
|
game. If false, each user must manually use the /join command to
|
|
|
|
join the channel. In any case, the players may use the /part
|
|
|
|
command to opt-out of being in the channel.
|
2012-12-16 11:47:17 +01:00
|
|
|
|
2012-12-15 18:21:55 +01:00
|
|
|
USAGE
|
|
|
|
-----
|
|
|
|
Once the game is connected to the IRC channel, chatting using the 'T' or
|
|
|
|
F10 hotkeys will send the messages to the channel, and will be visible
|
|
|
|
by anyone. Also, when someone sends a message to the channel, that text
|
|
|
|
will be visible in-game.
|
|
|
|
|
2012-12-16 16:56:02 +01:00
|
|
|
This mod also adds a few chat commands:
|
2012-12-15 18:21:55 +01:00
|
|
|
|
2012-12-16 16:56:02 +01:00
|
|
|
/msg <nick> <message>
|
2012-12-15 18:21:55 +01:00
|
|
|
Sends a private message to the IRC user whose nickname is `nick'.
|
|
|
|
|
2012-12-16 16:56:02 +01:00
|
|
|
/join
|
|
|
|
Join the IRC channel.
|
|
|
|
|
|
|
|
/part
|
|
|
|
Part the IRC channel.
|
|
|
|
|
2013-01-06 12:43:20 +01:00
|
|
|
/irc_connect
|
|
|
|
Connect the bot manually to the IRC network.
|
|
|
|
|
|
|
|
/irc_disconnect
|
|
|
|
Disconnect the bot manually to the IRC network (this does not
|
|
|
|
shutdown the game).
|
|
|
|
|
|
|
|
/irc_reconnect
|
|
|
|
A combination of /irc_disconnect and /irc_connect.
|
|
|
|
|
2012-12-15 18:21:55 +01:00
|
|
|
You can also send private messages from IRC to in-game players, though
|
|
|
|
it's a bit tricky.
|
|
|
|
|
2013-01-06 12:43:20 +01:00
|
|
|
To do it, you must send a private message to the bot (set with
|
2012-12-15 18:21:55 +01:00
|
|
|
the `mt_irc.server_nick' option above), in the following format:
|
|
|
|
>playername message
|
|
|
|
For example, if there's a player named `mtuser', you can send him/her
|
|
|
|
a private message with:
|
2012-12-16 16:56:02 +01:00
|
|
|
/msg server_nick >mtuser Hello!
|
2012-12-15 18:21:55 +01:00
|
|
|
|
|
|
|
To avoid possible misunderstandings (since all in-game players use the
|
|
|
|
same IRC user to converse with you), the "proxy" user will reject any
|
|
|
|
private messages that are not in that format, and will send back a
|
|
|
|
nice reminder as a private message.
|
|
|
|
|
2012-12-16 11:47:17 +01:00
|
|
|
|
|
|
|
THANKS
|
|
|
|
------
|
|
|
|
I'd like to thank the users who supported this mod both on the Minetest
|
|
|
|
Forums and on the #minetest channel. In no particular order:
|
|
|
|
|
|
|
|
leo_rockway, VanessaE, OldCoder, sfan5, RealBadAngel, Muadtralk/sdzen,
|
|
|
|
Josh, celeron55, KikaRz, and many others I forgot about (sorry!).
|
|
|
|
|
2012-12-01 04:06:15 +01:00
|
|
|
LICENSE
|
|
|
|
-------
|
|
|
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
|
|
|
Version 2, December 2004
|
|
|
|
|
|
|
|
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
|
|
|
|
|
|
|
Everyone is permitted to copy and distribute verbatim or modified
|
|
|
|
copies of this license document, and changing it is allowed as long
|
|
|
|
as the name is changed.
|
|
|
|
|
|
|
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
|
|
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
|
|
|
|
|
|
0. You just DO WHAT THE FUCK YOU WANT TO.
|
|
|
|
|
|
|
|
The files `http.lua', `ltn12.lua', `mime.lua', `smtp.lua', `socket.lua',
|
|
|
|
and `url.lua' are part of the luasocket project
|
|
|
|
(http://luasocket.luaforge.org/). See `LICENSE-luasocket.txt' for
|
|
|
|
licensing information.
|
|
|
|
|
2012-12-15 18:21:55 +01:00
|
|
|
The `irc.lua' file and the entire contents of the `irc' directory are part
|
2012-12-01 04:06:15 +01:00
|
|
|
of the LuaIRC project (http://luairc.luaforge.org/). See
|
|
|
|
`LICENSE-LuaIRC.txt' for licensing information.
|