[Mod] External Commands [2] [external_cmd]

Post Reply
User avatar
Menche
Member
Posts: 997
Joined: Sat Jul 02, 2011 00:43
IRC: Menche
In-game: Menche
Location: An island in a lava lake.

[Mod] External Commands [2] [external_cmd]

by Menche » Post

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
Last edited by Menche on Tue Apr 30, 2013 21:03, edited 1 time in total.
An innocent kitten dies every time you top-post.

User avatar
jordan4ibanez
Member
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez
Location: Rhode Island, USA

by jordan4ibanez » Post

Neato
I've been gone for a long time

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

Great idea.
Take a look at this. You may find it interesting.
Last edited by kaeza on Sun Dec 02, 2012 03:34, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Doc
Member
Posts: 75
Joined: Sun Nov 04, 2012 00:21

by Doc » Post

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)
Last edited by Doc on Tue Dec 04, 2012 03:09, edited 1 time in total.

User avatar
Menche
Member
Posts: 997
Joined: Sat Jul 02, 2011 00:43
IRC: Menche
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

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.
Last edited by Menche on Wed Dec 12, 2012 02:42, edited 1 time in total.
An innocent kitten dies every time you top-post.

User avatar
Menche
Member
Posts: 997
Joined: Sat Jul 02, 2011 00:43
IRC: Menche
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

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.
An innocent kitten dies every time you top-post.

User avatar
sfan5
Moderator
Posts: 3924
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

IIRC there was already a mod that did this, anyways nice Mod!
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

AlexeyPetrov
New member
Posts: 2
Joined: Tue Jun 23, 2015 11:43

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

by AlexeyPetrov » Post

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?

User avatar
rubenwardy
Moderator
Posts: 6184
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

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

by rubenwardy » Post

Are you teleporting another player with /teleport?

AlexeyPetrov
New member
Posts: 2
Joined: Tue Jun 23, 2015 11:43

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

by AlexeyPetrov » Post

I could not make '/teleport' to work either way (or '/home' for that matter)

User avatar
Menche
Member
Posts: 997
Joined: Sat Jul 02, 2011 00:43
IRC: Menche
In-game: Menche
Location: An island in a lava lake.

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

by Menche » Post

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.

User avatar
Milan*
Member
Posts: 252
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant
Location: Germany
Contact:

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

by Milan* » Post

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.
Illuna Minetestservers | Mastodon | [ matrix ] | I may host you a Minetestserver, just contact me.

User avatar
texmex
Member
Posts: 1752
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

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

by texmex » Post

There's a small PR pending for the maintainer.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

Post Reply

Who is online

Users browsing this forum: racal and 7 guests