Advertisement
VaMinion

sun_countdown

Oct 22nd, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. -- This program runs and tells you how far into the day/night cycle a given area is.
  2. -- This is set to 80 minutes by default, for use with Galacticraft, but it can be set for any area that has day/night.
  3. -- Just change the dayCycle variable to the number of RL minutes.
  4.  
  5. dayCycle = 80
  6. dayTime = 0
  7.  
  8. while true do
  9.   -- This counts the time during the day.
  10.   while redstone.getInput("left") do
  11.     term.clear()
  12.     print("Moon day: "..dayTime.." / "..dayCycle)
  13.     dayTime = dayTime + 1
  14.     os.sleep(60)
  15.   end
  16.  
  17.   -- Reset the time of day counter
  18.   dayTime = 0
  19.  
  20.  -- This counts the time during the night.
  21.   while not redstone.getInput("left") do
  22.     term.clear()
  23.     print("Moon night: "..dayTime.." / "..dayCycle)
  24.     dayTime = dayTime + 1
  25.     os.sleep(60)
  26.   end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement