[Mod] External Commands [2] [external_cmd]

User avatar
Menche
Member
 
Posts: 994
Joined: Sat Jul 02, 2011 00:43

[Mod] External Commands [2] [external_cmd]

by Menche » Sun Dec 02, 2012 00:43

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:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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.
I am on the Voxelands Forums more often than here.
Try Voxelands (forked from Minetest 0.3) by darkrose
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Sun Dec 02, 2012 03:32

Neato
If you can think it, you can make it.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sun Dec 02, 2012 03:33

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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

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

by Doc » Tue Dec 04, 2012 03:08

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: 994
Joined: Sat Jul 02, 2011 00:43

by Menche » Wed Dec 12, 2012 02:40

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.
I am on the Voxelands Forums more often than here.
Try Voxelands (forked from Minetest 0.3) by darkrose
 

User avatar
Menche
Member
 
Posts: 994
Joined: Sat Jul 02, 2011 00:43

by Menche » Tue Apr 30, 2013 20:57

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.
I am on the Voxelands Forums more often than here.
Try Voxelands (forked from Minetest 0.3) by darkrose
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed May 01, 2013 07:40

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 » Tue Jun 23, 2015 20:17

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
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

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

by rubenwardy » Wed Jun 24, 2015 15:59

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 » Thu Jun 25, 2015 13:16

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

User avatar
Menche
Member
 
Posts: 994
Joined: Sat Jul 02, 2011 00:43

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

by Menche » Thu Jun 25, 2015 18:06

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: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

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

by Milan* » Thu Jul 21, 2016 10:23

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.
 


Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 29 guests