Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("left")
- mBack = peripheral.wrap("back")
- local running = true
- local function grnButton()
- m.clear()
- m.setBackgroundColor(colors.black)
- m.setTextScale(1)
- m.setTextColor(colors.lime)
- m.setCursorPos(14,2)
- m.write("Congrats!")
- m.setCursorPos(10,4)
- m.setTextColor(colors.white)
- m.write("Once you select the #Withers")
- m.setCursorPos(9,5)
- m.write("Just wait for Monitor to flash GO!")
- m.setCursorPos(11,6)
- m.write("and jump down to the left")
- m.setCursorPos(13,7)
- m.write("Good Luck")
- end
- local function redButton()
- m.clear()
- m.setTextScale(5)
- m.setCursorPos(2,2)
- m.setTextColor(colors.red)
- m.write("LOSER")
- os.sleep(10)
- os.reboot()
- 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 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
- m.clear()
- end
- local function WelcomeScreen()
- m.clear()
- m.setBackgroundColor(colors.black)
- 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.setBackgroundColor(colors.black)
- 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")
- m.setBackgroundColor(colors.lime)
- for x = 10, 20 do
- for y = 12, 16 do
- m.setCursorPos(x, y)
- m.write(" ")
- end
- end
- m.setBackgroundColor(colors.red)
- for x = 30, 40 do
- for y = 12, 16 do
- m.setCursorPos(x, y)
- m.write(" ")
- end
- end
- end
- -- end of functions list
- m.clear()
- WelcomeScreen()
- os.sleep(1.5)
- local event = (os.pullEvent())
- if event == "monitor_touch" then
- screenTwo()
- buttonMenu(redGrnButtons)
- end
Advertisement
Add Comment
Please, Sign In to add comment