Spinner symbols
authorOlav Bakke Svendsen <mail@olavbs.no>
Thu, 12 Oct 2023 05:37:37 +0000 (07:37 +0200)
committerOlav Bakke Svendsen <mail@olavbs.no>
Thu, 12 Oct 2023 05:37:37 +0000 (07:37 +0200)
steam/temporary-coal-feeder.lua

index 5b99379743f90213ffecf8a9d88b849457920a12..98a727edb8c0b8efddc20f72a335bfd52e009433 100644 (file)
@@ -85,11 +85,11 @@ local spin = function()
   table.insert(spinner_chars, 1, c)
   return c
 end
-local print_spinner = function(monitor, x, y, spinning)
+local print_spinner = function(monitor, x, y, char)
   local s = spin()
   main_monitor.setTextColor(1)
   main_monitor.setCursorPos(29,12)
-  main_monitor.write(spinning and s or "*")
+  main_monitor.write(char or s)
 end
 
 local main_timer = os.startTimer(0)
@@ -105,9 +105,10 @@ while true do
   elseif e[1] == "timer" and e[2] == main_timer then
     main_timer = os.startTimer(60)
     os.cancelTimer(spinner_timer)
-    print_spinner(main_monitor, 29,12, false)
+    print_spinner(main_monitor, 29,12, "?")
     local stock = balance_coal()
     print_stats(main_monitor, stock)
+    print_spinner(main_monitor, 29,12, "*")
     feed(stock)
     spinner_timer = os.startTimer(0)
   elseif e[1] == "timer" and e[2] == spinner_timer then