Skip to content

Instantly share code, notes, and snippets.

@Thynix Thynix/control.lua
Created Jul 9, 2017

Embed
What would you like to do?
Update to RailPowerSystem 0.1.3 for changes in Factorio 0.15.27
require "constants"
require "libs.dataLibs"
require "libs.railPowerLib"
require "libs.eventsHandler"
require "controls.rail"
require "controls.train"
local function AddFarl()
if remote.interfaces.farl then
remote.call("farl", "add_entity_to_trigger", straightRailPower)
remote.call("farl", "add_entity_to_trigger", curvedRailPower)
end
end
script.on_init(function(event)
AddFarl()
OnLoad()
end)
script.on_load(function (event)
AddFarl()
OnLoad()
end)
--build
script.on_event(defines.events.on_robot_built_entity, function(event)
OnBuildEntity(event.created_entity)
end)
script.on_event(defines.events.on_built_entity, function(event)
OnBuildEntity(event.created_entity)
end)
--premined
script.on_event(defines.events.on_robot_pre_mined, function(event)
OnPreRemoveEntity(event.entity)
end)
script.on_event(defines.events.on_preplayer_mined_item, function(event)
OnPreRemoveEntity(event.entity)
end)
--tick
script.on_event(defines.events.on_tick,function(event)
OnTick()
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.