[Mod] External Commands [2] [external_cmd]

Post Reply
User avatar
Menche
Member
Posts: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
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: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Neato
hello, am program. do language in rust. make computer do. okay i go now.

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

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: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
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: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
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.

sfan5
Moderator
Posts: 4094
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: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

Are you teleporting another player with /teleport?
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
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: 255
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.

User avatar
texmex
Member
Posts: 1753
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.

j45
Member
Posts: 12
Joined: Fri Jul 28, 2017 19:32
GitHub: Minetest-j45
IRC: j1233
In-game: j1233 j45
Location: Cambridge, England, UK
Contact:

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

by j45 » Post

download doesnt work

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

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

by Miniontoby » Post

Jan wrote:
Sat Sep 26, 2020 09:04
download doesnt work
If you really want it, I can upload it for you
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

j45
Member
Posts: 12
Joined: Fri Jul 28, 2017 19:32
GitHub: Minetest-j45
IRC: j1233
In-game: j1233 j45
Location: Cambridge, England, UK
Contact:

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

by j45 » Post

yes please, i have been trying to find a way to execute commands without being ig, windows is a nightmare.

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

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

by Miniontoby » Post

https://miniontoby.us5.ircnow.org/fileu ... vePTFd.zip

Will be removed in 3 days automatic
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

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

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

by Menche » Post

Wow, this old thing. I removed the github repo because I was ashamed at the horrible way I handled the input file, LOL. I wouldn't try to send commands too quickly, something may break spectacularly. I'll try to fix it when I have time.

User avatar
Sharpik
Member
Posts: 28
Joined: Tue Feb 04, 2020 21:27
GitHub: Sharpik
Location: Prague, Czech Republic

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

by Sharpik » Post

OK, here is little bit updated version if anyone will need this.

https://github.com/Sharpik/external_cmd

Thanks Menche

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests