Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Musicator MAIN
- -- Created with <3 by FoxWorn3365
- -- Initial values
- notes = {}
- clickAssociation = {}
- page = "home"
- termx, termy = term.getSize()
- notes["do_min"] = "261.64"
- notes["re"] = "293.68"
- notes["mi"] = "329.64"
- notes["fa"] = "349.24"
- notes["sol"] = "392.00"
- notes["la"] = "440.00"
- notes["si"] = "493.92"
- notes["do_max"] = "523.28"
- -- Functions
- function reset()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- end
- function drawHead(text)
- term.setTextColor(colors.white)
- paintutils.drawLine(1, 1, termx, 1, colors.lightBlue)
- local position = (termx - #text)/2
- term.setCursorPos(position, 1)
- print(text)
- normalize()
- end
- function notesMenu()
- term.setTextColor(colors.white)
- local isColored = false
- local used = 8
- paintutils.drawLine(1, 2, termx, 2, colors.lightGray)
- for index, value in ipairs(notes) do
- if isColored == false then
- term.setBackgroundColor(colors.lightGray)
- isColored = true
- else
- term.setBackgroundColor(colors.gray)
- isColored = false
- end
- term.setCursorPos(used, " "..index.." ")
- local endused = used + (#index + 2)
- for i=used, used+(#index + 2) do
- clickAssociation[i] = index
- end
- used = endused
- end
- normalize()
- end
- function normalize()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- end
- function
- while true do
- if page == "home" then
- reset()
- drawHead("Musicator v1.0 - Make your Music!")
- notesMenu()
- os.pullEvent("mouse_click")
- end
- end
Add Comment
Please, Sign In to add comment