Page 1 of 1

Minetest Console for Windows users

PostPosted: Sat Dec 22, 2018 19:56
by bosapara
Image Minetest Console for Windows
___________________________________________________________________________________________________

Image Download | Github


Image

How to install? - Easy
1. Download and install AutoHotkey
2. Add external_cmd mod to your server
3. Download minetest.ahk and edit path at 'minetest.ahk' F:\minetest\worlds\myworld\message >> D:\myserver\worlds\test\message
4. Start server and minetest.ahk

bingo!

P.S. To close script use 'escape' button

Re: Minetest Console for Windows users

PostPosted: Sun Dec 23, 2018 18:56
by rnd
good. another way is to use 'custom web server' software to pass incoming message to minetest (easily written in any language c++, rust,.. or nodejs) using minetest http_api. I made an example using my 'basic_robot' mod - you can write text in browser like: "http://address/your command"
and this almost instantly shows up in game: https://github.com/ac-minetest/basic_robot/tree/master/scripts/http/webcommands

Re: Minetest Console for Windows users

PostPosted: Fri Dec 28, 2018 21:18
by sorcerykid
I wonder if it might be possible to use IPC with a named pipe or a non-blocking socket on Linux to communicate with the Minetest mods. That would probably be the most seamless and efficient, since it doesn't require opening and closing temporary files (which works, but is kind of a kludge).

Re: Minetest Console for Windows users

PostPosted: Mon May 20, 2019 17:33
by Miniontoby
It doesn't work by me, how does it usually works

Re: Minetest Console for Windows users

PostPosted: Mon May 20, 2019 17:52
by bosapara
Miniontoby wrote:It doesn't work by me, how does it usually works



How to install? - Easy
1. Download and install AutoHotkey
2. Add external_cmd mod to your server
3. Download minetest.ahk and edit path at 'minetest.ahk' F:\minetest\worlds\myworld\message >> D:\myserver\worlds\test\message (an example)
4. Start server and minetest.ahk

Re: Minetest Console for Windows users

PostPosted: Mon May 20, 2019 17:56
by Miniontoby
bosapara wrote:
Miniontoby wrote:It doesn't work by me, how does it usually works



How to install? - Easy
1. Download and install AutoHotkey
2. Add external_cmd mod to your server
3. Download minetest.ahk and edit path at 'minetest.ahk' F:\minetest\worlds\myworld\message >> D:\myserver\worlds\test\message (an example)
4. Start server and minetest.ahk


But that is the problem / that doesn't work (I had tested "/sd" and that doesn't work)

Re: Minetest Console for Windows users

PostPosted: Mon May 20, 2019 18:33
by bosapara
Miniontoby wrote:But that is the problem / that doesn't work (I had tested "/sd" and that doesn't work)


Use /shutdown

Re: Minetest Console for Windows users

PostPosted: Mon May 20, 2019 18:48
by Miniontoby
It doesn't work. And where do I need to put external_cmd mod exactly?

Re: Minetest Console for Windows users

PostPosted: Mon May 20, 2019 19:07
by bosapara
Miniontoby wrote:It doesn't work. And where do I need to put external_cmd mod exactly?


All works perfect, you do something wrong
"external_cmd" Install it as minetest mod

Re: Minetest Console for Windows users

PostPosted: Tue May 21, 2019 06:16
by Miniontoby
That does I had done. And in world.mt do I have set external_cmd to true.

Re: Minetest Console for Windows users

PostPosted: Tue May 21, 2019 07:21
by bosapara
Miniontoby wrote:That does I had done. And in world.mt do I have set external_cmd to true.


if it still doesn't work, check again path folder to world of "minetest.ahk", also check disk letter - C, D, F etc

D:\minetest\worlds\myworld\message

Re: Minetest Console for Windows users

PostPosted: Tue May 21, 2019 08:52
by Miniontoby
I see that the program is does write to the file, but I'm hasn't checked of it is working in the server

It does work!!

Re: Minetest Console for Windows users

PostPosted: Tue May 21, 2019 09:11
by Miniontoby
And can you make that it can do every command in minetest ("/grant <player> <priv>", "/kill <player>")

Re: Minetest Console for Windows users

PostPosted: Tue May 21, 2019 11:46
by arrangebizarre
Doesn't work on my Windows 10

Re: Minetest Console for Windows users

PostPosted: Tue May 21, 2019 11:53
by Miniontoby
arrangebizarre wrote:Doesn't work on my Windows 10


I do it on Windows 10 and it does work. If you need my code, I can send it to you

Re: Minetest Console for Windows users

PostPosted: Tue May 21, 2019 12:12
by bosapara
Miniontoby, about "/grant" command - for me it works good. Just add "admin" name to minetest.conf and start server

If you need "/kill" command add this code to external cmd or as different mod

Code: Select all
minetest.register_chatcommand("kill", {
   description = "Kill [player] or you",
   param = "[player]",
--   privs = {hp = true},
   func = function(name, param)
      local target
      local targetname
      if param == "" then
         target = minetest.get_player_by_name(name)
      else
         target = minetest.get_player_by_name(param)
      end
      
      local admin = minetest.setting_get("name")
      if admin == nil then admin = "SERVER" end
      if name ~= admin then
         return
      end      
      
      
      if target then
         targetname = target:get_player_name()
         target:set_hp(0)
         minetest.chat_send_player(name, "Killed " .. targetname .. ".")
         if minetest.setting_getbool("enable_command_feedback") then
            minetest.chat_send_all(minetest.colorize("#7F7F7F", "[".. name ..": Killed ".. targetname ..".]"))
         end
         if math.random(1, 5) == 1 and minetest.setting_getbool("morecommands_enable_particles") then
            easter_egg(targetname)
         end
      else
         minetest.chat_send_player(name, minetest.colorize("#FF0000", "Player not found: " .. param))      
      end
   end
})

Re: Minetest Console for Windows users

PostPosted: Tue May 21, 2019 12:15
by bosapara
arrangebizarre wrote:Doesn't work on my Windows 10


It doesn't metter what you use Win XP or Win 10, mod and script works the same.

Re: Minetest Console for Windows users

PostPosted: Tue May 21, 2019 16:31
by Miniontoby
arrangebizarre wrote:Doesn't work on my Windows 10


arrangebizarre, do you had done this in your PowerShell (Use [windows_key] + "X" and click on "Windows PowerShell") echo [message] > "<dir of Minetest>\worlds\<worldname>\message"