Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made By HDR @MartinRefseth
- button = require("buttonAPI")
- local event = require("event")
- local computer = require("computer")
- local term = require("term")
- local component = require("component")
- local gpu = component.gpu
- -- Functions/Buttons
- function fillTable()
- button.setTable("13", Thir, 2,12,3,5)
- button.setTable("Cat", Cat, 14,24,3,5)
- button.setTable("Blocks", Blocks, 26,36,3,5)
- button.setTable("Chirp", Chirp, 38,48,3,5)
- button.setTable("Far", Far, 50,60,3,5)
- button.setTable("Mall", Mall, 2,12,7,9)
- button.setTable("Mellohi", Mellohi, 14,24,7,9)
- button.setTable("Stal", Stal, 26,36,7,9)
- button.setTable("Strad", Strad, 38,48,7,9)
- button.setTable("Ward", Ward, 50,60,7,9)
- button.setTable("11", Elev, 2,12,11,13)
- button.setTable("Wait", Wait, 14,24,11,13)
- button.setTable("???", Question, 26,36,11,13)
- button.setTable("Gaia 1", GaiaOne, 38,48,11,13)
- button.setTable("Gaia 2", GaiaTwo, 50,60,11,13)
- button.setTable("Still Alive", Slive, 20,30,15,17)
- button.setTable("Radio Loop", Roop, 8,18,15,17)
- button.setTable("Want You", WYG, 32,42,15,17)
- button.setTable("Wanderer", Wander, 44,54,15,17)
- button.setTable("Stop", Stop, 20,30,19,20)
- button.setTable("Reboot", Reboot, 32,42,19,20)
- button.screen()
- end
- function getClick()
- local _, _, x, y = event.pull(1,touch)
- if x == nil or y == nil then
- local h, w = gpu.getResolution()
- gpu.set(h, w, ".")
- gpu.set(h, w, " ")
- else
- button.checkxy(x,y)
- end
- end
- -- Functions
- function Thir()
- button.flash("13")
- print("Loading 13")
- local title = "C418 - 13"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Cat()
- button.flash("Cat")
- print("Loading Cat")
- local title = "C418 - cat"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Blocks()
- button.flash("Blocks")
- print("Loading Blocks")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - blocks"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Chirp()
- button.flash("Chirp")
- print("Loading Chirp")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - chirp"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Far()
- button.flash("Far")
- print("Loading Far")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - far"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Mall()
- button.flash("Mall")
- print("Loading Mall")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - mall"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Mellohi()
- button.flash("Mellohi")
- print("Loading Mellohi")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - mellohi"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Stal()
- button.flash("Stal")
- print("Loading Stal")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - stal"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Strad()
- button.flash("Strad")
- print("Loading Strad")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - strad"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Ward()
- button.flash("Ward")
- print("Loading Ward")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - ward"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Elev()
- button.flash("11")
- print("Loading 11")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - 11"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Wait()
- button.flash("Wait")
- print("Loading Wait")
- peripheral.find("drive", disk.stopAudio)
- local title = "C418 - wait"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Question()
- button.flash("???")
- print("Loading ???")
- peripheral.find("drive", disk.stopAudio)
- local title = "corruption"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function GaiaOne()
- button.flash("Gaia 1")
- print("Loading Gaia 1")
- peripheral.find("drive", disk.stopAudio)
- local title = "botania:gaia1"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function GaiaTwo()
- button.flash("Gaia 2")
- print("Loading Gaia 2")
- peripheral.find("drive", disk.stopAudio)
- local title = "botania:gaia2"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Roop()
- button.flash("Radio Loop")
- print("Loading Radio Loop")
- peripheral.find("drive", disk.stopAudio)
- local title = "portalgun:records.radioloop"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Slive()
- button.flash("Still Alive")
- print("Loading Still Alive")
- peripheral.find("drive", disk.stopAudio)
- local title = "portalgun:records.stillalive"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function WYG()
- button.flash("Want You")
- print("Loading Want You Gone")
- peripheral.find("drive", disk.stopAudio)
- local title = "portalgun:records.wantyougone"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Wander()
- button.flash("Wanderer")
- print("Loading Wanderer")
- peripheral.find("drive", disk.stopAudio)
- local title = "wanderer"
- peripheral.find("drive", disk.stopAudio)
- peripheral.find( "drive", function( name )
- if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
- disk.playAudio( name )
- end
- end )
- end
- function Stop()
- button.flash("Stop")
- print("Stopping Disk")
- peripheral.find("drive", disk.stopAudio)
- end
- function Reboot()
- button.flash("Reboot")
- print("Rebooting")
- --peripheral.find("drive", disk.stopAudio)
- computer.shutdown(true)
- end
- term.setCursorBlink(false)
- gpu.setResolution(61, 20)
- button.clear()
- -- Heading
- local greeting = "HDR's Music System V1.0Dev"
- fillTable()
- button.heading(greeting)
- while true do
- getClick()
- end
Add Comment
Please, Sign In to add comment