Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("buttonAPI")
- m = peripheral.wrap("bottom")
- m.setTextScale(2)
- local count = 1
- function centerText(text, posY)
- local x, y = m.getSize()
- m.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), posY)
- m.write(text)
- end
- function fillTable()
- buttonAPI.setTable("Back", back, 2, 13, 16, 19)
- buttonAPI.setTable("Forward", fwd, 24, 35, 16, 19)
- buttonAPI.screen()
- end
- function getClick()
- event, side, x, y = os.pullEvent("monitor_touch")
- buttonAPI.checkxy(x,y)
- end
- function back()
- buttonAPI.flash("Back")
- if count == 2 then
- dispOne()
- count = 1
- elseif count == 3 then
- dispTwo()
- count = 2
- end
- end
- function fwd()
- buttonAPI.flash("Forward")
- if count == 1 then
- dispTwo()
- count = 2
- elseif count == 2 then
- dispThree()
- count = 3
- end
- end
- function dispOne()
- m.clear()
- fillTable()
- centerText("1/3", 1)
- centerText("Welcome to UmbraCraft", 5)
- centerText("Oceanic Minecraft Community", 7)
- centerText("Newcomers please read", 9)
- end
- function dispTwo()
- m.clear()
- fillTable()
- centerText("2/3", 1)
- centerText("Rules:", 5)
- centerText("Be Friendly", 7)
- centerText("No Griefing", 8)
- centerText("Follow these 2 basic rules", 10)
- centerText("and all should be well", 11)
- end
- function dispThree()
- m.clear()
- fillTable()
- centerText("3/3", 1)
- centerText("Useful Commands:", 5)
- centerText("/nv - turn on Night Vision", 7)
- centerText("/nv off - turn off Night Vision", 8)
- end
- dispOne()
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement