mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Made requested changes
This commit is contained in:
@@ -5,5 +5,5 @@ return {
|
||||
afk_time = 3600*10, --- @setting afk_time The time in ticks that must pass for a player to be considered afk
|
||||
kick_time = 3600*30, --- @setting kick_time The time in ticks that must pass without any active players for all players to be kicked
|
||||
trust_time = 3600*60*10, --- @setting trust_time The time in ticks that a player must be online for to count as trusted
|
||||
update_time = 3600*30, --- @setting update_time How often in ticks the script check for active players
|
||||
update_time = 3600*30, --- @setting update_time How often in ticks the script checks for active players
|
||||
}
|
||||
@@ -76,3 +76,6 @@ get-mead-2= Skål!
|
||||
get-beer-1= 🍺 Pouring A Glass 🍺
|
||||
get-beer-2= 🍻 Chears Mate 🍻
|
||||
verify=Please return to our discord and type r!verify __1__
|
||||
|
||||
[afk-kick]
|
||||
message=All players were kicked because everyone was AFK.
|
||||
@@ -18,14 +18,14 @@ Global.register(primitives, function(tbl)
|
||||
primitives = tbl
|
||||
end)
|
||||
|
||||
--- Kicks an afk player, used to give to for gui to show
|
||||
--- Kicks an afk player, used to add a delay so the gui has time to appear
|
||||
local kick_player =
|
||||
Async.register(function(player)
|
||||
if game.tick - primitives.last_active < config.kick_time then return end -- Safety Catch
|
||||
game.kick_player(player, 'Afk while no active players on the server')
|
||||
game.kick_player(player, 'AFK while no active players on the server')
|
||||
end)
|
||||
|
||||
--- Check for an active player every 5 minutes
|
||||
--- Check for an active player every update_time number of ticks
|
||||
Event.on_nth_tick(config.update_time, function()
|
||||
-- Check for active players
|
||||
for _, player in ipairs(game.connected_players) do
|
||||
@@ -50,7 +50,7 @@ Event.on_nth_tick(config.update_time, function()
|
||||
player.gui.screen.add{
|
||||
type = 'frame',
|
||||
name = 'afk-kick',
|
||||
caption = 'All players were kicked because everyone was afk.',
|
||||
caption = {'afk-kick.message'},
|
||||
}.location = { x=res.width*(0.5 - 0.11*uis), y=res.height*(0.5 - 0.14*uis) }
|
||||
|
||||
-- Kick the player, some delay needed because network delay
|
||||
|
||||
Reference in New Issue
Block a user