SHOW:
|
|
- or go back to the newest paste.
| 1 | function Bitems() | |
| 2 | ||
| 3 | monitor.setBackgroundColour((colours.lime)) | |
| 4 | monitor.clear() | |
| 5 | monitor.setCursorPos(20,5) | |
| 6 | ||
| 7 | monitor.write(" Player online = ")
| |
| 8 | monitor.setCursorPos(20,8) | |
| 9 | monitor.write(" Player online = ")
| |
| 10 | monitor.setCursorPos(20,11) | |
| 11 | monitor.write(" Player online = ")
| |
| 12 | monitor.setCursorPos(20,14) | |
| 13 | monitor.write(" Player online = ")
| |
| 14 | sleep(1) | |
| 15 | -- monitor.setCursorPos(20,17) | |
| 16 | -- monitor.write(" Go back in 9")
| |
| 17 | end | |
| 18 | ||
| 19 | mouseWidth = 0 | |
| 20 | mouseHeight = 0 | |
| 21 | ||
| 22 | monitor = peripheral.wrap("monitor_1")
| |
| 23 | ||
| 24 | monitor.clear() | |
| 25 | ||
| 26 | monitor.setCursorPos(1,1) | |
| 27 | ||
| 28 | w,h=monitor.getSize() | |
| 29 | ||
| 30 | print(w) | |
| 31 | print(h) | |
| 32 | ||
| 33 | monitor.setBackgroundColour((colours.blue)) | |
| 34 | ||
| 35 | Bitems() | |
| 36 | ||
| 37 | monitor.setBackgroundColour((colours.lime)) | |
| 38 | ||
| 39 | ||
| 40 | ||
| 41 | ||
| 42 | function checkClickPosition() | |
| 43 | if mouseWidth > 15 and mouseWidth < 25 and mouseHeight == 5 then | |
| 44 | ||
| 45 | rules() | |
| 46 | ||
| 47 | elseif mouseWidth > 15 and mouseWidth < 25 and mouseHeight == 10 then | |
| 48 | ||
| 49 | staff() | |
| 50 | ||
| 51 | elseif mouseWidth > 15 and mouseWidth < 25 and mouseHeight == 15 then | |
| 52 | ||
| 53 | Bitems() | |
| 54 | ||
| 55 | end | |
| 56 | end | |
| 57 | ||
| 58 | ||
| 59 | repeat | |
| 60 | ||
| 61 | ||
| 62 | event,p1,p2,p3 = os.pullEvent() | |
| 63 | ||
| 64 | ||
| 65 | if event=="monitor_touch" then | |
| 66 | ||
| 67 | ||
| 68 | mouseWidth = p2 -- sets mouseWidth | |
| 69 | mouseHeight = p3 -- and mouseHeight | |
| 70 | checkClickPosition() -- this runs our function | |
| 71 | ||
| 72 | end | |
| 73 | ||
| 74 | until event=="char" and p1==("x") |