SHOW:
|
|
- or go back to the newest paste.
| 1 | --Variables -- | |
| 2 | mouseWidth = 0 | |
| 3 | mouseHeight = 0 | |
| 4 | ||
| 5 | currentMob = "None " | |
| 6 | ||
| 7 | ||
| 8 | --Set turtle connection -- | |
| 9 | rednet.open("back")
| |
| 10 | Turtle = 32 | |
| 11 | ||
| 12 | ||
| 13 | --Set monitor properties | |
| 14 | monitor = peripheral.wrap("bottom")
| |
| 15 | monitor.clear() | |
| 16 | ||
| 17 | monitor.setCursorPos(1,1) | |
| 18 | ||
| 19 | w,h=monitor.getSize() | |
| 20 | ||
| 21 | monitor.setBackgroundColor((colors.lime)) | |
| 22 | ||
| 23 | --Write first list of mobs | |
| 24 | monitor.setCursorPos(2,2) | |
| 25 | monitor.write(" Enderman ")
| |
| 26 | ||
| 27 | monitor.setCursorPos(2,4) | |
| 28 | monitor.write(" Skeleton ")
| |
| 29 | ||
| 30 | monitor.setCursorPos(2,6) | |
| 31 | monitor.write(" Blaze ")
| |
| 32 | ||
| 33 | monitor.setCursorPos(2,8) | |
| 34 | monitor.write(" Whisp ")
| |
| 35 | ||
| 36 | monitor.setCursorPos(2,10) | |
| 37 | monitor.write(" Cow ")
| |
| 38 | ||
| 39 | --Write second list of mobs | |
| 40 | monitor.setCursorPos(16,2) | |
| 41 | monitor.write(" Enderman ")
| |
| 42 | ||
| 43 | monitor.setCursorPos(16,4) | |
| 44 | monitor.write(" Skeleton ")
| |
| 45 | ||
| 46 | monitor.setCursorPos(16,6) | |
| 47 | monitor.write(" Blaze ")
| |
| 48 | ||
| 49 | monitor.setCursorPos(16,8) | |
| 50 | monitor.write(" Whisp ")
| |
| 51 | ||
| 52 | monitor.setCursorPos(16,10) | |
| 53 | monitor.write(" Cow ")
| |
| 54 | ||
| 55 | --Write data -- | |
| 56 | monitor.setCursorPos(2,12) | |
| 57 | monitor.write("Current Mob: ")
| |
| 58 | ||
| 59 | ||
| 60 | ||
| 61 | - | monitor.setCursorPos(15,12) |
| 61 | + | --Update mob data -- |
| 62 | - | monitor.write(currentMob) |
| 62 | + | function setCurrentMobData() |
| 63 | monitor.setCursorPos(15,12) | |
| 64 | monitor.write(currentMob) | |
| 65 | end | |
| 66 | ||
| 67 | -- Perform clicked action -- | |
| 68 | function checkClickPosition() | |
| 69 | -- 1st Row -- | |
| 70 | if(mouseWidth > 1 and mouseWidth < 13 and mouseHeight == 2) then | |
| 71 | - | monitor.write(" Clicked Enderman")
|
| 71 | + | |
| 72 | currentMob = "Enderman" | |
| 73 | setCurrentMobData() | |
| 74 | elseif(mouseWidth > 15 and mouseWidth < 27 and mouseHeight == 2) then | |
| 75 | --Clicked enderman -- | |
| 76 | - | monitor.write(" Clicked Enderman")
|
| 76 | + | |
| 77 | setCurrentMobData() | |
| 78 | -- 2nd Row -- | |
| 79 | elseif(mouseWidth > 1 and mouseWidth < 13 and mouseHeight == 4) then | |
| 80 | --Clicked Skeleton -- | |
| 81 | currentMob = "Skeleton" | |
| 82 | monitor.setCursorPos(2,12) | |
| 83 | monitor.write(" Clicked Skeleton")
| |
| 84 | elseif(mouseWidth > 15 and mouseWidth < 27 and mouseHeight == 4) then | |
| 85 | --Clicked Skeleton -- | |
| 86 | currentMob = "Skeleton" | |
| 87 | monitor.setCursorPos(2,12) | |
| 88 | monitor.write(" Clicked Skeleton")
| |
| 89 | ||
| 90 | -- 3rd Row -- | |
| 91 | elseif(mouseWidth > 1 and mouseWidth < 13 and mouseHeight == 6) then | |
| 92 | --Clicked Blaze | |
| 93 | monitor.setCursorPos(2,12) | |
| 94 | monitor.write(" Clicked Blaze ")
| |
| 95 | elseif(mouseWidth > 15 and mouseWidth < 27 and mouseHeight == 6) then | |
| 96 | --Clicked Blaze -- | |
| 97 | monitor.setCursorPos(2,12) | |
| 98 | monitor.write(" Clicked Blaze ")
| |
| 99 | ||
| 100 | -- 4th Row -- | |
| 101 | elseif(mouseWidth > 1 and mouseWidth < 13 and mouseHeight == 8) then | |
| 102 | --Clicked Whisp -- | |
| 103 | monitor.setCursorPos(2,12) | |
| 104 | monitor.write(" Clicked Whisp ")
| |
| 105 | elseif(mouseWidth > 15 and mouseWidth < 27 and mouseHeight == 8) then | |
| 106 | --Clicked Whisp -- | |
| 107 | monitor.setCursorPos(2,12) | |
| 108 | monitor.write(" Clicked Whisp ")
| |
| 109 | ||
| 110 | -- 5th Row -- | |
| 111 | elseif(mouseWidth > 1 and mouseWidth < 13 and mouseHeight == 10) then | |
| 112 | --Clicked Cow -- | |
| 113 | monitor.setCursorPos(2,10) | |
| 114 | monitor.write(" Clicked Cow ")
| |
| 115 | elseif(mouseWidth > 15 and mouseWidth < 27 and mouseHeight == 10) then | |
| 116 | --Clicked Whisp -- | |
| 117 | monitor.setCursorPos(2,12) | |
| 118 | monitor.write(" Clicked Cow ")
| |
| 119 | end | |
| 120 | end | |
| 121 | ||
| 122 | repeat | |
| 123 | event,p1,p2,p3 = os.pullEvent() | |
| 124 | ||
| 125 | if event == "monitor_touch" then | |
| 126 | mouseWidth = p2 | |
| 127 | mouseHeight = p3 | |
| 128 | checkClickPosition() | |
| 129 | end | |
| 130 | until even=="char" and p1==("x") |