*Clap* *Clap* I've got a request

User avatar
HackerinPink
Member
Posts: 43
Joined: Tue Oct 29, 2019 19:36
Location: Somewhere in a 100% regular place.
Contact:

*Clap* *Clap* I've got a request

by HackerinPink » Post

So I'm usually not in a position of power, but on one server, I have the kick privilege.
So I need an repeated kicker in a nice little CSM. Here's what I kinda hope it does:

1. The ability to have a /kick WITH a custom message.
2. The ability to set a timer in seconds/minutes/etc_if_needed for how long it will kick.
3. The ability for the CSM to either
A) repeatedly SPAM the /kick command
B) somehow kick a player right when he joins the server.

Here is how I hope it will work:

** sumspammer88 joined the game
.rkick sumspammer88 10s
** sumspammer88 left the game
** sumspammer88 joined the game
** sumspammer88 left the game
...ect

And so, hopefully, you get the point.

So yea there goes my humble CSM request. Hope you guys actually try to help since I'm too lazy to understand Lua...
-HackerinPink
Last edited by HackerinPink on Thu Dec 19, 2019 19:50, edited 2 times in total.
A Dude with power and Intellect.

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

Re: *Clap* *Clap* I've got a suggestion

by Miniontoby » Post

I should say you can do make a mesecons circuit (if mesecons is on your server)

Place a command block with this code kick [name of person] (P.S. please replace the "[name of person]" in the name of that person) and make a circuit likes the image I attached

(There is an mesecons torch on the cobblestone block)
Image

P.S. if this isn't what you would like to have I will make a code for you.
Attachments
The Circuit
The Circuit
screenshot_20191103_181928.png (237.08 KiB) Viewed 1003 times
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
HackerinPink
Member
Posts: 43
Joined: Tue Oct 29, 2019 19:36
Location: Somewhere in a 100% regular place.
Contact:

Re: *Clap* *Clap* I've got a suggestion

by HackerinPink » Post

The server I'm a moderator at isn't my server, but someone else's. The server doesn't have the mesecons mod, and getting the mod would be complicated. It would really be appreciated if you can make a CSM code with the features I posted in the original post. Honestly, if you do this for me, I will appreciate it 100 times over.

(please make this CSM I need it super bad XD)
If you do decide to help me with this, take your time!
Hope you help me with this.
-HackerinPink
A Dude with power and Intellect.

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

But if installing the mesecons mod would be complicated, then a csm mod installing would be also compilcated, I think
But I will try it for you.
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
HackerinPink
Member
Posts: 43
Joined: Tue Oct 29, 2019 19:36
Location: Somewhere in a 100% regular place.
Contact:

Re: *Clap* *Clap* I've got a request

by HackerinPink » Post

Im not the server admin, and he isnt that technical, so installing will be a pain. since I've installed CSM's before, I know how to do it, and as an added bonus, only I have to install the CSM.
A Dude with power and Intellect.

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

Oké, but I don't know of it is going to work if I have the code. But I will make it.
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
HackerinPink
Member
Posts: 43
Joined: Tue Oct 29, 2019 19:36
Location: Somewhere in a 100% regular place.
Contact:

Re: *Clap* *Clap* I've got a request

by HackerinPink » Post

okay, Thanks a lot.
I look forward to it!
A Dude with power and Intellect.

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

