Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("left")
- local running = true
- local function grnButton()
- m,clear()
- m.setTextScale(5)
- m.write("DO IT!")
- end
- local function redButton()
- m.clear()
- m.setTextScale(5)
- m.setCursorPos(1,2)
- m.setTextColor(colors.red)
- m.write("LOSER")
- end
- local redGrnButtons ={
- [1] = {buttonType = 1, startX = 10, endX = 20, startY = 12, endY = 16, buttonText = "GO!", command = grnButton},
- [2] = {buttonType = 1, startX = 30, endX = 40, startY = 12, endY = 16, buttonText = "NO", command = redButton}
- }
- local function buttonMenu(table)
- for k,v in ipairs(table) do
- m.setCursorPos(table[k].startX, table[k].startY
- end
- while running do
- for k,v in ipairs(table) do
- event, button, x, y = os.pullevent
- if event == "monitor_touch" then
- if button = table[k].buttonType then
- if x >= table[k].startX and x <= table[k].endX and y >= table[k].startY and y <= table[k].endY then
- table[k].command()
- end
- end
- end
- end
- end
- m.clear()
- end
- local function WelcomeScreen()
- m.clear()
- m.setTextScale(4)
- m.setCursorPos(0,1)
- m.setTextColor(colors.lime)
- m.write(" Welcome")
- m.setCursorPos(5,3)
- m.setTextColor(colors.yellow)
- m.write("to the")
- m.setCursorPos(8,5)
- m.setTextColor(colors.red)
- m.write("ARENA!")
- end
- local function screenTwo()
- m.clear()
- m.setTextScale(1)
- m.setCursorPos(9,1)
- m.setTextColor(colors.white)
- m.write("Welcome to HDbag's Wither Arena!!!")
- m.setCursorPos(4,2)
- m.write("Co-Hosting IPJ and the boss of the underworld")
- m.setCursorPos(8,5)
- m.write("simply push the green button to start")
- m.setCursorPos(11,6)
- m.write("Or push the red button to stop")
- m.setCursorPos(1,8)
- m.write("Work In Progress - - - Owners not held responsible")
- end
- -- end of functions list
- WelcomeScreen()
- os.sleep(1.5)
- local event = (os.pullEvent())
- if event == "monitor_touch" then
- screenTwo()
- buttonMenu(redGrnButtons)
- else
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement