Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("top")
- term.redirect(monitor)
- term.clear()
- term.setTextColor(colors.pink)
- term.setCursorPos(1,1)
- term.write("Welcome to the Calming Storm ATM9 Server!")
- term.setTextColor(colors.yellow)
- term.setCursorPos(30,1)
- term.write("ATM9")
- term.setTextColor(colors.white)
- term.setCursorPos(1,2)
- term.write("Useful Commands / Info:")
- term.setCursorPos(1,4)
- term.write("Use /sethome and /home (limit of 6)")
- term.setCursorPos(1,6)
- term.write("Use /rtp to find a base location")
- term.setCursorPos(1,8)
- term.write("Usa /tpa to go to a friend")
- term.setCursorPos(1,10)
- term.write("Use /back to teleport to your death or go back to ")
- term.setCursorPos(1,11)
- term.write("your previous location after using /home, or /tpa")
- term.setCursorPos(1,13)
- term.write("Use /enderchest for a portable enderchest")
- term.setCursorPos(1,15)
- term.write("Setup a team and claim by using the buttons")
- term.setCursorPos(1,16)
- term.write("in the top left of your inventory")
- term.setCursorPos(1,18)
- term.setTextColor(colors.red)
- term.write("Good luck, you'll need it.")
- term.setCursorPos(1,19)
- term.setTextColor(colors.pink)
- term.write("(Sponsored by EnderReaper64)")
- local content = http.get("https://github.com/EnderReaper64/ComputercraftAudioPlayer/raw/main/Music/Take-Care.dfpwm", nil, true).readAll()
- if not content then
- error("Could not connect to website")
- end
- local chunks = {}
- local pointer = 1
- for i = 1, string.len(content), 16 * 1024 do
- table.insert(chunks, string.sub(content, pointer, i))
- pointer = i+1
- end
- local dfpwm = require("cc.audio.dfpwm")
- local speaker = peripheral.find("speaker")
- local decoder = dfpwm.make_decoder()
- while true do
- for num,chunk in pairs(chunks) do
- local buffer = decoder(chunk)
- while not speaker.playAudio(buffer) do
- os.pullEvent("speaker_audio_empty")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement