Advertisement
Guest User

startup

a guest
Aug 14th, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. m = peripheral.wrap("top")
  2.  
  3. rednet.open("bottom")
  4.  
  5.  
  6. while true do
  7. id, msg, dist = rednet.receive()
  8. h = 0
  9. min = 1
  10. s = 23
  11.  if msg == "Button1" then
  12.   for i=1,(h*3600+min*60+s) do
  13.   m.setCursorPos(1,8)
  14.   m.setBackgroundColor(colors.orange)
  15.   m.setTextColor(colors.blue)
  16.   s=s-1
  17.     if h >=10 then
  18.     hstring = h
  19.     else
  20.     hstring = ("0" .. h)
  21.     end
  22.       if min >=10 then
  23.       mstring = h
  24.       else mstring = ("0" .. min)
  25.       end
  26.     if s >=10 then
  27.     sstring = s
  28.     else
  29.     sstring = ("0" .. s)
  30.     end
  31.      m.write("Engines running!: " .. hstring .. ":" .. mstring .. ":" .. sstring)
  32.      sleep(1)
  33.     if s == 0 and min > 0 then
  34.     min = min-1
  35.     s = 60
  36.       if min == 0 and h > 0 then
  37.       h = h-1
  38.       min = 59
  39.       end
  40.     end
  41.       if s == 0 then
  42.       m.setCursorPos(1,8)
  43.       m.setBackgroundColor(colors.black)
  44.       m.write("                                                                          ")
  45.       m.setCursorPos(1,8)
  46.       m.setBackgroundColor(colors.orange)
  47.       m.setTextColor(colors.blue)
  48.       m.write("Engines offline!")
  49.       end
  50.   end
  51.  end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement