Advertisement
jburkhar21

DJ

May 22nd, 2024 (edited)
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. local speaker = peripheral.find("speaker")
  2. local m = peripheral.wrap("back")
  3.  
  4. term.redirect(m)
  5. m.setTextScale(.5)
  6. xSize,ySize = m.getSize()
  7. x=0
  8. y=0
  9.  
  10. local function playSound()
  11.     while true do
  12.      speaker.playNote("guitar",1,y/(ySize/24))
  13.      sleep((1/8/20))
  14.     end
  15. end
  16. local function getTone()
  17.     while true do
  18.      e,side,x,y = os.pullEvent("monitor_touch")
  19.     end
  20. end
  21.  
  22. parallel.waitForAny(playSound, getTone)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement