What I am trying to do:
I am attempting to edit the Mining Drill Prototype to do the following :
1 - Become a container like a chest ( I have added the wooden chest prototype info from the entities.lua file for this)
2- To spawn coal,stone,iron ore, and copper ore inside of its inventory every 5 seconds. ( I have added a new function to busy-wait for 5 seconds and then insert the resources).
The problem I am having:
When I start Factorio, I am getting the error:

Below is the code I edited for the burner-miner-drill prototype( my code in red)
I am a novice coder at best, so any help is greatly appreciated!
{
type = "mining-drill","container",
name = "burner-mining-drill",
icon = "__base__/graphics/icons/burner-mining-drill.png",
flags = {"placeable-neutral", "player-creation"},
resource_categories = {"basic-solid"},
minable = {mining_time = 1, result = "burner-mining-drill"},
max_health = 100,
corpse = "medium-remnants",
collision_box = {{ -0.9, -0.9}, {0.9, 0.9}},
selection_box = {{ -1, -1}, {1, 1}},
mining_speed = 0.35,
inventory_size = 16,
auto_mine = 1
local clock = os.clock
function sleep(n) -- seconds to sleep for auto_mine
local t0 = clock()
while clock() - t0 <= n do end
end
while auto_mine=1 do
sleep(5)
chest.insert({name="stone", count="1"})
chest.insert({name="copper-ore", count="1"})
chest.insert({name="iron-ore", count="1"})
chest.insert({name="coal", count="1"})
end
-- Mine Spawns resources every 5 seconds.
open_sound = { filename = "__base__/sound/wooden-chest-open.wav" },
close_sound = { filename = "__base__/sound/wooden-chest-close.wav" },
picture =
{
filename = "__base__/graphics/entity/wooden-chest/wooden-chest.png",
priority = "extra-high",
width = 46,
height = 33,
shift = {0.3, 0}
},
energy_source =
{
type = "burner",
effectivity = 1,
fuel_inventory_size = 1,
emissions = 0.1 / 3,
smoke =
{
{
name = "smoke",
deviation = {0.1, 0.1},
frequency = 1
}
}
},
energy_usage = "300kW",
mining_power = 2.5,
animations =
{
north =
{
priority = "extra-high",
frame_width = 110,
frame_height = 76,
line_length = 4,
shift = {0.7, -0.1},
filename = "__base__/graphics/entity/burner-mining-drill/north.png",
frame_count = 32,
animation_speed = 0.5,
run_mode = "forward-then-backward",
},
east =
{
priority = "extra-high",
frame_width = 94,
frame_height = 74,
line_length = 4,
shift = {0.45, -0.1},
filename = "__base__/graphics/entity/burner-mining-drill/east.png",
frame_count = 32,
animation_speed = 0.5,
run_mode = "forward-then-backward",
},
south =
{
priority = "extra-high",
frame_width = 89,
frame_height = 88,
line_length = 4,
shift = {0.4, 0},
filename = "__base__/graphics/entity/burner-mining-drill/south.png",
frame_count = 32,
animation_speed = 0.5,
run_mode = "forward-then-backward",
},
west =
{
priority = "extra-high",
frame_width = 91,
frame_height = 78,
line_length = 4,
shift = {0.1, -0.05},
filename = "__base__/graphics/entity/burner-mining-drill/west.png",
frame_count = 32,
animation_speed = 0.5,
run_mode = "forward-then-backward",
}
},
--resource_searching_radius = 0.99,
--vector_to_place_result = {-0.5, -1.3}
}
Normal Code Block for easy viewing:
Code: Select all
{
type = "mining-drill","container",
name = "burner-mining-drill",
icon = "__base__/graphics/icons/burner-mining-drill.png",
flags = {"placeable-neutral", "player-creation"},
resource_categories = {"basic-solid"},
minable = {mining_time = 1, result = "burner-mining-drill"},
max_health = 100,
corpse = "medium-remnants",
collision_box = {{ -0.9, -0.9}, {0.9, 0.9}},
selection_box = {{ -1, -1}, {1, 1}},
mining_speed = 0.35,
inventory_size = 16,
auto_mine = 1
local clock = os.clock
function sleep(n) -- seconds to sleep for auto_mine
local t0 = clock()
while clock() - t0 <= n do end
end
while auto_mine=1 do
sleep(5)
chest.insert({name="stone", count="1"})
chest.insert({name="copper-ore", count="1"})
chest.insert({name="iron-ore", count="1"})
chest.insert({name="coal", count="1"})
end
-- Mine Spawns resources every 5 seconds.
open_sound = { filename = "__base__/sound/wooden-chest-open.wav" },
close_sound = { filename = "__base__/sound/wooden-chest-close.wav" },
picture =
{
filename = "__base__/graphics/entity/wooden-chest/wooden-chest.png",
priority = "extra-high",
width = 46,
height = 33,
shift = {0.3, 0}
},
energy_source =
{
type = "burner",
effectivity = 1,
fuel_inventory_size = 1,
emissions = 0.1 / 3,
smoke =
{
{
name = "smoke",
deviation = {0.1, 0.1},
frequency = 1
}
}
},
energy_usage = "300kW",
mining_power = 2.5,
animations =
{
north =
{
priority = "extra-high",
frame_width = 110,
frame_height = 76,
line_length = 4,
shift = {0.7, -0.1},
filename = "__base__/graphics/entity/burner-mining-drill/north.png",
frame_count = 32,
animation_speed = 0.5,
run_mode = "forward-then-backward",
},
east =
{
priority = "extra-high",
frame_width = 94,
frame_height = 74,
line_length = 4,
shift = {0.45, -0.1},
filename = "__base__/graphics/entity/burner-mining-drill/east.png",
frame_count = 32,
animation_speed = 0.5,
run_mode = "forward-then-backward",
},
south =
{
priority = "extra-high",
frame_width = 89,
frame_height = 88,
line_length = 4,
shift = {0.4, 0},
filename = "__base__/graphics/entity/burner-mining-drill/south.png",
frame_count = 32,
animation_speed = 0.5,
run_mode = "forward-then-backward",
},
west =
{
priority = "extra-high",
frame_width = 91,
frame_height = 78,
line_length = 4,
shift = {0.1, -0.05},
filename = "__base__/graphics/entity/burner-mining-drill/west.png",
frame_count = 32,
animation_speed = 0.5,
run_mode = "forward-then-backward",
}
},
--resource_searching_radius = 0.99,
--vector_to_place_result = {-0.5, -1.3}
}
}