Skip to content

Instantly share code, notes, and snippets.

@Thynix
Created July 9, 2017 14:40
Show Gist options
  • Save Thynix/9d9036b36bc30a6bfcba2ccbdac21a4f to your computer and use it in GitHub Desktop.
Save Thynix/9d9036b36bc30a6bfcba2ccbdac21a4f to your computer and use it in GitHub Desktop.
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