Page 1 of 1

[Mod] External Commands [2] [external_cmd]

PostPosted: Sun Dec 02, 2012 00:43
by Menche
External Commands
This mod allows sending chat commands and messages from outside minetest. I made it so scripts could interact with the server.
A bug: you need to manually create a player named "SERVER" with all privs for some commands to work.

How to use
Write something to a file called "message" in the world folder. When that file is written, external_cmd reads the first line. The syntax is exactly the same as if you were typing it into the in-game chat box.
This is the bash command I use:
Code: Select all
echo [message] > ~/.minetest/worlds/[world]/message


License:
LGPL
Some code is from builtin/chatcommands.lua

Dependencies
none

Download
Git: repo
Version 1: download zip
Version 2: download zip
now reads from world folder rather than mod folder
Version 3: download zip
now runs commands as the server admin

PostPosted: Sun Dec 02, 2012 03:32
by jordan4ibanez
Neato

PostPosted: Sun Dec 02, 2012 03:33
by kaeza
Great idea.
Take a look at this. You may find it interesting.

PostPosted: Tue Dec 04, 2012 03:08
by Doc
Awesome! I should dig into my Java and make a gui for this cool mod. I could possibly make networking for it! (things like remote control)

PostPosted: Wed Dec 12, 2012 02:40
by Menche
Update: now reads from a file in the world folder rather than the mod folder, so it can be used if you're running multiple servers.
A bug I found: it requires you to manually create a player named "SERVER" with all privs. I can't figure out how to create that player from the mod, and there doesn't seem to be a way around it if I use the builtin chatcommands. Maybe I need to make a custom version of chatcommands.lua.

PostPosted: Tue Apr 30, 2013 20:57
by Menche
Updates: Some commands used to fail because of insufficient privs. Now the mod runs commands as the server admin, if set. You should have the server admin set (name = [something]) for all commands to work with this mod.

PostPosted: Wed May 01, 2013 07:40
by sfan5
IIRC there was already a mod that did this, anyways nice Mod!

Re: [Mod] External Commands [2] [external_cmd]

PostPosted: Tue Jun 23, 2015 20:17
by AlexeyPetrov
Hi all, I realize it is an old thread, but just in case.

I installed the mod and it works, but not all the commands I've tried.

For example '/give' works, but '/teleport' does not. Any ideas why?

Re: [Mod] External Commands [2] [external_cmd]

PostPosted: Wed Jun 24, 2015 15:59
by rubenwardy
Are you teleporting another player with /teleport?

Re: [Mod] External Commands [2] [external_cmd]

PostPosted: Thu Jun 25, 2015 13:16
by AlexeyPetrov
I could not make '/teleport' to work either way (or '/home' for that matter)

Re: [Mod] External Commands [2] [external_cmd]

PostPosted: Thu Jun 25, 2015 18:06
by Menche
AlexeyPetrov wrote:I could not make '/teleport' to work either way (or '/home' for that matter)

Did you either set a server admin (the 'name' option in the conf file) or create a special user 'SERVER' with all privs? The mod requires one of those, so it can tell minetest who the commands are being sent by.

If you create the special user, use '/setpassword SERVER <keyboard mashing>' and '/grant SERVER all'. This user is not meant to be logged into.

Unless you set yourself as the admin and are logged in while sending the command, '/teleport' on yourself and '/home' will not work because the sender of the command isn't online.

Re: [Mod] External Commands [2] [external_cmd]

PostPosted: Thu Jul 21, 2016 10:23
by Milan*
fyi SERVER is not needed since it just use the admin account... i wonder how i can add feedback to the issuer?
For example: when i add this somehow into a webpage, i would love to have access to the output of /status for example.

Re: [Mod] External Commands [2] [external_cmd]

PostPosted: Tue May 02, 2017 12:22
by texmex
There's a small PR pending for the maintainer.