Advertisement
Bendix

MC riddle - Einknopf

May 4th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. --EinKnopfBedienung
  2. white=1
  3. orange=2
  4. magenta=4
  5. lightblue=8
  6. yellow=16
  7. lime=32
  8. pink=64
  9. grey=128
  10. lightGrey=256
  11. cyan=512
  12. purple=1024
  13. blue=2048
  14. brown=4096
  15. green=8192
  16. red=16384
  17. black=32768
  18.  
  19. moni=peripheral.wrap("left")
  20. --moni.setTextScale(2)
  21.  
  22. function moniBlink()
  23.    for x=1,20 do
  24.       moni.setBackgroundColor(colors.red) moni.clear()
  25.       test()
  26.       sleep(.1)
  27.       moni.setBackgroundColor(colors.black) moni.clear()
  28.       test()
  29.       sleep(.1)
  30.    end
  31. end
  32. function test()
  33.    moni.setTextScale(2)
  34.    moni.setCursorPos(1,1)
  35.    moni.write("; ;")
  36.    moni.setCursorPos(1,2)
  37.    moni.write(" _ ")
  38. end
  39.  
  40.  
  41.  
  42. function moniTime()
  43.    moni.setTextScale(4)
  44.    for x=20,1, -1 do
  45.       if(x<10) then
  46.          moni.setCursorPos(2,1)
  47.          moni.write(math.floor(x))
  48.       else
  49.          moni.write(math.floor(x))
  50.       end
  51.       sleep(1)
  52.       moni.clear() moni.setCursorPos(1,1)
  53.    end
  54. end
  55.  
  56. while true do
  57.    moni.setBackgroundColor(colors.black)
  58.    moni.setTextScale(1)
  59.    moni.setCursorPos(1,1)
  60.    moni.write("Raum 1")
  61.    signalB = redstone.getBundledInput("bottom")
  62.    if (signalB==black) then
  63.       redstone.setOutput("top",true)
  64.       moniTime()
  65.    else
  66.       if(redstone.getBundledInput("bottom")~=0)then
  67.          moniBlink()
  68.       end
  69.       redstone.setOutput("top",false) sleep(.2)  
  70.    end
  71.    print(redstone.getBundledInput("bottom"))
  72.     sleep(.8)
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement