Advertisement
Paragorn

Advent 12

Dec 12th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. Monitor = peripheral.wrap("top")
  2. Monitor.setTextScale(3)
  3. function Zeit()
  4.  Zeit_1 = 0 + 0
  5.  Zeit_2 = 2 + 0
  6.  Zeit_3 = 0 + 0
  7.  while true do
  8.   sleep(0.1)
  9.   if Zeit_3 <= 90 then
  10.    Zeit_3 = Zeit_3 + 10
  11.   end
  12.   if Zeit_3 == 100 then
  13.    Zeit_2 = Zeit_2 + 1
  14.    Zeit_3 = 0
  15.   end
  16.   if Zeit_2 == 60 then
  17.    Zeit_1 = Zeit_1 + 1
  18.    Zeit_2 = 0
  19.   end
  20.  
  21. -- Zeit Schreiben --
  22.   Monitor.clear()
  23.   Monitor.setCursorPos(1,1)
  24.   --Minuten
  25.   if Zeit_1 < 10 then
  26.    Monitor.write(" 0"..Zeit_1..":")
  27.   else
  28.    Monitor.write(" "..Zeit_1..":")
  29.   end
  30.   --Sekunden
  31.   Monitor.setCursorPos(5,1)
  32.   if Zeit_2 < 10 then
  33.    Monitor.write("0"..Zeit_2..":")
  34.   else
  35.    Monitor.write(Zeit_2..":")
  36.   end
  37.   --Millisekunden
  38.   Monitor.setCursorPos(8,1)
  39.   if Zeit_3 == 0 then
  40.    Monitor.write("00")
  41.   else
  42.    Monitor.write(Zeit_3.." ")
  43.   end
  44.   --Sondertext
  45.   Monitor.setCursorPos(1,2)
  46.   Monitor.write("+--------+")
  47.   -- Timer Maximum
  48.   if Zeit_1 == 100 then
  49.    Monitor.setCursorPos(1,1)
  50.    Monitor.write("PANDA  ^_^")
  51.    break
  52.   end
  53.   -- Redstone Abfrage 2
  54.   if redstone.getInput("bottom") then
  55.    break
  56.  elseif redstone.getInput("left") then
  57.    break
  58.  elseif redstone.getInput("right") then
  59.    break
  60.  elseif redstone.getInput("back") then
  61.    break
  62.  elseif redstone.getInput("front") then
  63.    break
  64.  end
  65.  end
  66. end
  67.  
  68.  
  69. -- Redstone Abfrage --
  70. while true do
  71.  if redstone.getInput("bottom") then
  72.   sleep(2)
  73.   Zeit()
  74.   break
  75.  elseif redstone.getInput("left") then
  76.   sleep(2)
  77.   Zeit()
  78.   break
  79.  elseif redstone.getInput("right") then
  80.   sleep(2)
  81.   Zeit()
  82.   break
  83.  elseif redstone.getInput("back") then
  84.   sleep(2)
  85.   Zeit()
  86.   break
  87.  elseif redstone.getInput("front") then
  88.   sleep(2)
  89.   Zeit()
  90.   break
  91.  end
  92.  sleep(0.5)
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement