Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitorSide = "right"
- diskdriveSide = "top"
- musicdiscTitlePos = {1, 11}
- statementPos = {1,6}
- monitor = peripheral.wrap(monitorSide)
- --term.redirect(monitor)
- term.setCursorPos(3,6)
- term.write(" This statement is false.")
- term.setCursorPos(statementPos[1], statementPos[2]) -- set to statement text line
- ----
- audioList = {
- -- ["Audio Title"] = 42, -- length in seconds
- ["portalgun:stillalive"] = (176),
- ["portalgun:wantyougone"] = 142,
- ["portalgun:radioloop"] = 22,
- }
- while true do
- if disk.hasAudio( diskdriveSide ) then
- local audio = disk.getAudioTitle( diskdriveSide )
- local audioLength = 600
- if audio then
- if audioList[ audio ] then
- audioLength = audioList[ audio ]
- end
- term.setCursorPos(musicdiscTitlePos[1], musicdiscTitlePos[2])
- term.write( disk.getAudioTitle( diskdriveSide ) )
- term.setCursorPos(statementPos[1], statementPos[2]) -- set pos to This statement is false
- disk.playAudio( diskdriveSide )
- sleep(audioLength)
- disk.stopAudio( diskdriveSide )
- term.setCursorPos(musicdiscTitlePos[1], musicdiscTitlePos[2])
- term.write( "PortalRadio is off." )
- term.setCursorPos(statementPos[1], statementPos[2]) -- set pos to This statement is false
- sleep(2)
- else
- term.setCursorPos(musicdiscTitlePos[1], musicdiscTitlePos[2])
- term.write( "PortalRadio: Insert music disc" )
- term.setCursorPos(statementPos[1], statementPos[2]) -- set pos to This statement is false
- sleep(10)
- end
- else
- term.setCursorPos(musicdiscTitlePos[1], musicdiscTitlePos[2])
- term.write( "PortalRadio: Insert music disc" )
- term.setCursorPos(statementPos[1], statementPos[2]) -- set pos to This statement is false
- sleep(10)
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement