Advertisement
EnderReaper64

Calming Storm ATM9 Spawnboard

Nov 19th, 2022 (edited)
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. local monitor = peripheral.wrap("top")
  2. term.redirect(monitor)
  3. term.clear()
  4. term.setTextColor(colors.pink)
  5. term.setCursorPos(1,1)
  6. term.write("Welcome to the Calming Storm ATM9 Server!")
  7. term.setTextColor(colors.yellow)
  8. term.setCursorPos(30,1)
  9. term.write("ATM9")
  10. term.setTextColor(colors.white)
  11. term.setCursorPos(1,2)
  12. term.write("Useful Commands / Info:")
  13. term.setCursorPos(1,4)
  14. term.write("Use /sethome and /home (limit of 6)")
  15. term.setCursorPos(1,6)
  16. term.write("Use /rtp to find a base location")
  17. term.setCursorPos(1,8)
  18. term.write("Usa /tpa to go to a friend")
  19. term.setCursorPos(1,10)
  20. term.write("Use /back to teleport to your death or go back to ")
  21. term.setCursorPos(1,11)
  22. term.write("your previous location after using /home, or /tpa")
  23. term.setCursorPos(1,13)
  24. term.write("Use /enderchest for a portable enderchest")
  25. term.setCursorPos(1,15)
  26. term.write("Setup a team and claim by using the buttons")
  27. term.setCursorPos(1,16)
  28. term.write("in the top left of your inventory")
  29. term.setCursorPos(1,18)
  30. term.setTextColor(colors.red)
  31. term.write("Good luck, you'll need it.")
  32. term.setCursorPos(1,19)
  33. term.setTextColor(colors.pink)
  34. term.write("(Sponsored by EnderReaper64)")
  35.  
  36. local content = http.get("https://github.com/EnderReaper64/ComputercraftAudioPlayer/raw/main/Music/Take-Care.dfpwm", nil, true).readAll()
  37. if not content then
  38. error("Could not connect to website")
  39. end
  40.  
  41. local chunks = {}
  42. local pointer = 1
  43. for i = 1, string.len(content), 16 * 1024 do
  44. table.insert(chunks, string.sub(content, pointer, i))
  45. pointer = i+1
  46. end
  47.  
  48. local dfpwm = require("cc.audio.dfpwm")
  49. local speaker = peripheral.find("speaker")
  50.  
  51. local decoder = dfpwm.make_decoder()
  52. while true do
  53. for num,chunk in pairs(chunks) do
  54. local buffer = decoder(chunk)
  55.  
  56. while not speaker.playAudio(buffer) do
  57. os.pullEvent("speaker_audio_empty")
  58. end
  59. end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement