Page 5 of 5

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Sun Jan 24, 2016 20:20
by kaeza
It seems to be a bug in the engine possibly affecting other mods as well.

Thank you again for the help in sorting this out. I've updated the first post with that note.

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Mon Apr 04, 2016 22:50
by kaeza
I've finally got around to testing this under Windows, and it seems to actually work, but needs some work on the part of the server owner.

First of all, you will need a Minetest build linked against a Lua DLL (not statically linked). If your Minetest build contains a `lua51.dll` file, this should work.

Next, you will need to compile and link LuaSocket against the same DLL used by the engine. I have provided prebuilt LuaSocket binaries here for convenience. To use, follow these steps:

  • Install the mod and submodules as normal.
  • Download the archive linked above, and unpack it directly in the root of the IRC mod directory. You should get a subdirectory named `socket-lib`.
  • Add this code somewhere in `init.lua` after the regular path setup:
    Code: Select all
    local SD = modpath.."/socket-lib"
    ie.package.path = SD.."/?/init.lua;"..SD.."/?.lua;"..ie.package.path
    ie.package.cpath = SD.."/?/init.dll;"..SD.."/?.dll;"..ie.package.cpath

    For those that have the tools, there's a patch at `socket-lib/apply-this.patch` that will make the required changes.

For those that want to compile LuaSocket manually, I have provided a simple makefile for MinGW without all the cruft. You will need to put the LuaSocket sources in `mods/irc/luasocket`, and have `bin/lua51.dll`.

I can't guarantee this will work (WFM, YMMV).
Feedback is welcome.

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Tue Aug 02, 2016 02:59
by DI3HARD139
Getting this error:
Code: Select all
Loaded texture: C:/Users/Owner/Desktop/minetest-0.4.14/textures/hdx-256-master/menu_overlay.png
Loaded texture: C:/Users/Owner/Desktop/minetest-0.4.14/textures/hdx-256-master/menu_header.png
Loaded texture: C:/Users/Owner/Desktop/minetest-0.4.14/textures/base/pack/blank.png
Loaded texture: C:/Users/Owner/Desktop/minetest-0.4.14/textures/base/pack/server_flags_favorite.png
Loaded texture: C:/Users/Owner/Desktop/minetest-0.4.14/textures/base/pack/server_flags_creative.png
Loaded texture: C:/Users/Owner/Desktop/minetest-0.4.14/textures/base/pack/server_flags_damage.png
Loaded texture: C:/Users/Owner/Desktop/minetest-0.4.14/textures/base/pack/server_flags_pvp.png
2016-08-01 22:58:15: ERROR[Main]: mod "markers" has unsatisfied dependencies:  "areas"
2016-08-01 22:58:15: ERROR[Main]: mod "misc_overrides" has unsatisfied dependencies:  "biome_lib" "dryplants" "ferns" "technic_chests" "youngtrees"
2016-08-01 22:58:15: WARNING[Main]: NodeDefManager: Ignoring CONTENT_IGNORE redefinition
2016-08-01 22:58:15: ERROR[Main]: ModError: Failed to load and run script from C:\Users\Owner\Desktop\minetest-0.4.14\bin\..\mods\irc\init.lua:
2016-08-01 22:58:15: ERROR[Main]: error loading module 'socket.core' from file 'C:\Users\Owner\Desktop\minetest-0.4.14\bin\..\mods\irc/socket-lib/socket\core.dll':
2016-08-01 22:58:15: ERROR[Main]:       %1 is not a valid Win32 application.
2016-08-01 22:58:15: ERROR[Main]: stack traceback:
2016-08-01 22:58:15: ERROR[Main]:       [C]: at 0x006fa700
2016-08-01 22:58:15: ERROR[Main]:       [C]: in function 'require'
2016-08-01 22:58:15: ERROR[Main]:       ...op\minetest-0.4.14\bin\..\mods\irc/socket-lib/socket.lua:12: in main chunk
2016-08-01 22:58:15: ERROR[Main]:       [C]: in function 'require'
2016-08-01 22:58:15: ERROR[Main]:       ...ner\Desktop\minetest-0.4.14\bin\..\mods\irc/irc/init.lua:1: in main chunk
2016-08-01 22:58:15: ERROR[Main]:       [C]: in function 'require'
2016-08-01 22:58:15: ERROR[Main]:       ...s\Owner\Desktop\minetest-0.4.14\bin\..\mods\irc\init.lua:39: in main chunk
2016-08-01 22:58:15: ERROR[Main]: Check debug.txt for details.
Loaded texture: C:/Users/Owner/Desktop/minetest-0.4.14/textures/hdx-256-master/menu_overlay.png
Loaded texture: C:/Users/Owner/Desktop/minetest-0.4.14/textures/hdx-256-master/menu_header.png

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Tue Aug 02, 2016 20:26
by kaeza
DI3HARD139 wrote:Getting this error:
Code: Select all
[...]
2016-08-01 22:58:15: ERROR[Main]: error loading module 'socket.core' from file 'C:\Users\Owner\Desktop\minetest-0.4.14\bin\..\mods\irc/socket-lib/socket\core.dll':
2016-08-01 22:58:15: ERROR[Main]:       %1 is not a valid Win32 application.
[...]

Not sure where that comes from.

Windows support is not really in my goals ATM, but try compiling using the Makefile provided above if you know how. If not, well, you're out of luck. Sorry.

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Sun Aug 06, 2017 11:38
by ManElevation
do you put this in the mods file?

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Thu Aug 31, 2017 19:19
by Zesty11
Hola kaeza!
I am juanmati, the player of VE-B
The link is down and I am trying to make a server.
Please put the link up back.
Thanks!

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Sat Sep 23, 2017 15:57
by ManElevation
Zesty11 wrote:Hola kaeza!
I am juanmati, the player of VE-B
The link is down and I am trying to make a server.
Please put the link up back.
Thanks!

https://forum.minetest.net/viewtopic.php?id=3905

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Wed Mar 07, 2018 09:17
by timcu
I have developed a script to build minetest for win64 with irc mod using msys2/mingw64. It is based on the excellent script by Fixerol [Windows] Building 64-bit minetest with MSYS2/mingw64 so check that page for more details and how to install msys2. As well as the packages suggested by Fixerol my script also requires the package "patch" so install that with pacman.

Code: Select all
pacman -S patch


Make directories for the build

Code: Select all
cd ~
mkdir -p minetest/buildbot minetest/build
cd minetest/buildbot


You need three files in the buildbot directory. The first is ircinitlua.patch to do the patch suggested by kaeza.

Code: Select all
31a32,34
> local SD = modpath.."/socket-lib"
> ie.package.path = SD.."/?/init.lua;"..SD.."/?.lua;"..ie.package.path
> ie.package.cpath = SD.."/?/init.dll;"..SD.."/?.dll;"..ie.package.cpath


The second file is toolchain_mingw64.cmake and contains the modification suggested by Fixerol.

Code: Select all
# name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER windres)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /mingw64/x86_64-w64-mingw32)

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)


The third file is buildwin64withirc.sh based on Fixerol's script. The script also builds luajit to lua51.dll so minetest and luasocket can link to it. Luasocket is also built to socket*.dll and mime*.dll in the bin directory. The irc mod is automatically included and Luasocket is installed in socket-lib folder in irc mod.

Code: Select all
#!/bin/bash

set -e

{
echo -n "Start of compilation: "; date -R

dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ $# -ne 1 ]; then
   echo "Usage: $0 <build directory>"
   exit 1
fi
builddir=$1
mkdir -p $builddir
builddir="$( cd "$builddir" && pwd )"
packagedir=$builddir/packages
libdir=$builddir/libs

toolchain_file=$dir/toolchain_mingw64.cmake
irc_patch=$dir/ircinitlua.patch
irrlicht_version=1.8.4
ogg_version=1.3.2
vorbis_version=1.3.5
curl_version=7.54.0
gettext_version=0.19.8.1
freetype_version=2.8
sqlite3_version=3.19.2
luajit_version=2.1.0-beta3
leveldb_version=1.19
zlib_version=1.2.11

mkdir -p $packagedir
mkdir -p $libdir

cd $builddir

# Get stuff
[ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget http://minetest.kitsunemimi.pw/irrlicht-$irrlicht_version-win64.zip \
   -c -O $packagedir/irrlicht-$irrlicht_version.zip
[ -e $packagedir/zlib-$zlib_version.zip ] || wget http://minetest.kitsunemimi.pw/zlib-$zlib_version-win64.zip \
   -c -O $packagedir/zlib-$zlib_version.zip
[ -e $packagedir/libogg-$ogg_version.zip ] || wget http://minetest.kitsunemimi.pw/libogg-$ogg_version-win64.zip \
   -c -O $packagedir/libogg-$ogg_version.zip
[ -e $packagedir/libvorbis-$vorbis_version.zip ] || wget http://minetest.kitsunemimi.pw/libvorbis-$vorbis_version-win64.zip \
   -c -O $packagedir/libvorbis-$vorbis_version.zip
[ -e $packagedir/curl-$curl_version.zip ] || wget http://minetest.kitsunemimi.pw/curl-$curl_version-win64.zip \
   -c -O $packagedir/curl-$curl_version.zip
[ -e $packagedir/gettext-$gettext_version.zip ] || wget http://minetest.kitsunemimi.pw/gettext-$gettext_version-win64.zip \
   -c -O $packagedir/gettext-$gettext_version.zip
[ -e $packagedir/freetype2-$freetype_version.zip ] || wget http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win64.zip \
   -c -O $packagedir/freetype2-$freetype_version.zip
[ -e $packagedir/sqlite3-$sqlite3_version.zip ] || wget http://minetest.kitsunemimi.pw/sqlite3-$sqlite3_version-win64.zip \
   -c -O $packagedir/sqlite3-$sqlite3_version.zip
#[ -e $packagedir/luajit-$luajit_version.zip ] || wget http://minetest.kitsunemimi.pw/luajit-$luajit_version-win64.zip \
#   -c -O $packagedir/luajit-$luajit_version.zip
[ -e $packagedir/luajit-$luajit_version.zip ] || wget http://luajit.org/download/LuaJIT-$luajit_version.zip \
   -c -O $packagedir/luajit-$luajit_version.zip
[ -e $packagedir/libleveldb-$leveldb_version.zip ] || wget http://minetest.kitsunemimi.pw/libleveldb-$leveldb_version-win64.zip \
   -c -O $packagedir/libleveldb-$leveldb_version.zip
[ -e $packagedir/openal_stripped.zip ] || wget http://minetest.kitsunemimi.pw/openal_stripped64.zip \
   -c -O $packagedir/openal_stripped.zip


# Extract stuff
cd $libdir
[ -d irrlicht ] || unzip -o $packagedir/irrlicht-$irrlicht_version.zip -d irrlicht
[ -d zlib ] || unzip -o $packagedir/zlib-$zlib_version.zip -d zlib
[ -d libogg ] || unzip -o $packagedir/libogg-$ogg_version.zip -d libogg
[ -d libvorbis ] || unzip -o $packagedir/libvorbis-$vorbis_version.zip -d libvorbis
[ -d libcurl ] || unzip -o $packagedir/curl-$curl_version.zip -d libcurl
[ -d gettext ] || unzip -o $packagedir/gettext-$gettext_version.zip -d gettext
[ -d freetype ] || unzip -o $packagedir/freetype2-$freetype_version.zip -d freetype
[ -d sqlite3 ] || unzip -o $packagedir/sqlite3-$sqlite3_version.zip -d sqlite3
[ -d openal_stripped ] || unzip -o $packagedir/openal_stripped.zip
[ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit-tmp
[ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
[ -d luasocket ] || git clone https://github.com/diegonehab/luasocket.git
[ -d irc ] || git clone --recursive https://github.com/minetest-mods/irc.git

# Build luajit
[ -d luajit-tmp/LuaJIT-$luajit_version ] && mv luajit-tmp/LuaJIT-$luajit_version ./luajit && rmdir luajit-tmp
cd luajit
mingw32-make amalg
cd ..

# Build luasocket
cd luasocket
export LUAV=5.1
export LUAINC_mingw=$libdir/luajit/src
export LUALIB_mingw=$libdir/luajit/src/lua51.dll
export CDIR_mingw=lua/$LUAV
export LDIR_mingw=lua/$LUAV/lua
mingw32-make mingw
mkdir -p socket-lib/mime socket-lib/socket
cd socket-lib
cp ../src/*.lua socket/
cp ../src/mime*.dll mime/core.dll
cp ../src/socket*.dll socket/core.dll
mv socket/ltn12.lua .
mv socket/socket.lua .
mv socket/mime.lua .
cd ../..

# Get minetest
cd $builddir
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
   ln -s $EXISTING_MINETEST_DIR minetest
else
   [ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)
fi
cd minetest
git_hash=$(git rev-parse --short HEAD)

# Get minetest_game
cd games
if [ "x$NO_MINETEST_GAME" = "x" ]; then
   [ -d minetest_game ] && (cd minetest_game && git pull) || (git clone https://github.com/minetest/minetest_game)
fi
cd ../..

# Build the thing
cd minetest
[ -d _build ] && rm -Rf _build/
mkdir _build
cd _build
mv /usr/bin/sh.exe /usr/bin/sh.exe~

cmake .. \
   -G"MinGW Makefiles" \
   -DCMAKE_AR=/mingw64/x86_64-w64-mingw32/bin/ar \
   -DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
   -DCMAKE_INSTALL_PREFIX=/tmp \
   -DVERSION_EXTRA=$git_hash-irc \
   -DBUILD_CLIENT=1 -DBUILD_SERVER=0 \
   \
   -DENABLE_SOUND=1 \
   -DENABLE_CURL=1 \
   -DENABLE_GETTEXT=1 \
   -DENABLE_FREETYPE=1 \
   -DENABLE_LEVELDB=1 \
   \
   -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include \
   -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/Win64-gcc/libIrrlicht.dll.a \
   -DIRRLICHT_DLL=$libdir/irrlicht/bin/Win64-gcc/Irrlicht.dll \
   \
   -DZLIB_INCLUDE_DIR=$libdir/zlib/include \
   -DZLIB_LIBRARIES=$libdir/zlib/lib/libz.dll.a \
   -DZLIB_DLL=$libdir/zlib/bin/zlib1.dll \
   \
   -DLUA_INCLUDE_DIR=$libdir/luajit/src \
   -DLUA_LIBRARY=$libdir/luajit/src/lua51.dll \
   -DLUA_DLL=$libdir/luajit/src/lua51.dll \
   \
   -DOGG_INCLUDE_DIR=$libdir/libogg/include \
   -DOGG_LIBRARY=$libdir/libogg/lib/libogg.dll.a \
   -DOGG_DLL=$libdir/libogg/bin/libogg-0.dll \
   \
   -DVORBIS_INCLUDE_DIR=$libdir/libvorbis/include \
   -DVORBIS_LIBRARY=$libdir/libvorbis/lib/libvorbis.dll.a \
   -DVORBIS_DLL=$libdir/libvorbis/bin/libvorbis-0.dll \
   -DVORBISFILE_LIBRARY=$libdir/libvorbis/lib/libvorbisfile.dll.a \
   -DVORBISFILE_DLL=$libdir/libvorbis/bin/libvorbisfile-3.dll \
   \
   -DOPENAL_INCLUDE_DIR=$libdir/openal_stripped/include/AL \
   -DOPENAL_LIBRARY=$libdir/openal_stripped/lib/libOpenAL32.dll.a \
   -DOPENAL_DLL=$libdir/openal_stripped/bin/OpenAL32.dll \
   \
   -DCURL_DLL=$libdir/libcurl/bin/libcurl-4.dll \
   -DCURL_INCLUDE_DIR=$libdir/libcurl/include \
   -DCURL_LIBRARY=$libdir/libcurl/lib/libcurl.dll.a \
   \
   -DGETTEXT_MSGFMT=`which msgfmt` \
   -DGETTEXT_DLL=$libdir/gettext/bin/libintl-8.dll \
   -DGETTEXT_ICONV_DLL=$libdir/gettext/bin/libiconv-2.dll \
   -DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \
   -DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a \
   \
   -DFREETYPE_INCLUDE_DIR_freetype2=$libdir/freetype/include/freetype2 \
   -DFREETYPE_INCLUDE_DIR_ft2build=$libdir/freetype/include/freetype2 \
   -DFREETYPE_LIBRARY=$libdir/freetype/lib/libfreetype.dll.a \
   -DFREETYPE_DLL=$libdir/freetype/bin/libfreetype-6.dll \
   \
   -DSQLITE3_INCLUDE_DIR=$libdir/sqlite3/include \
   -DSQLITE3_LIBRARY=$libdir/sqlite3/lib/libsqlite3.dll.a \
   -DSQLITE3_DLL=$libdir/sqlite3/bin/libsqlite3-0.dll \
   \
   -DLEVELDB_INCLUDE_DIR=$libdir/leveldb/include \
   -DLEVELDB_LIBRARY=$libdir/leveldb/lib/libleveldb.dll.a \
   -DLEVELDB_DLL=$libdir/leveldb/bin/libleveldb.dll

mv /usr/bin/sh.exe~ /usr/bin/sh.exe
mingw32-make package -j$(nproc)

cd _CPack_Packages/win64/ZIP/
cp /mingw64/bin/libgcc_s_seh-1.dll minetest-*/bin
cp /mingw64/bin/libstdc++-6.dll minetest-*/bin
cp /mingw64/bin/libwinpthread-1.dll minetest-*/bin
cp $libdir/luasocket/src/*.dll minetest-*/bin/
cp -R $libdir/irc minetest-*/mods/
patch minetest-*/mods/irc/init.lua $dir/ircinitlua.patch
cp -R $libdir/luasocket/socket-lib minetest-*/mods/irc/

zip -ur minetest-*.zip minetest-*
cp minetest-*.zip ../../../

echo -n "End of compilation: "; date -R

} |& tee build.log

# EOF


Create these three files with your favourite text editor and save in the buildbot folder. Run the script.

Code: Select all
./buildwin64withirc.sh ../build


When the script is finished, minetest will be packaged in a file with a name like ~/minetest/build/minetest/_build/minetest-0.5.006cfd699b-irc-win64.zip

I hope this saves someone as much time as it took me to work it out!

EDIT: Added -DLUA_LIBRARY to cmake which somehow missed my original post. I have added to github to make it easier to create files.

https://github.com/timcu/buildbot_minetest_with_irc

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Fri Mar 09, 2018 00:50
by kaeza
Thanks! I can't test it, but added a link in the first post.

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Fri Mar 09, 2018 03:40
by ExeterDad
timcu wrote:I have developed a script
<--- Snip --->

It's great you shared and documented this.
Thank you for your efforts :)

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Fri Mar 09, 2018 21:31
by timcu
You're welcome. Thanks kaeza for writing such a useful mod. I am teaching kids to program in python. Using a python module, and the minetest mods irc and irc_commands, the kids write python programs which build structures in a minetest world. The kids log in to minetest to see the structure they have built, and I place signs telling them what their next task is. Lot's of fun! That is why I needed irc mod to work on Mac, Linux and Windows.

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Sat Jul 07, 2018 23:21
by ManElevation
heyaii! why do i get a socket.core not found error?
no field packagepreload socket.core

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Sun Jul 08, 2018 22:34
by kaeza
ManElevation wrote:heyaii! why do i get a socket.core not found error?
no field packagepreload socket.core

Did you install the required packages?
See also https://github.com/minetest-mods/irc/issues/29

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Sun Aug 05, 2018 21:17
by bosapara
how to install it?

Im using official client 4.17.1, added irc folder to mods, but have an error:
What i did incorrect?
Code: Select all
2018-08-06 00:15:06: ERROR[Main]: ModError: Failed to load and run script from F:\sky\newminetest-0.4.17.1\bin\..\mods\irc\init.lua:
2018-08-06 00:15:06: ERROR[Main]: F:\sky\newminetest-0.4.17.1\bin\..\mods\irc\init.lua:43: module 'irc' not found:
2018-08-06 00:15:06: ERROR[Main]:    no field package.preload['irc']
2018-08-06 00:15:06: ERROR[Main]:    no file 'F:\sky\newminetest-0.4.17.1\bin\..\mods\irc/irc/init.lua'
2018-08-06 00:15:06: ERROR[Main]:    no file 'F:\sky\newminetest-0.4.17.1\bin\..\mods\irc/irc.lua'
2018-08-06 00:15:06: ERROR[Main]:    no file '.\irc.lua'
2018-08-06 00:15:06: ERROR[Main]:    no file 'F:\sky\newminetest-0.4.17.1\bin\lua\irc.lua'
2018-08-06 00:15:06: ERROR[Main]:    no file 'F:\sky\newminetest-0.4.17.1\bin\lua\irc\init.lua'
2018-08-06 00:15:06: ERROR[Main]:    no file '.\irc.dll'
2018-08-06 00:15:06: ERROR[Main]:    no file 'F:\sky\newminetest-0.4.17.1\bin\irc.dll'
2018-08-06 00:15:06: ERROR[Main]:    no file 'F:\sky\newminetest-0.4.17.1\bin\loadall.dll'
2018-08-06 00:15:06: ERROR[Main]: stack traceback:
2018-08-06 00:15:06: ERROR[Main]:    [C]: in function 'require'
2018-08-06 00:15:06: ERROR[Main]:    F:\sky\newminetest-0.4.17.1\bin\..\mods\irc\init.lua:43: in main chunk

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Sun Aug 05, 2018 21:29
by rubenwardy
You need to recursively clone the repo

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Sun Aug 05, 2018 21:38
by bosapara
rubenwardy wrote:You need to recursively clone the repo

I don't understand what it mean. Any guides how to install this mod for noobs?

Re: [Mod] Internet Relay Chat [irc]

PostPosted: Thu Aug 09, 2018 10:57
by ANAND
There seems to be two params passed to func in irc.register_bot_command, of which the first one ('_') is unused. Does it hold the nick of the IRC caller?