Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- --RAC Media Player by neonerZ v1.0
- --http://youtube.com/neonerz
- --
- -- What side of the computer is the monitor on?
- local monitorSide="back"
- -- What side of the computer is the disk drive on?
- local diskDriveSide = "front"
- -- What side of the computer is the redstone to
- -- eject the record?
- local ejectRedstoneSide = "left"
- -- What side of the computer is the bundled cable?
- local recordRedSide = "bottom"
- --Plays Record
- function playRecord(diskDriveSide,recordRedSide,discName)
- -- Check if there's already a disk in the drive
- -- if so, eject it
- if disk.isPresent(diskDriveSide) == true then
- eject(ejectRedstoneSide)
- end
- -- open music-colors config file
- h = fs.open("music-colors","r")
- line = tostring(h.readLine())
- action = nil
- -- Find the color interger of the disc selected
- while line ~= nil do
- value1,discColor = string.match(line,"(.+)%s?:%s?(.+)")
- if string.lower(value1) == string.lower(discName) then
- print("You want to play "..value1)
- print("It is on the "..discColor.." line")
- if string.lower(discColor) == "white" then theColor=1
- elseif string.lower(discColor) == "orange" then theColor=2
- elseif string.lower(discColor) == "magenta" then theColor=4
- elseif string.lower(discColor) == "lightblue" then theColor=8
- elseif string.lower(discColor) == "yellow" then theColor=16
- elseif string.lower(discColor) == "lime" then theColor=32
- elseif string.lower(discColor) == "pink" then theColor=64
- elseif string.lower(discColor) == "gray" then theColor=128
- elseif string.lower(discColor) == "lightgray" then theColor=256
- elseif string.lower(discColor) == "cyan" then theColor=512
- elseif string.lower(discColor) == "purple" then theColor=1024
- elseif string.lower(discColor) == "blue" then theColor=2048
- elseif string.lower(discColor) == "brown" then theColor=4096
- elseif string.lower(discColor) == "green" then theColor=8192
- elseif string.lower(discColor) == "red" then theColor=16384
- elseif string.lower(discColor) == "black" then theColor=32768
- else print("Error: color out of range") return
- end
- print("loading track")
- -- Pulse the color that's associated to the disc
- redstone.setBundledOutput(recordRedSide, theColor)
- sleep(1)
- redstone.setBundledOutput(recordRedSide, 0)
- -- Wait for the disc to load
- while not disk.isPresent(diskDriveSide) do
- sleep(.5)
- end
- print("track loaded, playing track")
- -- Play disc
- disk.playAudio(diskDriveSide)
- end
- line = h.readLine()
- end
- end
- -- Play without requesting disc
- function playButton(diskDriveSide)
- if disk.isPresent(diskDriveSide) ~= true then
- setAction(monitorSide," No disc loaded ")
- sleep(.5)
- else
- print("playing track")
- setAction(monitorSide," Playing disc... ")
- sleep(.5)
- disk.playAudio(diskDriveSide)
- end
- end
- -- Stop audio
- function stop(diskDriveSide)
- print("stopping track")
- disk.stopAudio(diskDriveSide)
- end
- -- Eject disc
- function eject(ejectRedstoneSide)
- print("ejecting track")
- redstone.setOutput(ejectRedstoneSide, true)
- sleep(1)
- redstone.setOutput(ejectRedstoneSide, false)
- end
- -- Display orange message box with message
- function setAction(pSide,message)
- m = peripheral.wrap(pSide)
- m.setCursorPos(14,6)
- m.setBackgroundColor(colors.orange)
- m.write(" ")
- m.setCursorPos(14,7)
- m.write(" ")
- m.setCursorPos(14,8)
- m.write(" ")
- m.setCursorPos(14,9)
- m.write(" ")
- m.setCursorPos(14,10)
- m.write(" ")
- m.setCursorPos(14,11)
- m.write(" ")
- m.setCursorPos(14,12)
- m.write(" ")
- m.setCursorPos(14,13)
- m.write(" ")
- m.setCursorPos(14,14)
- m.write(" ")
- m.setCursorPos(14,10)
- m.setTextColor(colors.black)
- m.write(message)
- m.setBackgroundColor(colors.black)
- end
- -- Display GUI
- function setGUI(pSide)
- m = peripheral.wrap(pSide)
- m.clear()
- m.setCursorPos(18,1)
- m.setBackgroundColor(colors.black)
- m.setTextColor(colors.blue)
- m.write("RAC Media Player")
- m.setCursorPos(3,3)
- -- This if checkes to see if the button it's drawing
- -- matches the disc in the disk drive (if any) and turns
- -- the button yellow if so.
- if disk.getLabel(diskDriveSide) =="C418 - cat" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(3,4)
- if disk.getLabel(diskDriveSide) =="C418 - cat" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Cat ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(3,5)
- if disk.getLabel(diskDriveSide) =="C418 - cat" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(15,3)
- if disk.getLabel(diskDriveSide) =="C418 - 13" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(15,4)
- if disk.getLabel(diskDriveSide) =="C418 - 13" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" 13 ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(15,5)
- if disk.getLabel(diskDriveSide) =="C418 - 13" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(27,3)
- if disk.getLabel(diskDriveSide) =="C418 - blocks" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(27,4)
- if disk.getLabel(diskDriveSide) =="C418 - blocks" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Blocks ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(27,5)
- if disk.getLabel(diskDriveSide) =="C418 - blocks" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(39,3)
- if disk.getLabel(diskDriveSide) =="C418 - chirp" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(39,4)
- if disk.getLabel(diskDriveSide) =="C418 - chirp" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Chirp ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(39,5)
- if disk.getLabel(diskDriveSide) =="C418 - chirp" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(3,7)
- if disk.getLabel(diskDriveSide) =="C418 - far" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(3,8)
- if disk.getLabel(diskDriveSide) =="C418 - far" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Far ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(3,9)
- if disk.getLabel(diskDriveSide) =="C418 - far" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(15,7)
- if disk.getLabel(diskDriveSide) =="C418 - mall" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(15,8)
- if disk.getLabel(diskDriveSide) =="C418 - mall" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Mall ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(15,9)
- if disk.getLabel(diskDriveSide) =="C418 - mall" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(27,7)
- if disk.getLabel(diskDriveSide) =="C418 - mellohi" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(27,8)
- if disk.getLabel(diskDriveSide) =="C418 - mellohi" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Mellohi ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(27,9)
- if disk.getLabel(diskDriveSide) =="C418 - mellohi" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(39,7)
- if disk.getLabel(diskDriveSide) =="C418 - stal" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(39,8)
- if disk.getLabel(diskDriveSide) =="C418 - stal" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Stal ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(39,9)
- if disk.getLabel(diskDriveSide) =="C418 - stal" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(3,11)
- if disk.getLabel(diskDriveSide) =="C418 - strad" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(3,12)
- if disk.getLabel(diskDriveSide) =="C418 - strad" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Strad ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(3,13)
- if disk.getLabel(diskDriveSide) =="C418 - strad" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(15,11)
- if disk.getLabel(diskDriveSide) =="C418 - ward" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(15,12)
- if disk.getLabel(diskDriveSide) =="C418 - ward" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Ward ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(15,13)
- if disk.getLabel(diskDriveSide) =="C418 - ward" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(27,11)
- if disk.getLabel(diskDriveSide) =="C418 - 11" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(27,12)
- if disk.getLabel(diskDriveSide) =="C418 - 11" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" 11 ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(27,13)
- if disk.getLabel(diskDriveSide) =="C418 - 11" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(39,11)
- if disk.getLabel(diskDriveSide) =="wait" or disk.getLabel(diskDriveSide) =="C418 - wait" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(39,12)
- if disk.getLabel(diskDriveSide) =="wait" or disk.getLabel(diskDriveSide) =="C418 - wait" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.setTextColor(colors.black)
- m.write(" Wait ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(39,13)
- if disk.getLabel(diskDriveSide) =="wait" or disk.getLabel(diskDriveSide) =="C418 - wait" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.green) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(2,15)
- if disk.getLabel(diskDriveSide) =="pg.stillalive" or disk.getLabel(diskDriveSide) =="Valve - Still Alive" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.cyan) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(2,16)
- if disk.getLabel(diskDriveSide) =="pg.stillalive" or disk.getLabel(diskDriveSide) =="Valve - Still Alive" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.cyan) end
- m.setTextColor(colors.black)
- m.write(" Still Alive ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(2,17)
- if disk.getLabel(diskDriveSide) =="pg.stillalive" or disk.getLabel(diskDriveSide) =="Valve - Still Alive" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.cyan) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(18,15)
- if disk.getLabel(diskDriveSide) =="pg.radioloop" or disk.getLabel(diskDriveSide) =="Valve - Radio Loop" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.cyan) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(18,16)
- if disk.getLabel(diskDriveSide) =="pg.radioloop" or disk.getLabel(diskDriveSide) =="Valve - Radio Loop" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.cyan) end
- m.setTextColor(colors.black)
- m.write(" Radio Loop ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(18,17)
- if disk.getLabel(diskDriveSide) =="pg.radioloop" or disk.getLabel(diskDriveSide) =="Valve - Radio Loop" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.cyan) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(35,15)
- if disk.getLabel(diskDriveSide) =="pg.wantyougone" or disk.getLabel(diskDriveSide) =="Valve - Want You Gone" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.cyan) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(35,16)
- if disk.getLabel(diskDriveSide) =="pg.wantyougone" or disk.getLabel(diskDriveSide) =="Valve - Want You Gone" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.cyan) end
- m.setTextColor(colors.black)
- m.write(" Want You Gone ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(35,17)
- if disk.getLabel(diskDriveSide) =="pg.wantyougone" or disk.getLabel(diskDriveSide) =="Valve - Want You Gone" then m.setBackgroundColor(colors.yellow) else m.setBackgroundColor(colors.cyan) end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(12,19)
- m.setBackgroundColor(colors.blue)
- m.setTextColor(colors.white)
- m.write(" Play ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(19,19)
- m.setBackgroundColor(colors.blue)
- m.setTextColor(colors.white)
- m.write(" Stop ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(26,19)
- m.setBackgroundColor(colors.blue)
- m.setTextColor(colors.white)
- m.write(" Eject ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(34,19)
- m.setBackgroundColor(colors.blue)
- m.setTextColor(colors.white)
- m.write(" Back ")
- m.setBackgroundColor(colors.black)
- end
- -- Check if music-colors config file is present.
- -- If not, create it.
- if fs.exists("music-colors") ~= true then
- h = fs.open("music-colors", "w")
- h.writeLine("cat:orange")
- h.writeLine("far:yellow")
- h.writeLine("mall:green")
- h.writeLine("chirp:blue")
- h.writeLine("blocks:red")
- h.writeLine("stal:lightgray")
- h.writeLine("13:lightblue")
- h.writeLine("mellohi:purple")
- h.writeLine("strad:white")
- h.writeLine("wait:magenta")
- h.writeLine("ward:lime")
- h.writeLine("11:pink")
- h.writeLine("still-alive:cyan")
- h.writeLine("radio-loop:black")
- h.writeLine("want-you-gone:brown")
- h.close()
- end
- -- Display GUI
- setGUI(monitorSide)
- -- Always wrap peripherals. Wrapping it
- -- to the m variable
- m = peripheral.wrap(monitorSide)
- -- Start while loop
- while true do
- -- Wait for monitor_touch event
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- --If Play button is pressed
- if (yPos == 19) and (xPos >= 12 and xPos <= 17) then
- -- setAction is the function we setup above that
- -- display's the orange message box
- setAction(monitorSide," Play! ")
- playButton(diskDriveSide)
- setGUI(monitorSide)
- --If Stop button is pressed
- elseif (yPos == 19) and (xPos >= 19 and xPos <= 24) then
- setAction(monitorSide," Stop! ")
- sleep(.5)
- stop(diskDriveSide)
- setGUI(monitorSide)
- --If Eject button is pressed
- elseif (yPos == 19) and (xPos >= 26 and xPos <= 32) then
- setAction(monitorSide," Eject! ")
- print("ejecting track")
- eject(ejectRedstoneSide)
- setGUI(monitorSide)
- --If Back button is pressed
- elseif (yPos == 19) and (xPos >= 34 and xPos <= 40) then
- setAction(monitorSide," Goodbye! ")
- sleep(2)
- m.clear()
- return
- --Cat
- elseif (yPos >= 3 and yPos <=6 ) and (xPos >= 2 and xPos <= 12) then
- setAction(monitorSide," Loading Cat... ")
- if disk.getLabel(diskDriveSide) =="C418 - cat" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"cat")
- end
- setGUI(monitorSide)
- --13
- elseif (yPos >= 3 and yPos <=6 ) and (xPos >= 14 and xPos <= 24) then
- setAction(monitorSide," Loading 13... ")
- if disk.getLabel(diskDriveSide) =="C418 - 13" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"13")
- end
- setGUI(monitorSide)
- --Blocks
- elseif (yPos >= 3 and yPos <=6 ) and (xPos >= 26 and xPos <= 36) then
- setAction(monitorSide," Loading Blocks... ")
- if disk.getLabel(diskDriveSide) =="C418 - blocks" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"blocks")
- end
- setGUI(monitorSide)
- --Chirp
- elseif (yPos >= 3 and yPos <=6 ) and (xPos >= 38 and xPos <= 48) then
- setAction(monitorSide," Loading Chirp... ")
- if disk.getLabel(diskDriveSide) =="C418 - chirp" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"chirp")
- end
- setGUI(monitorSide)
- --Far
- elseif (yPos >= 7 and yPos <= 9 ) and (xPos >= 2 and xPos <= 12) then
- setAction(monitorSide," Loading Far... ")
- if disk.getLabel(diskDriveSide) =="C418 - far" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"far")
- end
- setGUI(monitorSide)
- --Mall
- elseif (yPos >= 7 and yPos <= 9 ) and (xPos >= 14 and xPos <= 24) then
- setAction(monitorSide," Loading Mall... ")
- if disk.getLabel(diskDriveSide) =="C418 - mall" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"mall")
- end
- setGUI(monitorSide)
- --Mellohi
- elseif (yPos >= 7 and yPos <= 9 ) and (xPos >= 26 and xPos <= 36) then
- setAction(monitorSide," Loading Mellohi... ")
- if disk.getLabel(diskDriveSide) =="C418 - mellohi" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"mellohi")
- end
- setGUI(monitorSide)
- --Stal
- elseif (yPos >= 7 and yPos <= 9 ) and (xPos >= 38 and xPos <= 48) then
- setAction(monitorSide," Loading Stal... ")
- if disk.getLabel(diskDriveSide) =="C418 - stal" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"stal")
- end
- setGUI(monitorSide)
- --Strad
- elseif (yPos >= 11 and yPos <= 14) and (xPos >= 2 and xPos <= 12) then
- setAction(monitorSide," Loading Strad... ")
- if disk.getLabel(diskDriveSide) =="C418 - strad" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"strad")
- end
- setGUI(monitorSide)
- --Ward
- elseif (yPos >= 11 and yPos <= 14) and (xPos >= 14 and xPos <= 24) then
- setAction(monitorSide," Loading Ward... ")
- if disk.getLabel(diskDriveSide) =="C418 - ward" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"ward")
- end
- setGUI(monitorSide)
- --11
- elseif (yPos >= 11 and yPos <= 14) and (xPos >= 26 and xPos <= 36) then
- setAction(monitorSide," Loading 11... ")
- if disk.getLabel(diskDriveSide) =="C418 - 11" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"11")
- end
- setGUI(monitorSide)
- --Wait
- elseif (yPos >= 11 and yPos <= 14) and (xPos >= 38 and xPos <= 48) then
- setAction(monitorSide," Loading Wait... ")
- if disk.getLabel(diskDriveSide) =="wait" or disk.getLabel(diskDriveSide) =="C418 - wait" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"wait")
- end
- setGUI(monitorSide)
- --Still Alive
- elseif (yPos >= 15 and yPos <= 18) and (xPos >= 2 and xPos <= 16) then
- setAction(monitorSide," Loading Still Alive...")
- if disk.getLabel(diskDriveSide) =="pg.stillalive" or disk.getLabel(diskDriveSide) =="Valve - Still Alive" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"still-alive")
- end
- setGUI(monitorSide)
- --Radio Loop
- elseif (yPos >= 15 and yPos <= 18) and (xPos >= 18 and xPos <= 33) then
- setAction(monitorSide," Loading Radio Loop... ")
- if disk.getLabel(diskDriveSide) =="pg.radioloop" or disk.getLabel(diskDriveSide) =="Valve - Radio Loop" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"radio-loop")
- end
- setGUI(monitorSide)
- --Want You Gone
- elseif (yPos >= 15 and yPos <= 18) and (xPos >= 35 and xPos <= 49) then
- setAction(monitorSide," Loading WantYouGone...")
- if disk.getLabel(diskDriveSide) =="pg.wantyougone" or disk.getLabel(diskDriveSide) =="Valve - Want You Gone" then
- playButton(diskDriveSide)
- else
- playRecord(diskDriveSide,recordRedSide,"want-you-gone")
- end
- setGUI(monitorSide)
- end
- end
- -- This is a quick way to test monitor_touch
- --m.setCursorPos(1,1)
- --m.clearLine()
- --while true do
- -- m.setCursorPos(1,1)
- -- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- -- m.clearLine()
- -- m.write(event.." => Side: " .. tostring(side) .. ", " ..
- -- "xPos: ".. xPos ..", " ..
- -- "yPos: ".. yPos)
- -- setAction(monitorSide," test ")
- --
- --end
Advertisement
Add Comment
Please, Sign In to add comment