Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("boot -- starting")
- local monitor = peripheral.wrap("right")
- dofile("clearmon")
- monitor.setTextScale(2)
- menu = "main"
- --Draw menus and stuff
- print("boot -- building functions")
- function drawQuit (c)
- print("draw -- quit button")
- monitor.setBackgroundColor(c)
- monitor.setCursorPos(1,10)
- monitor.write(" Quit ")
- end
- function drawNews (c)
- print("draw -- news button")
- monitor.setBackgroundColor(colors.black)
- monitor.setCursorPos(1,1)
- monitor.write("Billboard by bbaovanc")
- monitor.setBackgroundColor(c)
- monitor.setCursorPos(3,2)
- monitor.write(" ")
- monitor.setCursorPos(3,3)
- monitor.write(" News ")
- monitor.setCursorPos(3,4)
- monitor.write(" ")
- end
- function drawRules (c)
- print("draw -- rules button")
- monitor.setBackgroundColor(c)
- monitor.setCursorPos(15,2)
- monitor.write(" ")
- monitor.setCursorPos(15,3)
- monitor.write(" Rules ")
- monitor.setCursorPos(15,4)
- monitor.write(" ")
- end
- function drawMainMenu ()
- print("draw -- main menu")
- menu = "main"
- dofile("clearmon")
- drawNews(colors.orange)
- drawRules(colors.green)
- drawQuit(colors.red)
- end
- function drawNewsMenu ()
- print("draw -- news menu")
- menu = "news"
- dofile("clearmon")
- monitor.setBackgroundColor(colors.black)
- monitor.setCursorPos(1,1)
- monitor.write("-------------------------")
- monitor.setCursorPos(1,2)
- monitor.write("bbaovanc's PC shop coming")
- monitor.setCursorPos(1,3)
- monitor.write("soon!")
- monitor.setCursorPos(1,4)
- monitor.write("-------------------------")
- monitor.setCursorPos(1,5)
- monitor.write("Unvexed's Potion Pit now")
- monitor.setCursorPos(1,6)
- monitor.write("open!")
- monitor.setCursorPos(1,7)
- monitor.write("-------------------------")
- drawQuit(colors.red)
- end
- function drawRulesMenu ()
- print("draw -- rules menu")
- menu = "rules"
- dofile("clearmon")
- monitor.setBackgroundColor(colors.black)
- monitor.setCursorPos(1,1)
- monitor.write("1. No griefing or ")
- monitor.setCursorPos(1,2)
- monitor.write(" permanent pranks")
- monitor.setCursorPos(1,3)
- monitor.write("2. No commands ever!")
- monitor.setCursorPos(1,4)
- monitor.write("3. Don't be rude in any")
- monitor.setCursorPos(1,5)
- monitor.write(" way. Use #reporting")
- monitor.setCursorPos(1,6)
- monitor.write("- Breaking any rule is a")
- monitor.setCursorPos(1,7)
- monitor.write(" bannable offense!")
- monitor.setCursorPos(1,8)
- monitor.write("- Make sure to put NEI in")
- monitor.setCursorPos(1,9)
- monitor.write(" recipe mode!")
- drawQuit(colors.red)
- end
- drawMainMenu()
- --Loop
- while true == true do
- local _,s,x,y = os.pullEvent("monitor_touch")
- print("x: ", x, " y: ", y)
- if x >= 3 and x <= 8 and menu == "main" then
- if y >=2 and y <= 4 then
- drawNews(colors.cyan)
- os.sleep(0.5)
- drawNewsMenu()
- end
- elseif x <= 6 and y == 10 and menu == "main" then
- drawQuit(colors.green)
- os.sleep(0.5)
- dofile("clearmon2")
- os.shutdown()
- drawQuit(colors.red)
- elseif x <= 6 and y == 10 and menu ~= "main" then
- drawQuit(colors.green)
- os.sleep(0.5)
- drawMainMenu()
- elseif x >= 15 and x <= 22 and menu == "main" then
- if y >= 2 and y <= 4 then
- drawRules(colors.red)
- os.sleep(0.5)
- drawRulesMenu()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement