If you replace the socket/core.dll file with a a Linux or OS X luasockets library, it should work, but this hasn't been tested.

Once it's installed, you'll want to install a python interpreter. Once python is installed and on the system path, you can drop scripts into mods/raspberryjammod/mcpipy/ and run them with /py scriptname [arguments] from the Minetest chat. (You will need to edit settings.conf in the mod directory if it can't find your Python interpreter. I recommend PyPy for best performance.) Some fun demo scripts to try: /py borromean /py render dragon (this will be slow) /py chess (wield a sword and LEFT-click on pieces and places to move; only works with a sword, and you need to LEFT click, contrary to instructions) /py fancytree

Finally, if you want to play with (or teach) some simple turtle graphics using Blockly (a graphical programming system), you don't need to install python. Just start a world with raspberryjammod enabled, and go to http://robotblocks.appspot.com.

Last edited by arpruss on Tue Nov 17, 2015 01:56, edited 2 times in total.

I just added x64 support, so you can now run this on both the 32- and 64-bit versions of Minetest (MSVC + Windows only; if you want to use Linux, you'll still need to throw an appropriate core.so file from your luasocket build into the raspberryjammod/socket/ directory).

Version 0.11:- improved block translation (slabs, trapdoors) from Minecraft to Minetest- compatibility with secure.enable_security = true in minetest.conf as long as you list raspberryjammod in secure.trusted_mods

arpruss wrote:I just released 0.10, which includes automatic translation for a bunch more Minecraft block ids/metas. This makes Minecraft schematics import more neatly.

You might also be intrested in my mccompat mod which adds extra nodes similar to those in Minecraft. That way, importing Minecraft .schematic files gets easier. handle_schematics also has some basic translations for some node names.

I posted a new version with an improved version of Conway's Game of Life.

Run /py life while standing on a large level surface. A large stone fence will be drawn around you for the board. Place any blocks you'd like (in the same plane as the fence). Then hit the ground with a sword to start. (Left-click with the sword. The instructions in the Life script are designed for Minecraft which is why they say to right-click.)

Thank you for bringing this to minetest! It's great fun and my kids love it.

I had some trouble setting it up on linux at first. I downloaded lua 5.1 and luasockets3.0, copied all the lua 5.1 source files into the luasockets3.0 /src folder before compiling luasockets with 'make' and running 'sudo make install'.

The mcpipy python scripts will run well from a terminal and appear in the game but do not run within the minetest application using the built in /py command.

I can't get the mod working at all on a 64 bit linux system - maybe the mod doesn't like a 64 bit luasocket.so shared library?

These are minor issues though and we are really happy with this mod. Thanks again!

The /py command is only for Windows right now. I don't have Minetest on a Linux system (unless Android counts) and so it would be hard to get it to work on Linux. If you want a quick-and-dirty fix, you can try editing background_launch() in init.lua to read:

Unfortunately, you still won't be able to interrupt the script using "/py" once it runs. If the script gets stuck, you'll have to kill it manually from the commandline. A super quick-and-dirty solution is just to have kill() run ie.os.execute("killall python"), but that will stop all python scripts run by the current user, which is (literally) overkill. I don't know enough about Linux to know how best to implement the killing of just the scripts for Minetest.

Regarding 64-bit, what error message do you get? Dealing with the socket stuff on various systems is nightmarish. There is a feature request for Minetest to include socket handling as a Minetest Lua API, and that would make this much easier.

Thanks, I will pass the lua code on to my son - he's the programmer in the family. It's not too bad tabbing out of the screen and running the scripts from the terminal and the kids have ssh access to the python script folder on our minetest server box.

I got our 64-bit machine working with the mod by re-building a 64 bit version of luasockets3.0 from git and reinstalling minetest from the ubuntu repos. Turns out there's a luasockets package in the repos for ubuntu so I probably didn't have to compile it myself.

The mod seems to pick up core.so from the system folder that luasockets creates when you run 'make install' (/usr/local/lib/lua/5.1/socket/core.so) and it runs fine.

arpruss wrote:I just added x64 support, so you can now run this on both the 32- and 64-bit versions of Minetest (MSVC + Windows only; if you want to use Linux, you'll still need to throw an appropriate core.so file from your luasocket build into the raspberryjammod/socket/ directory).

Hi. I'm trying to install your mod, but it doesn't works.First, I install minetest 0.43-win32-msvc from https://github.com/minetest/minetest/re ... 2-msvc.zip (I can't find a newer version compiled with msvc)Second, I installed Python 3.4.3 and added it to the pathThird, I copied your mod to minetest-0.4.13/modsWhen I run any command, for example:/py donutMinecraft says:" 2016-09-20 16:30:24: ACTION[ServerThread]: launching [start "minetest-rjm-python-script" /D "C:\Users\user\Downloads\minetest-0.4.13-win32-msvc\minetest-0.4.13\bin\..\mods\raspberryjammod\\mcpipy\" /MIN "python" "C:\Users\user\Downloads\minetest-0.4.13-win32-msvc\minetest-0.4.13\bin\..\mods\raspberryjammod\\mcpipy\donut.py" ]" But nothing is done. I have tried with other commands, but it does nothing.What am I doing wrong?Thanks.

arpruss wrote:I just added x64 support, so you can now run this on both the 32- and 64-bit versions of Minetest (MSVC + Windows only; if you want to use Linux, you'll still need to throw an appropriate core.so file from your luasocket build into the raspberryjammod/socket/ directory).

Hi.Can you explain me how to install your mod in Ubuntu Linux? What files do I need to copy and where?Thank you.

Hi, so far I used your mod on minecraft and I really enjoyed! My aim is to program educational minigames and I found the python interface perfects for this aim. Thanks for having produced such nice mod. Now I would like to move on minetest but I found many problems installing the mod. I am a mac user. I installed lua 5.3 and with this successfully compiled luasocket3.0. Anyway it seems that the mod is not recognising the socket:17:29:02: ERROR[main]: ========== ERROR FROM LUA ===========17:29:02: ERROR[main]: Failed to load and run script from 17:29:02: ERROR[main]: /Users/leo/Library/Application Support/minetest/mods/raspberryjammod/init.lua:17:29:02: ERROR[main]: caught (...)17:29:02: ERROR[main]: stack traceback:17:29:02: ERROR[main]: [C]: in function 'require'17:29:02: ERROR[main]: ...plication Support/minetest/mods/raspberryjammod/init.lua:34: in main chunk17:29:02: ERROR[main]: ======= END OF ERROR FROM LUA ========17:29:02: ERROR[main]: Server: Failed to load and run /Users/leo/Library/Application Support/minetest/mods/raspberryjammod/init.lua17:29:02: ERROR[main]: ModError: ModError: Failed to load and run /Users/leo/Library/Application Support/minetest/mods/raspberryjammod/init.lua

I also tried to move the /usr/local/lib/lua/5.3/socket/core.so into the ./socket directory of raspberryjammod but without success. Could you please help me? It would be really great to export all I have done so far on a free platform.Thank you.

This looks like fun, but when i tried it on 0.4.15 it failed. Everything was fine until the game was about to finally begin, then minetest crashed alltogether and complained of a missing lua51.dll file. Am about to try with 0.4.16 mobile. Praying it will work.

Error: the init file attempted to index global "ie" (a nil value). Is this just mobile or is this mod broken? I really want this mod to work!

PS: Is there any possibility of completely emulating the Minetest API for python? Like, you have the lua mod and a config file in which you tell the mod to load and run a python script which you have written? And the python script does stuff just like a normal lua mod would?

But it doesn't work with Linux. I'm using Ubuntu 14.04 and I have installed juajit (see:https://github.com/minetest-mods/irc/issues/21), but without any luck. Any ideas?Thank you.

@jocsamazonI would like to know what specific changes you made in order to run minetest with raspberryjammod?I am running Windows 10, Minetest 0.4.17.1 and Python 3.6.5.I have replaced the mcpipy files as you indicated in your post quoted above, but the mod fails to load with the following error, and as a result, I cannot even test the Python scripts.So how do I fix this error and proceed?