Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --First time setup/load settings
- if not fs.exists("settings") then
- --shell.run("pastebin", "get", "", "button")
- data = {first = true, pin = " ", name = " "}
- file = fs.open("settings", "w")
- file.write(textutils.serialise(data))
- file.close()
- else
- file = fs.open("settings", "r")
- data = textutils.unserialise(file.readAll())
- file.close()
- end
- --Variable declaration/apis
- shell.run("button")
- size = {x = 26, y = 20}
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- --Changes table button states
- function tState(_t, _s)
- for _, button in pairs(_t) do
- button:set("state", _s)
- end
- end
- --Create number pad buttons
- pinButtons = {}
- local i = 0
- for _yy = 1, 3 do
- for _xx = 0, 2 do
- i = i + 1
- pinButtons[i] = newButton((8 + (_xx * 3)), (11 + (_yy * 2)), 1, 1, tostring(i), "f", "0", (i + 1))
- end
- end
- pinButtons[11] = newButton(11, 19, 1, 1, "0", "f", "0", 0)
- pinButtons[10] = newButton (8, 19, 1, 1, " ", "0", "d", "enter")
- pinButtons[12] = newButton (14, 19, 1, 1, " ", "0", "e", "back")
- tState(pinButtons, false)
- function displayPad(header, _y)
- term.clear()
- term.setCursorPos(math.floor((size.x / 2) - (#header / 2)), _y)
- term.write(header)
- tState(pinButtons, true)
- drawDummyButtons("t")
- end
- --Account creation
- if data.first then
- displayPad("hehe", 6)
- --Normal Startup
- else
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement