1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2026-06-20 16:32:28 +02:00

0.17 compatibility

This commit is contained in:
MewMew
2019-03-03 22:50:51 +01:00
parent fb16baa0be
commit 269890e22e
16 changed files with 92 additions and 171 deletions
+43
View File
@@ -37,4 +37,47 @@ function spaghetti()
game.forces["player"].technologies["worker-robots-speed-4"].enabled = false
game.forces["player"].technologies["worker-robots-speed-5"].enabled = false
game.forces["player"].technologies["worker-robots-speed-6"].enabled = false
end
function dump_layout()
local surface = game.surfaces["labyrinth"]
game.write_file("layout.lua", "" , false)
local area = {
left_top = {x = 0, y = 0},
right_bottom = {x = 32, y = 32}
}
local entities = surface.find_entities_filtered{area = area}
local tiles = surface.find_tiles_filtered{area = area}
for _, e in pairs(entities) do
local str = "{position = {x = " .. e.position.x
str = str .. ", y = "
str = str .. e.position.y
str = str .. '}, name = "'
str = str .. e.name
str = str .. '", direction = '
str = str .. tostring(e.direction)
str = str .. ', force = "'
str = str .. e.force.name
str = str .. '"},'
if e.name ~= "player" then
game.write_file("layout.lua", str .. '\n' , true)
end
end
game.write_file("layout.lua",'\n' , true)
game.write_file("layout.lua",'\n' , true)
game.write_file("layout.lua",'Tiles: \n' , true)
for _, t in pairs(tiles) do
local str = "{position = {x = " .. t.position.x
str = str .. ", y = "
str = str .. t.position.y
str = str .. '}, name = "'
str = str .. t.name
str = str .. '"},'
game.write_file("layout.lua", str .. '\n' , true)
end
end
+1 -2
View File
@@ -34,7 +34,7 @@ require "on_tick_schedule"
-----------------------------
---- enable maps here ----
require "maps.biter_battles"
--require "maps.biter_battles"
--require "maps.cave_miner"
--require "maps.labyrinth"
--require "maps.spooky_forest"
@@ -48,7 +48,6 @@ require "maps.biter_battles"
--require "maps.deep_jungle"
--require "maps.crossing"
--require "maps.anarchy"
--require "maps.railworld"
--require "maps.spaghettorio"
--require "maps.lost_desert"
--require "maps.empty_map"
-1
View File
@@ -22,7 +22,6 @@ local function on_player_joined_game(event)
end
if player.online_time == 0 then
player.insert{name = 'iron-axe', count = 1}
player.insert{name = 'iron-plate', count = 32}
end
end
-1
View File
@@ -11,7 +11,6 @@ local function on_player_joined_game(event)
local player = game.players[event.player_index]
if player.online_time < 1 then
player.insert({name = "pistol", count = 1})
player.insert({name = "iron-axe", count = 1})
player.insert({name = "raw-fish", count = 1})
player.insert({name = "firearm-magazine", count = 16})
player.insert({name = "iron-plate", count = 32})
+4 -10
View File
@@ -72,7 +72,7 @@ local function secret_shop(pos, surface)
{price = {{"coin", math_random(5,15)}}, offer = {type = 'give-item', item = 'shotgun-shell', count = 1}},
{price = {{"coin", math_random(8000,16000)}}, offer = {type = 'give-item', item = 'power-armor-mk2', count = 1}},
{price = {{"coin", math_random(80,160)}}, offer = {type = 'give-item', item = 'solar-panel-equipment', count = 1}},
{price = {{"coin", math_random(4,8)}}, offer = {type = 'give-item', item = 'raw-wood', count = 50}},
{price = {{"coin", math_random(4,8)}}, offer = {type = 'give-item', item = 'wood', count = 50}},
{price = {{"coin", math_random(4,8)}}, offer = {type = 'give-item', item = 'iron-ore', count = 50}},
{price = {{"coin", math_random(4,8)}}, offer = {type = 'give-item', item = 'copper-ore', count = 50}},
{price = {{"coin", math_random(4,8)}}, offer = {type = 'give-item', item = 'stone', count = 50}},
@@ -109,7 +109,6 @@ local function treasure_chest(position)
table.insert(treasure_chest_loot_weights, {{name = 'light-armor', count = 1},1})
table.insert(treasure_chest_loot_weights, {{name = 'heavy-armor', count = 1},2})
table.insert(treasure_chest_loot_weights, {{name = 'pipe', count = math_random(10,100)},6})
table.insert(treasure_chest_loot_weights, {{name = 'steel-axe', count = 1},3})
table.insert(treasure_chest_loot_weights, {{name = 'explosives', count = math_random(40,50)},6})
table.insert(treasure_chest_loot_weights, {{name = 'shotgun', count = 1},3})
table.insert(treasure_chest_loot_weights, {{name = 'shotgun-shell', count = math_random(8,16)},3})
@@ -324,12 +323,8 @@ local function on_player_joined_game(event)
["iron-ore"] = {frequency = "none", size = "none", richness = "none"},
["crude-oil"] = {frequency = "very-high", size = "big", richness = "normal"},
["trees"] = {frequency = "none", size = "none", richness = "none"},
["enemy-base"] = {frequency = "high", size = "big", richness = "good"},
--["grass"] = {frequency = "none", size = "none", richness = "none"},
["sand"] = {frequency = "none", size = "none", richness = "none"},
["desert"] = {frequency = "none", size = "none", richness = "none"},
["dirt"] = {frequency = "none", size = "none", richness = "none"}
}
["enemy-base"] = {frequency = "high", size = "big", richness = "good"}
}
game.map_settings.pollution.pollution_restored_per_tree_damage = 0
game.create_surface("deep_jungle", map_gen_settings)
game.forces["player"].set_spawn_position({0,0},game.surfaces["deep_jungle"])
@@ -343,8 +338,7 @@ local function on_player_joined_game(event)
player.teleport({0,0}, "deep_jungle")
end
end
if player.online_time < 2 then
player.insert {name = 'iron-axe', count = 1}
if player.online_time < 2 then
player.insert {name = 'iron-plate', count = 32}
end
end
+1 -1
View File
@@ -21,7 +21,7 @@ local function create_map_intro(player)
local tt = t.add {type = "table", column_count = 3}
local l = tt.add {type = "label", caption = main_caption}
l.style.font = "default-frame"
l.style.font = "default-game"
l.style.font_color = {r=35, g=130, b=60}
l.style.top_padding = 6
l.style.bottom_padding = 6
+21 -68
View File
@@ -415,6 +415,18 @@ local function grow_cell(chunk_position, surface)
end
surface.set_tiles(tiles, true)
local decorative_names = {}
for k,v in pairs(game.decorative_prototypes) do
if v.autoplace_specification then
decorative_names[#decorative_names+1] = k
end
end
for _, surface in pairs(game.surfaces) do
for chunk in surface.get_chunks() do
surface.regenerate_decorative(decorative_names, {chunk_position})
end
end
if unique_room == "railway_roundabout" then
local e = surface.create_entity {name="big-ship-wreck-1", position={left_top_x + 16, left_top_y + 22}, force = "player"}
e.insert({name = 'locomotive', count = 1})
@@ -502,8 +514,7 @@ end
local function treasure_chest(position, surface)
local math_random = math.random
local chest_raffle = {}
local chest_loot = {
{{name = "steel-axe", count = math_random(1,3)}, weight = 2, evolution_min = 0.0, evolution_max = 0.2},
local chest_loot = {
{{name = "submachine-gun", count = math_random(1,3)}, weight = 3, evolution_min = 0.0, evolution_max = 0.1},
{{name = "slowdown-capsule", count = math_random(16,32)}, weight = 1, evolution_min = 0.0, evolution_max = 1},
{{name = "poison-capsule", count = math_random(16,32)}, weight = 3, evolution_min = 0.3, evolution_max = 1},
@@ -811,22 +822,12 @@ local function on_chunk_generated(event)
local chunk_position_y = event.area.left_top.y / 32
if not global.spawn_ores_generated then
if event.area.left_top.x > 96 then
map_functions.draw_entity_circle({x = 16, y = 16}, "coal", surface, 7, false, 750)
map_functions.draw_entity_circle({x = 16, y = 16}, "iron-ore", surface, 7, false, 750)
map_functions.draw_entity_circle({x = 16, y = 16}, "copper-ore", surface, 7, false, 750)
--map_functions.draw_entity_circle({x = 16, y = 16}, "tree-05", surface, 7, true)
--map_functions.draw_smoothed_out_ore_circle({x = 16, y = 8}, "coal", surface, 7, 750)
--map_functions.draw_smoothed_out_ore_circle({x = 16, y = 8}, "coal", surface, 7, 750)
--map_functions.draw_smoothed_out_ore_circle({x = 8, y = 24}, "iron-ore", surface, 7, 750)
--map_functions.draw_smoothed_out_ore_circle({x = 24, y = 24}, "copper-ore", surface, 7, 750)
--surface.create_entity({name = "tree-05", position = {16, 24}})
--surface.create_entity({name = "tree-05", position = {24, 12}})
--surface.create_entity({name = "tree-05", position = {8, 12}})
global.spawn_ores_generated = true
end
end
--if not global.spawn_ores_generated then
-- if event.area.left_top.x > 96 then
-- map_functions.draw_rainbow_patch({x = 16, y = 16}, surface, 9, 1000)
-- global.spawn_ores_generated = true
-- end
--end
for x = 0, 31, 1 do
for y = 0, 31, 1 do
@@ -899,11 +900,7 @@ local function on_player_joined_game(event)
["iron-ore"] = {frequency = "none", size = "none", richness = "none"},
["crude-oil"] = {frequency = "none", size = "none", richness = "none"},
["trees"] = {frequency = "none", size = "none", richness = "none"},
["enemy-base"] = {frequency = "none", size = "none", richness = "none"},
["grass"] = {frequency = "none", size = "none", richness = "none"},
["sand"] = {frequency = "none", size = "none", richness = "none"},
["desert"] = {frequency = "none", size = "none", richness = "none"},
["dirt"] = {frequency = "none", size = "none", richness = "none"}
["enemy-base"] = {frequency = "none", size = "none", richness = "none"}
}
game.map_settings.pollution.pollution_restored_per_tree_damage = 0
game.create_surface("labyrinth", map_gen_settings)
@@ -940,8 +937,7 @@ local function on_player_joined_game(event)
end
end
if player.online_time < 10 then
player.insert {name = 'raw-fish', count = 3}
player.insert {name = 'iron-axe', count = 1}
player.insert {name = 'raw-fish', count = 3}
player.insert {name = 'pistol', count = 1}
player.insert {name = 'firearm-magazine', count = 32}
end
@@ -1096,49 +1092,6 @@ local function on_tick(event)
end
end
function dump_layout()
local surface = game.surfaces["labyrinth"]
game.write_file("layout.lua", "" , false)
local area = {
left_top = {x = 0, y = 0},
right_bottom = {x = 32, y = 32}
}
local entities = surface.find_entities_filtered{area = area}
local tiles = surface.find_tiles_filtered{area = area}
for _, e in pairs(entities) do
local str = "{position = {x = " .. e.position.x
str = str .. ", y = "
str = str .. e.position.y
str = str .. '}, name = "'
str = str .. e.name
str = str .. '", direction = '
str = str .. tostring(e.direction)
str = str .. ', force = "'
str = str .. e.force.name
str = str .. '"},'
if e.name ~= "player" then
game.write_file("layout.lua", str .. '\n' , true)
end
end
game.write_file("layout.lua",'\n' , true)
game.write_file("layout.lua",'\n' , true)
game.write_file("layout.lua",'Tiles: \n' , true)
for _, t in pairs(tiles) do
local str = "{position = {x = " .. t.position.x
str = str .. ", y = "
str = str .. t.position.y
str = str .. '}, name = "'
str = str .. t.name
str = str .. '"},'
game.write_file("layout.lua", str .. '\n' , true)
end
end
event.add(defines.events.on_tick, on_tick)
event.add(defines.events.on_robot_built_entity, on_robot_built_entity)
event.add(defines.events.on_entity_damaged, on_entity_damaged)
+2 -7
View File
@@ -176,7 +176,7 @@ local function on_chunk_generated(event)
if surface.can_place_entity {name = "market", position = pos} then
local market = surface.create_entity {name = "market", position = pos}
market.destructible = false
market.add_market_item({price = {{"raw-wood", math.random(2,10)}}, offer = {type = 'give-item', item = 'raw-fish'}})
market.add_market_item({price = {{"wood", math.random(2,10)}}, offer = {type = 'give-item', item = 'raw-fish'}})
end
end
end
@@ -295,11 +295,7 @@ local function on_player_joined_game(event)
["iron-ore"] = {frequency = "none", size = "none", richness = "none"},
["crude-oil"] = {frequency = "none", size = "none", richness = "none"},
["trees"] = {frequency = "none", size = "none", richness = "none"},
["enemy-base"] = {frequency = "none", size = "none", richness = "none"},
["grass"] = {frequency = "none", size = "none", richness = "none"},
["sand"] = {frequency = "none", size = "none", richness = "none"},
["desert"] = {frequency = "none", size = "none", richness = "none"},
["dirt"] = {frequency = "normal", size = "normal", richness = "normal"}
["enemy-base"] = {frequency = "none", size = "none", richness = "none"}
}
game.map_settings.pollution.pollution_restored_per_tree_damage = 0
game.create_surface("lost_desert", map_gen_settings)
@@ -319,7 +315,6 @@ local function on_player_joined_game(event)
end
if player.online_time < 10 then
player.insert {name = 'raw-fish', count = 3}
player.insert {name = 'iron-axe', count = 1}
player.insert {name = 'light-armor', count = 1}
end
end
-1
View File
@@ -393,7 +393,6 @@ local function on_player_joined_game(event)
permission_group.set_allows_action(defines.input_action.gui_selection_state_changed, true)
permission_group.set_allows_action(defines.input_action.open_kills_gui, true)
permission_group.set_allows_action(defines.input_action.open_character_gui, true)
permission_group.set_allows_action(defines.input_action.open_equipment_gui, true)
permission_group.set_allows_action(defines.input_action.edit_permission_group, true)
permission_group.set_allows_action(defines.input_action.toggle_show_entity_info, true)
end
+3 -9
View File
@@ -46,8 +46,7 @@ end
local function spawn_shipwreck(surface, position)
local raffle = {}
local loot = {
{{name = "steel-axe", count = math_random(1,3)}, weight = 2, evolution_min = 0.0, evolution_max = 0.2},
local loot = {
{{name = "submachine-gun", count = math_random(1,3)}, weight = 3, evolution_min = 0.0, evolution_max = 0.1},
{{name = "slowdown-capsule", count = math_random(16,32)}, weight = 1, evolution_min = 0.0, evolution_max = 1},
{{name = "poison-capsule", count = math_random(16,32)}, weight = 3, evolution_min = 0.3, evolution_max = 1},
@@ -565,11 +564,7 @@ local function on_player_joined_game(event)
["iron-ore"] = {frequency = "high", size = "very-big", richness = "normal"},
["crude-oil"] = {frequency = "very-high", size = "very-big", richness = "normal"},
["trees"] = {frequency = "normal", size = "normal", richness = "normal"},
["enemy-base"] = {frequency = "very-high", size = "big", richness = "very-good"},
--["grass"] = {frequency = "normal", size = "normal", richness = "normal"},
--["sand"] = {frequency = "normal", size = "normal", richness = "normal"},
--["desert"] = {frequency = "normal", size = "normal", richness = "normal"},
--["dirt"] = {frequency = "normal", size = "normal", richness = "normal"}
["enemy-base"] = {frequency = "very-high", size = "big", richness = "very-good"}
}
game.create_surface("nightfall", map_gen_settings)
local surface = game.surfaces["nightfall"]
@@ -596,8 +591,7 @@ local function on_player_joined_game(event)
end
if player.online_time < 1 then
player.insert({name = "pistol", count = 1})
player.insert({name = "iron-axe", count = 1})
player.insert({name = "pistol", count = 1})
player.insert({name = "raw-fish", count = 3})
player.insert({name = "firearm-magazine", count = 32})
player.insert({name = "iron-plate", count = 64})
-37
View File
@@ -1,37 +0,0 @@
require "maps.modules.satellite_score"
require "maps.modules.dynamic_landfill"
require "maps.modules.splice"
require "maps.modules.spawners_contain_biters"
local event = require 'utils.event'
local function init()
if global.railworld_init_done then return end
game.map_settings.enemy_expansion.enabled = false
global.railworld_init_done = true
end
local function on_player_joined_game(event)
init()
local player = game.players[event.player_index]
if not global.player_equipped then global.player_equipped = {} end
if not global.player_equipped[player.name] then
player.insert({name = "raw-fish", count = 3})
player.insert({name = "iron-axe", count = 1})
player.insert({name = "iron-plate", count = 64})
player.insert({name = "iron-gear-wheel", count = 32})
player.insert({name = "shotgun", count = 1})
player.insert({name = "shotgun-shell", count = 16})
player.insert({name = "light-armor", count = 1})
global.player_equipped[player.name] = true
local radius = 320
game.forces.player.chart(game.surfaces[1], {{x = -1 * radius, y = -1 * radius}, {x = radius, y = radius}})
end
end
event.add(defines.events.on_player_joined_game, on_player_joined_game)
+1 -4
View File
@@ -40,10 +40,7 @@ local function on_player_joined_game(event)
if player.online_time < 5 then
player.teleport({0,0}, "spaghettorio")
end
end
if player.online_time < 10 then
player.insert {name = 'iron-axe', count = 1}
end
end
disable_recipes()
end
+7 -13
View File
@@ -10,7 +10,6 @@ require "maps.modules.explosive_biters"
require "maps.modules.dynamic_landfill"
require "maps.modules.teleporting_worms"
require "maps.modules.splice_double"
require "maps.modules.spitters_spit_biters"
require "maps.modules.biters_double_hp"
require "maps.modules.biters_double_damage"
require "maps.modules.spawners_contain_biters"
@@ -113,7 +112,7 @@ local function secret_shop(pos, surface)
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'train-stop'}},
{price = {{"raw-fish", 1}}, offer = {type = 'give-item', item = 'small-lamp'}},
{price = {{"raw-fish", 2}}, offer = {type = 'give-item', item = 'firearm-magazine'}},
{price = {{"raw-fish", 1}}, offer = {type = 'give-item', item = 'raw-wood', count = math_random(25,75)}},
{price = {{"raw-fish", 1}}, offer = {type = 'give-item', item = 'wood', count = math_random(25,75)}},
{price = {{"raw-fish", 1}}, offer = {type = 'give-item', item = 'iron-ore', count = math_random(25,75)}},
{price = {{"raw-fish", 1}}, offer = {type = 'give-item', item = 'copper-ore', count = math_random(25,75)}},
{price = {{"raw-fish", 1}}, offer = {type = 'give-item', item = 'stone', count = math_random(25,75)}},
@@ -431,11 +430,7 @@ local function on_player_joined_game(event)
["iron-ore"] = {frequency = "none", size = "none", richness = "none"},
["crude-oil"] = {frequency = "none", size = "none", richness = "none"},
["trees"] = {frequency = "none", size = "none", richness = "none"},
["enemy-base"] = {frequency = "none", size = "none", richness = "none"},
["grass"] = {frequency = "none", size = "none", richness = "none"},
["sand"] = {frequency = "none", size = "none", richness = "none"},
["desert"] = {frequency = "none", size = "none", richness = "none"},
["dirt"] = {frequency = "none", size = "none", richness = "none"}
["enemy-base"] = {frequency = "none", size = "none", richness = "none"}
}
game.create_surface("spooky_forest", map_gen_settings)
local surface = game.surfaces["spooky_forest"]
@@ -461,8 +456,7 @@ local function on_player_joined_game(event)
end
if player.online_time < 1 then
player.insert({name = "submachine-gun", count = 1})
player.insert({name = "iron-axe", count = 1})
player.insert({name = "submachine-gun", count = 1})
player.insert({name = "iron-plate", count = 64})
player.insert({name = "grenade", count = 3})
player.insert({name = "raw-fish", count = 5})
@@ -503,9 +497,9 @@ local function generate_spawn_area(position_left_top)
local pos = {x = position_left_top.x + x, y = position_left_top.y + y}
if pos.x > -9 and pos.x < 9 and pos.y > -9 and pos.y < 9 then
tile_to_insert = get_noise_tile(pos)
if math_random(1, 4) == 1 then
--if math_random(1, 4) == 1 then
tile_to_insert = "stone-path"
end
--end
if pos.x <= -7 or pos.x >= 7 or pos.y <= -7 or pos.y >= 7 then
if math_random(1, 3) ~= 1 then
table.insert(entities, {name = "stone-wall", position = {x = pos.x, y = pos.y}, force = "player"})
@@ -534,14 +528,14 @@ local function on_chunk_generated(event)
local position_left_top = event.area.left_top
generate_spawn_area(position_left_top)
local tiles = {}
for x = 0, 31, 1 do
for y = 0, 31, 1 do
local tile_to_insert = "out-of-map"
local pos = {x = position_left_top.x + x, y = position_left_top.y + y}
local tile_name = surface.get_tile(pos).name
if tile_name == "deepwater" or tile_name == "water" then
if tile_name ~= "stone-path" then
insert(tiles, {name = tile_to_insert, position = pos})
end
end
+5 -10
View File
@@ -80,14 +80,14 @@ local function secret_shop(pos, surface)
{price = {{"coin", math_random(80,160)}}, offer = {type = 'give-item', item = 'productivity-module'}},
{price = {{"coin", math_random(80,160)}}, offer = {type = 'give-item', item = 'speed-module'}},
{price = {{"coin", math_random(5,10)}}, offer = {type = 'give-item', item = 'raw-wood', count = 50}},
{price = {{"coin", math_random(5,10)}}, offer = {type = 'give-item', item = 'wood', count = 50}},
{price = {{"coin", math_random(5,10)}}, offer = {type = 'give-item', item = 'iron-ore', count = 50}},
{price = {{"coin", math_random(5,10)}}, offer = {type = 'give-item', item = 'copper-ore', count = 50}},
{price = {{"coin", math_random(5,10)}}, offer = {type = 'give-item', item = 'stone', count = 50}},
{price = {{"coin", math_random(5,10)}}, offer = {type = 'give-item', item = 'coal', count = 50}},
{price = {{"coin", math_random(8,16)}}, offer = {type = 'give-item', item = 'uranium-ore', count = 50}},
{price = {{'raw-wood', math_random(10,12)}}, offer = {type = 'give-item', item = "coin"}},
{price = {{'wood', math_random(10,12)}}, offer = {type = 'give-item', item = "coin"}},
{price = {{'iron-ore', math_random(10,12)}}, offer = {type = 'give-item', item = "coin"}},
{price = {{'copper-ore', math_random(10,12)}}, offer = {type = 'give-item', item = "coin"}},
{price = {{'stone', math_random(10,12)}}, offer = {type = 'give-item', item = "coin"}},
@@ -119,11 +119,7 @@ local function on_player_joined_game(event)
["uranium-ore"] = {frequency = "none", size = "none", richness = "none"},
["crude-oil"] = {frequency = "none", size = "none", richness = "none"},
["trees"] = {frequency = "normal", size = "normal", richness = "normal"},
["enemy-base"] = {frequency = "none", size = "none", richness = "none"},
["grass"] = {frequency = "none", size = "none", richness = "none"},
["sand"] = {frequency = "none", size = "none", richness = "none"},
["desert"] = {frequency = "none", size = "none", richness = "none"},
["dirt"] = {frequency = "normal", size = "normal", richness = "normal"}
["enemy-base"] = {frequency = "none", size = "none", richness = "none"}
}
game.create_surface("stoneblock", map_gen_settings)
local surface = game.surfaces["stoneblock"]
@@ -152,10 +148,9 @@ local function on_player_joined_game(event)
end
if player.online_time < 1 then
player.insert({name = "pistol", count = 1})
player.insert({name = "iron-axe", count = 1})
player.insert({name = "pistol", count = 1})
player.insert({name = "raw-fish", count = 3})
player.insert({name = "raw-wood", count = 16})
player.insert({name = "wood", count = 16})
player.insert({name = "firearm-magazine", count = 16})
player.insert({name = "iron-plate", count = 32})
if global.show_floating_killscore then global.show_floating_killscore[player.name] = false end
+4 -2
View File
@@ -395,8 +395,10 @@ local function render_arena_chunk(event)
local left_top = event.area.left_top
for _, entity in pairs(surface.find_entities_filtered({area = event.area})) do
if entity.name ~= "player" then
entity.destroy()
if entity.valid then
if entity.name ~= "player" then
entity.destroy()
end
end
end
-5
View File
@@ -206,10 +206,6 @@ local function on_player_main_inventory_changed(event)
check_inventory_for_key_item(event.player_index)
end
local function on_player_quickbar_inventory_changed(event)
check_inventory_for_key_item(event.player_index)
end
local function on_player_dropped_item(event)
check_inventory_for_key_item(event.player_index)
end
@@ -245,5 +241,4 @@ end
event.add(defines.events.on_player_changed_position, on_player_changed_position)
event.add(defines.events.on_player_dropped_item, on_player_dropped_item)
event.add(defines.events.on_player_main_inventory_changed, on_player_main_inventory_changed)
event.add(defines.events.on_player_quickbar_inventory_changed, on_player_quickbar_inventory_changed)
event.add(defines.events.on_gui_click, on_gui_click)