Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local songList = "LajAJwja"
- local condense = "W3jHDPSX"
- local songPlayer = "695qWt0q"
- print("Downloading dependency...")
- shell.run("rm cond")
- shell.run("rm player")
- shell.run("pastebin get " .. condense .. " cond")
- shell.run("pastebin get " .. songPlayer .. " player")
- print("Updating list...")
- shell.run("pastebin get " .. songList .. " .songlist")
- print("Starting up...")
- size = {term.getSize()}
- nb = peripheral.find("Music") or peripheral.find("minecraft:noteblock")
- if not nb then
- if peripheral.find("neuralInterface") then
- if peripheral.find("neuralInterface").playNote then
- nb = peripheral.find("neuralInterface")
- end
- end
- end
- local function centerText(text,yOffset)
- yOffset = yOffset or 0
- local x,y = term.getSize() local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.round((x / 2) - (text:len() / 2)), y2+yOffset)
- write(text)
- end
- if ( not nb ) or ( not nb.playNote ) then
- term.setBackgroundColour(colours.lightGrey)
- term.setTextColour(colours.gray)
- centerText("Couldn't locate noteblock")
- centerText("Playing may not work!",1)
- sleep(4)
- end
- clr = {}
- for i,k in pairs(colours) do
- if type(k) == "number" and i ~= "black" then
- table.insert(clr,k)
- end
- end
- term.clear()
- songs = {}
- f = fs.open(".songlist","r")
- while true do
- line = f.readLine()
- if not line then break else table.insert(songs,line) end
- end
- while true do
- songname = songs[math.random(1,#songs)]
- print("Downloading " .. songname)
- shell.run("wget http://hackery.site/computercraft/lua-songs/" .. songname:gsub(" ","%%20") .. ".lua temp")
- shell.run("cond temp .temp")
- shell.run("rm temp")
- shell.run("player .temp \"" .. songname .. "\"")
- shell.run("rm .temp")
- term.clear()
- term.setCursorPos(1,1)
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement