1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-25 21:29:06 +02:00

Fix modules

This commit is contained in:
Gerkiz 2024-11-05 20:10:48 +01:00
parent 2ff53ea036
commit edf5a347d5
2 changed files with 30 additions and 29 deletions

View File

@ -789,15 +789,16 @@ end
Gui.on_click(
auto_stash_button_name,
function (event)
local is_spamming = SpamProtection.is_spamming(event.player, nil, 'Autostash click')
if is_spamming then
return
end
local player = event.player
if not player or not player.valid or not player.character then
return player.print(module_name .. 'It seems that you are not in the realm of living.', { color = Color.warning })
end
local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click')
if is_spamming then
return
end
if player.controller_type == defines.controllers.remote then
return player.print(module_name .. 'It seems that you are not in the realm of living.', { color = Color.warning })
@ -809,13 +810,13 @@ Gui.on_click(
if script.active_mods['MtnFortressAddons'] then
Event.add("mtn-ctrl-autostash-all", function (event)
local player = game.get_player(event.player_index)
if not player or not player.valid then
local is_spamming = SpamProtection.is_spamming(event.player, nil, 'Autostash click')
if is_spamming then
return
end
local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click')
if is_spamming then
local player = game.get_player(event.player_index)
if not player or not player.valid then
return
end
@ -835,13 +836,13 @@ if script.active_mods['MtnFortressAddons'] then
end)
Event.add("mtn-ctrl-autostash-ores", function (event)
local player = game.get_player(event.player_index)
if not player or not player.valid then
local is_spamming = SpamProtection.is_spamming(event.player, nil, 'Autostash click')
if is_spamming then
return
end
local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click')
if is_spamming then
local player = game.get_player(event.player_index)
if not player or not player.valid then
return
end
@ -861,13 +862,13 @@ if script.active_mods['MtnFortressAddons'] then
end)
Event.add("mtn-ctrl-autostash-furnaces", function (event)
local player = game.get_player(event.player_index)
if not player or not player.valid then
local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click')
if is_spamming then
return
end
local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click')
if is_spamming then
local player = game.get_player(event.player_index)
if not player or not player.valid then
return
end
@ -888,15 +889,13 @@ if script.active_mods['MtnFortressAddons'] then
end)
Event.add("mtn-ctrl-autostash-filtered", function (event)
local player = game.get_player(event.player_index)
if not player or not player.valid then
local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click')
if is_spamming then
return
end
if not player then return end
local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click')
if is_spamming then
local player = game.get_player(event.player_index)
if not player or not player.valid then
return
end
@ -917,13 +916,13 @@ if script.active_mods['MtnFortressAddons'] then
end)
Event.add("mtn-ctrl-autostash-wagon", function (event)
local player = game.get_player(event.player_index)
if not player or not player.valid then
local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click')
if is_spamming then
return
end
local is_spamming = SpamProtection.is_spamming(player, nil, 'Autostash click')
if is_spamming then
local player = game.get_player(event.player_index)
if not player or not player.valid then
return
end

View File

@ -13,7 +13,7 @@ local main_text = '[Spam Info] '
Global.register(
this,
function(t)
function (t)
this = t
end
)
@ -52,6 +52,8 @@ function Public.is_spamming(player, value_to_compare, text)
player = game.get_player(player)
end
if not player or not player.valid then return end
if not this.prevent_spam[player.index] then
return false
end
@ -107,7 +109,7 @@ end
Event.add(
defines.events.on_player_joined_game,
function(event)
function (event)
local player = game.get_player(event.player_index)
if not player then
return
@ -119,7 +121,7 @@ Event.add(
end
)
Event.on_init(
function()
function ()
Public.reset_spam_table()
end
)