Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CLEAN = true
- local TRACKS = 5
- local function viewBox(x,y,s,n)
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(x,y)
- term.setCursorPos(x,y)
- print(n..(string.rep("-",string.len(s)-string.len(n))))
- term.setCursorPos(x,(y+1))
- print(s)
- term.setCursorPos(x, (y+2))
- print(s)
- term.setCursorPos(x, (y+3))
- print(s)
- term.setCursorPos(x, (y+4))
- print(s)
- term.setCursorPos(x, (y+4))
- print(s)
- term.setCursorPos(x, (y+5))
- print(s)
- term.setCursorPos(x, (y+6))
- print(s)
- term.setCursorPos(x, (y+7))
- print(s)
- term.setCursorPos(x, (y+8))
- print(s)
- term.setCursorPos(x, (y+9))
- print(s)
- term.setCursorPos(x, (y+10))
- print(string.rep("-",string.len(s)))
- end
- viewBox(15,7," ","MUSIC")
- term.setCursorPos(27,8)
- print("SIDE? :")
- term.setCursorPos(35,8)
- local side = read()
- sleep(0.5)
- local function MAIN(TRACKS,CLEAN)
- S = os.time()
- T = track
- track = nil
- L = 0
- while true do
- if track == T then
- IGNOREME = false
- else
- T = track
- S = os.time()
- end
- if CLEAN then
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setBackgroundColor(colors.lightGray)
- end
- viewBox(15,7," ","MUSIC")
- term.setCursorPos(27,8)
- if track == nil then
- term.setTextColour(colors.red)
- print("NO TRACK LOADED")
- else
- term.setTextColour(colors.lime)
- print("Currently playing: "..track)
- end
- term.setCursorPos(27,9)
- print(os.date())
- term.setCursorPos(27,10)
- e, key = os.pullEvent()
- term.setCursorPos(27,12)
- print(" ")
- term.setCursorPos(16,12)
- print("The coder(s) of AiOs")
- term.setCursorPos(16,13)
- print("holds the copyright for")
- term.setCursorPos(16,14)
- print("some of the songs/tracks")
- term.setCursorPos(16,15)
- print("No copyright infringement intended")
- term.setCursorPos(26,10)
- if key == 32 then
- L = L + 1
- if L == TRACKS then
- L = 1
- end
- shell.run("speaker", "stop")
- sleep(1)
- term.setCursorPos(27,8)
- print(" ")
- term.setCursorPos(27,8)
- print("PAUSED")
- term.setCursorPos(27,9)
- print(" ")
- term.setCursorPos(27,9)
- --print("Track?: ")
- X = fs.list(".MUSIC/tracks")[tonumber(L)]
- term.setCursorPos(30,9)
- --X = read()
- term.setCursorPos(999,999)
- X = (".MUSIC/tracks/"..X)
- sleep(1)
- if CLEAN then
- term.clear()
- end
- shell.run("speaker", "play", X)
- if CLEAN then
- term.clear()
- term.setTextColour(colors.white)
- end
- track = X
- end
- end
- end
- MAIN(TRACKS,CLEAN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement