Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. local modem = peripheral.find("modem")
  2.  
  3. local songs =
  4. {
  5. "https://images.cloudninja.pw/TiRA.dfpwm",
  6. "https://images.cloudninja.pw/Ip1X.dfpwm",
  7. "https://images.cloudninja.pw/fqP4.dfpwm",
  8. "https://images.cloudninja.pw/Quyb.dfpwm",
  9. "https://images.cloudninja.pw/gg8H.dfpwm",
  10. "https://images.cloudninja.pw/GiYw.dfpwm",
  11. "https://images.cloudninja.pw/bBdu.dfpwm",
  12. "https://images.cloudninja.pw/YeS6.dfpwm"
  13. }
  14.  
  15. local control = {1200,1500,1800}
  16.  
  17. for k,v in pairs(control) do
  18. modem.open(v)
  19. end
  20.  
  21. local function getSong()
  22. local int = math.random(1,#songs)
  23. print("Song #: "..int)
  24. return songs[int]
  25. end
  26.  
  27. local SNG = getSong()
  28. while true do
  29. local evnt, side, sChan, rChan, data, dist = os.pullEvent("modem_message")
  30. if rChan == control[3] and data == "ready" then
  31. modem.transmit(control[1],control[1],SNG)
  32. end
  33. SNG = getSong()
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement