Advertisement
Guest User

test.lua

a guest
Apr 10th, 2020
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. --local monitorLast = os.clock()
  2.  
  3. local alarm = false
  4.  
  5. while true do
  6.  for _, name in pairs(peripheral.getNames()) do
  7.   local type = peripheral.getType(name)
  8.   --local curTime = os.clock()
  9.  
  10.   if type == "speaker" and alarm == true then
  11.    peripheral.wrap(name).playSound("minecraft:entity.player.levelup")
  12.   elseif type == "monitor" then
  13.    local monitor = peripheral.wrap(name)
  14.    monitor.setTextColor(colors.white)
  15.    monitor.setBackgroundColor(colors.black)
  16.    monitor.write("Testing")
  17.   end
  18.  end
  19.  sleep(0.25)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement