Missing the timer event??
authorOlav Bakke Svendsen <mail@olavbs.no>
Thu, 12 Oct 2023 04:31:02 +0000 (06:31 +0200)
committerOlav Bakke Svendsen <mail@olavbs.no>
Thu, 12 Oct 2023 04:31:02 +0000 (06:31 +0200)
steam/temporary-coal-feeder.lua

index af813c0ce0f83ba34c47fd8646651725594ae9ef..ca6176d4f1959bc2b384b730a2fe7275204cd3a1 100644 (file)
@@ -3,8 +3,8 @@
 local refill_when = function(amt) return amt < 2 end
 local refill_amt  = 2
 
-local main_monitor = peripheral.wrap("monitor_1")
-local treefarm_monitor = peripheral.wrap("monitor_0")
+local main_monitor = peripheral.wrap("monitor_3")
+-- local treefarm_monitor = peripheral.wrap("monitor_0")
 
 local coal_barrels = {}
 for _,n in pairs({ "0", "1" }) do
@@ -94,9 +94,11 @@ while true do
     treefarm_monitor.write(spinner())
   elseif e[1] == "timer" and e[2] == main_timer then
     main_timer = os.startTimer(60)
+    os.cancelTimer(spinner_timer)
     local stock = balance_coal()
     print_stats(main_monitor, stock)
     feed(stock)
+    spinner_timer = os.startTimer(0)
   elseif e[1] == "timer" and e[2] == spinner_timer then
     spinner_timer = os.startTimer(0.5)
     local s = spinner()