[Open Assets] Kick Last Joiner

This content may be freely modified and/or maintained by anyone.
Status
Not open for further replies.

LJ Sonik

Developer
Sonic Team Junior
A normal day on Srb2:
<Sonic the Hedgehog> lol 2 much fun
<Tails the Fox> this server is awsome :D
Player 5 has joined the game (node 4)
Player Address is 123.456.789.42:5029
Player 5 renamed to Edgehox
<Edgehox> hi
<Knuckles the Edchina> AAAAAAAHHHHHHHHH
<Sonic the Hedgehog> OMG RESYNCH
<Tails the Fox> NUUUUUUUUUU
Sonic the Hedgehog left the game (Synch failure)
Tails the Fox left the game (Synch failure)
Knuckles the Edchina left the game (Synch failure)
>kick 4
Edgehox has been kicked, but it's too late, the server is already empty XD
If you are used to this, kj.lua (stands for "kick joiner") is for you!

This tiny Lua script features a "kj" command ("kickjoiner" works too) that will kick the last player who joined the server.
This can be particularly useful when the game starts desynching after someone joined and you don't have enough time to kick them manually.
The default kick reason is "Please rejoin", but you can specify a custom message if wanted.
I recommend binding this command to a key so it is even faster to use and you don't need to specify the reason each time.

Syntax
kj [reason]
kickjoiner [reason]

"reason" is optional and can contain space even when not quoted. If omitted, it'll default to "Please rejoin".
Note that both "kj" and "kickjoiner" have the exact same behavior.
Also keep in mind there is a length limit for kick messages in Srb2.

Examples
>kj
Joiner has been kicked (Please rejoin)
>kj Sorry resynch
Joiner has been kicked (Sorry resynch)
>kickjoiner sorry bro pls rejoin
Joiner has been kicked (sorry bro pls rejoin)
 

Attachments

  • kj.lua
    495 bytes · Views: 537
Last edited:
This is kind of a nitpick but I really don't think duplicate scripts with different names are necessary. I'd just go with one and let players shorten it to whatever they want by themselves.
 
Last edited:
Sorry for the wait, this does work fine, but I highly recommend keeping only one of the script names available to download. It could be quite annoying for the MS and people having to have both just in case the host is using one they wouldn't have otherwise.
 
Last edited:
Try making one command a wrapper for the other. So "kj" just calls the same function as "kickjoiner" or even writes "kickjoiner" in the console for you.
 
When the sun sets; we will not forget the red sun over paradise

Try making one command a wrapper for the other. So "kj" just calls the same function as "kickjoiner" or even writes "kickjoiner" in the console for you.

They do use the same function. Nonetheless, there are still two identical scripts with different names.
 
Aw, almost a week it's been released and I realize just now.
Anyway, I removed KickLastJoiner.lua, so everyone has the same file name and can add it quickly.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top