Advertisement
bryceio

JarvOS Music Turtle

Oct 20th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. --Turtle inventory should be as follows:
  2. --13, cat, blocks, chirp, far, mall, mellohi, stal, strad, ward, 11, wait  
  3. rednet.open("right")
  4. turtle.suck()
  5. turtle.select(1)
  6.  
  7. while true do
  8.     event, sender, message, protocol = os.pullEvent("rednet_message")
  9.     print("Message")
  10.     if event == "rednet_message" and protocol == "JarvOS Music" then
  11.         print("Playing "..message)
  12.         turtle.suck()
  13.         turtle.select(message*1)
  14.         turtle.drop()
  15.         disk.playAudio("front")
  16.     elseif protocol == "JarvOS Music Stop" then
  17.         turtle.suck()
  18.     end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement