SHOW:
|
|
- or go back to the newest paste.
| 1 | mouseWidth = 0 | |
| 2 | mouseHeight = 0 | |
| 3 | ||
| 4 | monitor = peripheral.wrap("top")
| |
| 5 | ||
| 6 | monitor.clear() | |
| 7 | ||
| 8 | monitor.setCursorPos(1,1) | |
| 9 | ||
| 10 | w,h=monitor.getSize() | |
| 11 | ||
| 12 | print(w) | |
| 13 | print(h) | |
| 14 | ||
| 15 | monitor.setBackgroundColour((colours.lime)) | |
| 16 | ||
| 17 | monitor.setCursorPos(20,5) | |
| 18 | ||
| 19 | monitor.write(" RULES ")
| |
| 20 | ||
| 21 | monitor.setCursorPos(20,10) | |
| 22 | ||
| 23 | monitor.write(" STAFF ")
| |
| 24 | ||
| 25 | monitor.setBackgroundColour((colours.black)) | |
| 26 | ||
| 27 | function rules() | |
| 28 | ||
| 29 | monitor.setBackgroundColour((colours.lime)) | |
| 30 | monitor.clear() | |
| 31 | monitor.setCursorPos(20,5) | |
| 32 | ||
| 33 | monitor.write(" 1. No griefing ")
| |
| 34 | monitor.setCursorPos(20,8) | |
| 35 | monitor.write(" 2. No duplication/glitch/exploits ")
| |
| 36 | monitor.setCursorPos(20,11) | |
| 37 | monitor.write(" 3. Be nice, no offensive language ")
| |
| 38 | monitor.setCursorPos(20,14) | |
| 39 | monitor.write(" 4. Other standard rules ")
| |
| 40 | sleep(1) | |
| 41 | - | monitor.write(" Go back ")
|
| 41 | + | |
| 42 | monitor.write(" Go back in 9")
| |
| 43 | sleep(1) | |
| 44 | - | if mouseWidth > 15 and mouseWidth < 25 and mouseHeight == 20 then |
| 44 | + | |
| 45 | - | shell.run("menu")
|
| 45 | + | monitor.write(" Go back in 8")
|
| 46 | sleep(1) | |
| 47 | monitor.setCursorPos(20,17) | |
| 48 | monitor.write(" Go back in 7")
| |
| 49 | sleep(1) | |
| 50 | monitor.setCursorPos(20,17) | |
| 51 | monitor.write(" Go back in 6")
| |
| 52 | sleep(1) | |
| 53 | monitor.setCursorPos(20,17) | |
| 54 | monitor.write(" Go back in 5")
| |
| 55 | sleep(1) | |
| 56 | monitor.setCursorPos(20,17) | |
| 57 | monitor.write(" Go back in 4")
| |
| 58 | sleep(1) | |
| 59 | monitor.setCursorPos(20,17) | |
| 60 | monitor.write(" Go back in 3")
| |
| 61 | sleep(1) | |
| 62 | monitor.setCursorPos(20,17) | |
| 63 | monitor.write(" Go back in 2")
| |
| 64 | sleep(1) | |
| 65 | monitor.setCursorPos(20,17) | |
| 66 | monitor.write(" Go back in 1")
| |
| 67 | sleep(1) | |
| 68 | end | |
| 69 | ||
| 70 | function staff() | |
| 71 | print("staff")
| |
| 72 | end | |
| 73 | ||
| 74 | ||
| 75 | function checkClickPosition() | |
| 76 | if mouseWidth > 15 and mouseWidth < 25 and mouseHeight == 5 then | |
| 77 | ||
| 78 | rules() | |
| 79 | ||
| 80 | elseif mouseWidth > 15 and mouseWidth < 25 and mouseHeight == 10 then | |
| 81 | ||
| 82 | staff() | |
| 83 | ||
| 84 | end | |
| 85 | end | |
| 86 | ||
| 87 | ||
| 88 | repeat | |
| 89 | ||
| 90 | ||
| 91 | event,p1,p2,p3 = os.pullEvent() | |
| 92 | ||
| 93 | ||
| 94 | if event=="monitor_touch" then | |
| 95 | ||
| 96 | ||
| 97 | mouseWidth = p2 -- sets mouseWidth | |
| 98 | mouseHeight = p3 -- and mouseHeight | |
| 99 | checkClickPosition() -- this runs our function | |
| 100 | ||
| 101 | end | |
| 102 | ||
| 103 | until event=="char" and p1==("x") |