[Mod] outgame intervention [outgame_intervention]

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

[Mod] outgame intervention [outgame_intervention]

by Hybrid Dog » Mon Dec 22, 2014 13:19

This mod allows you to let minetest execute a .lua file which you just created.
By default it runs code from a file called "tmp.lua" at your worldpath, which you need to create yourself.
You can e.g. kick this player called "admin":
* go to the folder of the world which is used
* add the tmp.lua file
* open it with a texteditor
* write minetest.kick_player("admin", "Why do you use such a name? We all know that you are not a real admin.")
* save it, e.g. by pressing ctrl+s
* be happy that it worked

l put these links here
http://dev.minetest.net/Category:Methods
http://dev.minetest.net/minetest.chat_send_all
http://dev.minetest.net/minetest.request_shutdown
http://dev.minetest.net/minetest.kick_player

License: WTFPL
Download: zip, tar.gz
github: outgame_intervention

Image

If you got ideas or found bugs, please tell them to me.

How to install a mod?
Attachments
2014-12-22-142819_1280x1024_scrot.png
2014-12-22-142819_1280x1024_scrot.png (14.72 KiB) Viewed 864 times
Last edited by Hybrid Dog on Thu May 26, 2016 10:15, edited 7 times in total.
 

User avatar
TG-MyinaWD
Member
 
Posts: 355
Joined: Thu May 08, 2014 21:22
GitHub: Maddie-Myina
IRC: Maddie-Myina
In-game: .

Re: [Mod] outgame intervention [outgame_intervention]

by TG-MyinaWD » Mon Dec 22, 2014 14:41

Yeah nicely done.
But would be cool can make an Temporary Mod. Like few new tools or something. Maybe an Signature mod per World/Server.

That if can have it work and run the textures and all.

Haven't tested yet.
I'm a Transgender no shame about it.
I prefer to be considered as a "Girl/Lady/Miss/Madam/Female" for now on.
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: [Mod] outgame intervention [outgame_intervention]

by Hybrid Dog » Mon Dec 22, 2014 15:03

Alt. Tester wrote:But would be cool can make an Temporary Mod. Like few new tools or something. Maybe an Signature mod per World/Server.

That if can have it work and run the textures and all.

you can put mods into <world>/worldmods/ to have it only for this world
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: [Mod] outgame intervention [outgame_intervention]

by ExeterDad » Mon Dec 22, 2014 20:17

So in theory. If this mod was installed on a remote server, could one echo or use cat via a ssh shell and run commands the same way?
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: [Mod] outgame intervention [outgame_intervention]

by Hybrid Dog » Mon Dec 22, 2014 20:46

ExeterDad wrote:So in theory. If this mod was installed on a remote server, could one echo or use cat via a ssh shell and run commands the same way?

He/she would need e.g. to use nano and edit/create the tmp.lua file.
$ cd <worldpath>
$ nano
write minetest.chat_send_all("hello, players")
ctrl+o
write tmp.lua
enter
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: [Mod] outgame intervention [outgame_intervention]

by ExeterDad » Tue Dec 23, 2014 00:04

so just as long as the command is written to the tmp.lua file...
the mod will repeatedly check the file and execute whatever command is written there?
So from a shell:
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
lee@my-linux-server ~ $ echo 'minetest.chat_send_all("hello, players")' > /path/to/worldfolder/tmp.lua

Would write the command to the file and it should be read. This is freaking huge! Scripts can be written, data collected, and all kinds of stuff can be done automagically!

I am pretty excited. You opened some doors with this script :D
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: [Mod] outgame intervention [outgame_intervention]

by Hybrid Dog » Tue Dec 23, 2014 12:46

ExeterDad wrote:so just as long as the command is written to the tmp.lua file...
the mod will repeatedly check the file and execute whatever command is written there?

It repeatedly checks the file and if it's not empty, it executes it and makes it empty that the file gets executed only one time. If you want to have iterations, just use lua iterations, you can also add a new globalstep function.
Take care that you don't write a typo, else minetest(server) would crash(shutdown), l think.

ExeterDad wrote:I am pretty excited. You opened some doors with this script :D

The doors weren't locked before.
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: [Mod] outgame intervention [outgame_intervention]

by ExeterDad » Tue Dec 23, 2014 13:30

Hybrid Dog wrote:The doors weren't locked before.

Well you turned on a light bulb for me :)
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] outgame intervention [outgame_intervention]

by Krock » Tue Dec 23, 2014 14:37

It's easy to crash a server by saving something incomplete.
It would be cool if it's possible to add something like a try {} catch {} around the dofile() part.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46



by Hybrid Dog » Tue Sep 22, 2015 15:22

Krock wrote:It's easy to crash a server by saving something incomplete.

fixed
 


Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 20 guests

cron