--- /dev/null
+-- simple-coal-feeder.lua
+-- take coal from inventory and keep deployers stocked
+--
+-- usage: simple-coal-feeder
+--
+-- configuration: simple-coal-feeder.config
+-- { coal_inventory = "inventory_address" -- where to take coal from
+-- , interval = 60 -- how often to refill
+-- , engines = -- table of named engines
+-- { ["engine_one"] = -- table of deployers
+-- { "deployer_address_1"
+-- , "deployer_address_2"
+-- [...]
+-- }
+-- , ["engine_two"] =
+-- { "deployer_adress_19"
+-- [...]
+-- }
+-- }
+-- }
+
+local config_path = "simple-coal-feeder.config"
+local config = nil
+
+local print_help = function()
+ print("> start engine_name\n starts engine_name")
+ print("> stop engine_name\n stopts engine_name")
+ print("> status [engine_name]\n prints status")
+ print("> exit\n exits program")
+ print("> help, ?\n prints help")
+end
+
+local start_engine = function(engine)
+end
+
+
+local parse_command = function(str)
+ local cmd, a = string.match(str, "^%s*(%w+)%s*(.*)")
+ local arg = string.gsub(a, "%s*$", "")
+ return string.lower(cmd), (arg ~= '' and arg)
+end
+
+local main = function()
+ local running = true
+ local case =
+ { ["test"] = function(a)
+ print("testing, one two, one two!")
+ print(a)
+ end
+
+ , ["exit"] = function()
+ print("exiting...")
+ running = false
+ end
+
+ , ["help"] = function()
+ print_help()
+ end
+
+ , ["?"] = function()
+ print_help()
+ end
+ }
+
+ while running do
+ local cmd, arg = parse_command(read())
+ for c,f in pairs(case) do
+ if cmd == c then v(arg); break end
+ end
+end
+
+if fs.exists(config_path) then
+ config = dofile("simple-coal-feeder.config")
+ main()
+else
+ print("No configuration!")
+end
+
+