I have a code, but it doesn't work as an CSM (It isn't my mistake) and it does work as an normal mod (But I haven't tested out of the kicking works).
I don't go publishing it now, because I'm waiting until it does work as an CSM (And I have already an topic for help made).
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
HackerinPink
Member
Posts: 43
Joined: Tue Oct 29, 2019 19:36
Location: Somewhere in a 100% regular place.
Contact:

Re: *Clap* *Clap* I've got a request

by HackerinPink » Post

Ah, I see. okay I'm not rushing you, take your time.
A Dude with power and Intellect.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: *Clap* *Clap* I've got a request

by PolySaken » Post

Try this:

Code: Select all

local modstorage = core.get_mod_storage()
modstorage:set_string("switch", "0")

local player=""

while modstorage:set_string("switch")=="1" do
  minetest.send_chat_message("/kick "..player)
end

core.register_chatcommand("kick_on", {
	description = "enable autokick",
	func = function()
		modstorage:set_string("switch", "1")
	end,
})

core.register_chatcommand("kick_off", {
	description = "disable autokick",
	func = function()
		modstorage:set_string("switch", "0")
	end,
})
replace player="" with player=<the target's name>,
and then type .kick_on in chat
you can use .kick_off to disable it
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

But I already make a code And I'm nearly done
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
HackerinPink
Member
Posts: 43
Joined: Tue Oct 29, 2019 19:36
Location: Somewhere in a 100% regular place.
Contact:

Re: *Clap* *Clap* I've got a request

by HackerinPink » Post

@Polysaken

Nice code, I appreciate it, but it isn't the kind of functionality i'm looking for.
What am I supposed to do, change the CSM every time i want to kick another player?
However, I appreciate the effort.
A Dude with power and Intellect.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: *Clap* *Clap* I've got a request

by PolySaken » Post

HackerinPink wrote:@Polysaken

What am I supposed to do, change the CSM every time i want to kick another player?
Essentially yes. But you could make a command that changes the name like this:

Code: Select all

local modstorage = core.get_mod_storage()
modstorage:set_string("switch", "0")
modstorage:set_string("name", "nullplayer")

local player=""

while modstorage:get_string("switch")=="1" do
  minetest.send_chat_message("/kick "..modstorage:get_string("name"))
end

core.register_chatcommand("kick_on", {
   description = "enable autokick",
   func = function()
      modstorage:set_string("switch", "1")
   end,
})

core.register_chatcommand("kick_off", {
   description = "disable autokick",
   func = function()
      modstorage:set_string("switch", "0")
   end,
})

core.register_chatcommand("change_name", {
   description = "modify playername to kick",
   func = function(param)
      modstorage:set_string("name", param)
   end,
})
You can then use the command .change_name <player> to set the player to kick.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

Or use my code (p.s. I haven't test it but it does work) and you can kick more than one player repeatly

EDITED!!!
The previous code isn't the good one. But this one is the good one
kick_csm.zip
kick_csm_the good one
(764 Bytes) Downloaded 71 times
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
HackerinPink
Member
Posts: 43
Joined: Tue Oct 29, 2019 19:36
Location: Somewhere in a 100% regular place.
Contact:

Re: *Clap* *Clap* I've got a request

by HackerinPink » Post

@Polysaken

This makes things easier, but why can't it be in one command like MinionToby's??
It's over complicating things to use 2 commands to perform 1 simple function.

I'm testing MinionToby's one now... let's see if it works!

EDIT:
Bad news, it gave me a mod error. This is what I saw (copied from debug.txt)

Code: Select all

2019-11-22 13:28:02: ERROR[Main]: ModError: Failed to load and run script from C:\MTC\0.4.16\bin\..\clientmods\kick_csm\init.lua:
2019-11-22 13:28:02: ERROR[Main]: C:\MTC\0.4.16\bin\..\clientmods\kick_csm\init.lua:27: attempt to call field 'register_on_receiving_chat_message' (a nil value)
2019-11-22 13:28:02: ERROR[Main]: Check debug.txt for details.
A Dude with power and Intellect.

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

HackerinPink wrote:@Polysaken

This makes things easier, but why can't it be in one command like MinionToby's??
It's over complicating things to use 2 commands to perform 1 simple function.

I'm testing MinionToby's one now... let's see if it works!

EDIT:
Bad news, it gave me a mod error. This is what I saw (copied from debug.txt)

Code: Select all

2019-11-22 13:28:02: ERROR[Main]: ModError: Failed to load and run script from C:\MTC\0.4.16\bin\..\clientmods\kick_csm\init.lua:
2019-11-22 13:28:02: ERROR[Main]: C:\MTC\0.4.16\bin\..\clientmods\kick_csm\init.lua:27: attempt to call field 'register_on_receiving_chat_message' (a nil value)
2019-11-22 13:28:02: ERROR[Main]: Check debug.txt for details.
That was the difficult part and that I am going to solve
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

Here is the eddited one and hope fully it does work
kick_csm.zip
The hope fully good one
(767 Bytes) Downloaded 80 times
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
HackerinPink
Member
Posts: 43
Joined: Tue Oct 29, 2019 19:36
Location: Somewhere in a 100% regular place.
Contact:

Re: *Clap* *Clap* I've got a request

by HackerinPink » Post

Sadly, upon testing the CSM, I got a very similar, if not the same, error message.

Code: Select all

2019-11-28 10:52:48: ERROR[Main]: ModError: Failed to load and run script from /home/[username]/snap/minetest-luk3yx-4/97/.minetest/clientmods/kick_csm/init.lua:
2019-11-28 10:52:48: ERROR[Main]: ...etest-luk3yx-4/97/.minetest/clientmods/kick_csm/init.lua:27: attempt to call field 'register_on_receiving_chat_message' (a nil value)
2019-11-28 10:52:48: ERROR[Main]: Check debug.txt for details.
(copied from debug.txt)
A Dude with power and Intellect.

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

Please try to add the line csm_restriction_flags = 0 to the minetest.conf file for the server that you're testing with and try again.

And I'm trying to solve the problem also
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: *Clap* *Clap* I've got a request

by PolySaken » Post

Miniontoby wrote:Please try to add the line csm_restriction_flags = 0 to the minetest.conf file for the server that you're testing with and try again.

And I'm trying to solve the problem also
This doesn't seem very safe. If your mod requires users to disable security features, it's probably not a great mod.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: *Clap* *Clap* I've got a request

by Lone_Wolf » Post

PolySaken wrote:
Miniontoby wrote:Please try to add the line csm_restriction_flags = 0 to the minetest.conf file for the server that you're testing with and try again.

And I'm trying to solve the problem also
This doesn't seem very safe. If your mod requires users to disable security features, it's probably not a great mod.
It doesn't disable security features. It just re-enables CSMs. Which are completely disabled server-side by default in 5.x
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

You need to add that, because it could block a part of the code.

And you need to use the latest version of Minetest (5.1.0)? If not, what version are you using?
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
HackerinPink
Member
Posts: 43
Joined: Tue Oct 29, 2019 19:36
Location: Somewhere in a 100% regular place.
Contact:

Re: *Clap* *Clap* I've got a request

by HackerinPink » Post

@PolySaken
hmm..?

@Lone_Wolf
I'm not using 5.x, I'm using the 'luk3yx-4' fork, which allows me to play both 4.x servers and 5.x servers.

@Miniontoby
I'm using the 'luk3yx-4' fork, so I guess I'm using 4.x, but I'm not sure
A Dude with power and Intellect.

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

Re: *Clap* *Clap* I've got a request

by Miniontoby » Post

With snap you could have the newest version (and I think that you havent got an interface, but that you only can run servers (but that is the case by me with snap on my pi) )
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: *Clap* *Clap* I've got a request

by Lone_Wolf » Post

HackerinPink wrote:@Lone_Wolf
I'm not using 5.x, I'm using the 'luk3yx-4' fork, which allows me to play both 4.x servers and 5.x servers.
If you have the csm_restrictions setting then in this case you should consider yourself 5.x
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests