Advertisement
Guest User

startup.lua

a guest
Jun 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.07 KB | None | 0 0
  1. modem = peripheral.find("modem")
  2. modem.open(1442)
  3. modem.open(1993)
  4. local inbetween = "https://www.dropbox.com/s/i96biowdqdntbkg/You%20are%20listening%20to.dfpwm?dl=1"
  5. local music =
  6. {
  7. "https://www.dropbox.com/s/kvs3png3z9ddmrv/Rick%20Springfield%20-%20Jessies%20Girl.dfpwm?dl=1",
  8. "https://www.dropbox.com/s/xfr3px40jefavgf/House%20of%20the%20rising%20sun.dfpwma?dl=1",
  9. "https://www.dropbox.com/s/d2m3mfmdkazopex/Creedence%20Clearwater%20Revival%20-%20Fortunate%20Son%20%28Lyric%20Video%29.dfpwm?dl=1",
  10. "https://www.dropbox.com/s/0u7ppmfr0c11417/Asia%20-%20Heat%20of%20the%20Moment.dfpwm?dl=1",
  11. "https://www.dropbox.com/s/h4z9h3vs748klhu/John%20Lennon%20-%20Imagine.dfpwm?dl=1",
  12. "https://www.dropbox.com/s/y2lcdw45fonzqbr/Queen%20-%20Dont%20Stop%20Me%20Now%20%28Official%20Video%29.dfpwm?dl=1",
  13. "https://www.dropbox.com/s/cvtmqklsdhbt7pq/Things%20We%20Lost%20In%20The%20Fire%20by%20Bastille%20Audio.dfpwm?dl=1",
  14. "https://www.dropbox.com/s/f03cpl0iwtdcn4h/SIAMS%20-%20The%20Wolf%20Official%20Video.dfpwm?dl=1",
  15. "https://www.dropbox.com/s/eww6tddw0b1dbr7/Kodaline%20-%20Ready%20%28Lyrics%29.dfpwm?dl=1",
  16. }
  17. print(music[1])
  18. modem.transmit(1442, 1993, music[math.random(1,5)])
  19. function doit()
  20. sleep(0.1)
  21. print("hi")
  22. inbt = true
  23. end
  24.  
  25. function two()
  26. while true do
  27. input = read()
  28. rannum = tonumber(input)
  29. end
  30. end
  31.  
  32. function one()
  33. while true do
  34. event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  35. rannum = math.random(1,9)
  36. if senderChannel == 1993 and message == "done" then
  37. modem.transmit(1442, 1992, "stop")
  38. sleep(1)
  39. if rannum and inbt ~= true then
  40. print(rannum)
  41. modem.transmit(1442, 1993, music[rannum])
  42. inbt = true
  43. elseif inbt == true then
  44. modem.transmit(1442, 1993, inbetween)
  45. print("inbtwd")
  46. inbt = false
  47. end
  48. end
  49. end
  50. end
  51. parallel.waitForAny(one, two)
  52. --music1 == "Jessies Girl"
  53. --music2 house of the rising sun
  54. --music3 Fortunate son
  55. --music4 heat of the moment
  56. --music5 john lennon imagine
  57. --music6 queen dont stop me now
  58. --music7 bastille things we lost in the fire
  59. --music8 Siams the wolf
  60. --music9 Kodaline ready
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement