SHOW:
|
|
- or go back to the newest paste.
| 1 | -- Arbitrary ToDo List | |
| 2 | -- DONE code for turtle to place and retrieve safari net from spawner | |
| 3 | -- DONE remote communication from MobBoard to MobTurtle | |
| 4 | -- DONE badly - turtle loading interface (asks for safari nets to be placed in specific slots) | |
| 5 | -- DONE turtle listen program; must have ability to figure out what it has placed on restart and restore communication with board | |
| 6 | -- board program will need to listen for turtle and when it has a turtle put up the button board | |
| 7 | -- create dictionary of safari nets and change to one function for all nets | |
| 8 | ||
| 9 | ||
| 10 | ||
| 11 | rs.setBundledOutput("back", 0)
| |
| 12 | m = peripheral.wrap("right")
| |
| 13 | m.setBackgroundColor(colors.black) | |
| 14 | m.setTextColor(colors.white) | |
| 15 | m.setTextScale(1) | |
| 16 | m.setCursorPos(1,1) | |
| 17 | m.setTextColor(colors.black) | |
| 18 | m.setBackgroundColor(colors.lightGray) | |
| 19 | m.write(" MFR Auto-Spawner Control Panel ")
| |
| 20 | m.setCursorPos(1,3) | |
| 21 | m.setTextColor(colors.black) | |
| 22 | m.setBackgroundColor(colors.lightGray) | |
| 23 | - | function enderman() |
| 23 | + | |
| 24 | - | rs.setBundledOutput("back", colors.white)
|
| 24 | + | |
| 25 | - | sleep(1) |
| 25 | + | |
| 26 | - | rs.setBundledOutput("back", 0)
|
| 26 | + | |
| 27 | line3 = 28 | |
| 28 | y = 0 | |
| 29 | - | function witherSkeleton() |
| 29 | + | modem = peripheral.wrap("left")
|
| 30 | - | rs.setBundledOutput("back", colors.orange)
|
| 30 | + | |
| 31 | - | sleep(1) |
| 31 | + | |
| 32 | - | rs.setBundledOutput("back", 0)
|
| 32 | + | |
| 33 | ||
| 34 | function selectMob(selection) | |
| 35 | - | function ghast() |
| 35 | + | modem.transmit(1001,999,selection) |
| 36 | - | rs.setBundledOutput("back", colors.magenta)
|
| 36 | + | |
| 37 | - | sleep(1) |
| 37 | + | |
| 38 | - | rs.setBundledOutput("back", 0)
|
| 38 | + | |
| 39 | rs.setOutput("top", true)
| |
| 40 | - | |
| 40 | + | sleep(1) |
| 41 | - | function slime() |
| 41 | + | rs.setOutput("top", false)
|
| 42 | - | rs.setBundledOutput("back", colors.purple)
|
| 42 | + | |
| 43 | - | sleep(1) |
| 43 | + | |
| 44 | - | rs.setBundledOutput("back", 0)
|
| 44 | + | |
| 45 | m.setTextColor(colors.black) | |
| 46 | m.setBackgroundColor(colors.lightGray) | |
| 47 | - | function witch() |
| 47 | + | |
| 48 | - | rs.setBundledOutput("back", colors.yellow)
|
| 48 | + | |
| 49 | - | sleep(1) |
| 49 | + | |
| 50 | - | rs.setBundledOutput("back", 0)
|
| 50 | + | m.setCursorPos(15, 3) |
| 51 | format() | |
| 52 | m.write(e) | |
| 53 | - | function blaze() |
| 53 | + | |
| 54 | - | rs.setBundledOutput("back", colors.lime)
|
| 54 | + | |
| 55 | - | sleep(1) |
| 55 | + | |
| 56 | - | rs.setBundledOutput("back", 0)
|
| 56 | + | |
| 57 | m.setCursorPos(line3 + 3, 3) | |
| 58 | format() | |
| 59 | - | function sheep() |
| 59 | + | |
| 60 | - | rs.setBundledOutput("back", colors.pink)
|
| 60 | + | |
| 61 | - | sleep(1) |
| 61 | + | |
| 62 | - | rs.setBundledOutput("back", 0)
|
| 62 | + | |
| 63 | m.setCursorPos(line1, 7) | |
| 64 | format() | |
| 65 | - | function cow() |
| 65 | + | |
| 66 | - | rs.setBundledOutput("back", colors.gray)
|
| 66 | + | |
| 67 | - | sleep(1) |
| 67 | + | |
| 68 | - | rs.setBundledOutput("back", 0)
|
| 68 | + | |
| 69 | m.setCursorPos(line3, 7) | |
| 70 | format() | |
| 71 | - | function creeper() |
| 71 | + | |
| 72 | - | rs.setBundledOutput("back", colors.lightGray)
|
| 72 | + | |
| 73 | - | sleep(1) |
| 73 | + | |
| 74 | - | rs.setBundledOutput("back", 0)
|
| 74 | + | |
| 75 | m.setCursorPos(line2, 9) | |
| 76 | format() | |
| 77 | - | function ironGolem() |
| 77 | + | |
| 78 | - | rs.setBundledOutput("back", colors.cyan)
|
| 78 | + | |
| 79 | - | sleep(1) |
| 79 | + | |
| 80 | - | rs.setBundledOutput("back", 0)
|
| 80 | + | |
| 81 | m.setCursorPos(line3, 11) | |
| 82 | format() | |
| 83 | m.write(" Creeper ")
| |
| 84 | - | rs.setOutput("top", true)
|
| 84 | + | |
| 85 | - | sleep(1) |
| 85 | + | |
| 86 | - | rs.setOutput("top", false)
|
| 86 | + | |
| 87 | m.setCursorPos(line2, 11) | |
| 88 | format() | |
| 89 | m.write("Iron Golem")
| |
| 90 | - | m.setTextColor(colors.black) |
| 90 | + | |
| 91 | - | m.setBackgroundColor(colors.lightGray) |
| 91 | + | |
| 92 | m.write(" Wither Skeleton ")
| |
| 93 | ||
| 94 | -- Main event loop | |
| 95 | - | m.setCursorPos(15, 3) |
| 95 | + | |
| 96 | - | format() |
| 96 | + | event, p1, p2, p3 = os.pullEvent("monitor_touch")
|
| 97 | - | m.write(e) |
| 97 | + | x = p2 |
| 98 | y = p3 | |
| 99 | m.setCursorPos(15,3) | |
| 100 | format() | |
| 101 | m.write(e) | |
| 102 | if x>line1 and x<12 and y == 7 then | |
| 103 | e = " Enderman " | |
| 104 | CurrMob() | |
| 105 | reset() | |
| 106 | y = 7 | |
| 107 | selectMob("enderman")
| |
| 108 | elseif x>line2 and x<25 and y == 7 then | |
| 109 | e = " Ghast " | |
| 110 | CurrMob() | |
| 111 | reset() | |
| 112 | y = 7 | |
| 113 | selectMob("ghast")
| |
| 114 | elseif x>line3 and x<38 and y == 7 then | |
| 115 | e = " Sheep " | |
| 116 | CurrMob() | |
| 117 | reset() | |
| 118 | y = 7 | |
| 119 | selectMob("sheep")
| |
| 120 | elseif x>line1 and x<12 and y == 9 then | |
| 121 | e = " Blaze " | |
| 122 | CurrMob() | |
| 123 | reset() | |
| 124 | y = 9 | |
| 125 | selectMob("blaze")
| |
| 126 | elseif x>line2 and x<25 and y == 9 then | |
| 127 | e = " Slime " | |
| 128 | CurrMob() | |
| 129 | reset() | |
| 130 | y = 9 | |
| 131 | selectMob("slime")
| |
| 132 | elseif x>line3 and x<38 and y == 9 then | |
| 133 | e = " Witch " | |
| 134 | CurrMob() | |
| 135 | reset() | |
| 136 | y = 9 | |
| 137 | selectMob("witch")
| |
| 138 | elseif x>line1 and x<12 and y == 11 then | |
| 139 | e = " Cow " | |
| 140 | - | --where the magic happens-- |
| 140 | + | CurrMob() |
| 141 | reset() | |
| 142 | y = 11 | |
| 143 | - | event, p1, p2, p3 = os.pullEvent("monitor_touch")
|
| 143 | + | selectMob("cow")
|
| 144 | - | x = p2 |
| 144 | + | |
| 145 | - | y = p3 |
| 145 | + | e = "Iron Golem" |
| 146 | - | m.setCursorPos(15,3) |
| 146 | + | CurrMob() |
| 147 | - | format() |
| 147 | + | reset() |
| 148 | - | m.write(e) |
| 148 | + | y = 11 |
| 149 | selectMob("ironGolem")
| |
| 150 | - | e = " Enderman " |
| 150 | + | |
| 151 | - | CurrMob() |
| 151 | + | e = "Wither Skelly" |
| 152 | - | reset() |
| 152 | + | CurrMob() |
| 153 | - | y = 7 |
| 153 | + | reset() |
| 154 | - | enderman() |
| 154 | + | y = 13 |
| 155 | selectMob("witherSkelly")
| |
| 156 | - | e = " Ghast " |
| 156 | + | |
| 157 | - | CurrMob() |
| 157 | + | e = " Creeper " |
| 158 | - | reset() |
| 158 | + | CurrMob() |
| 159 | - | y = 7 |
| 159 | + | reset() |
| 160 | - | ghast() |
| 160 | + | y = 13 |
| 161 | selectMob("creeper")
| |
| 162 | - | e = " Sheep " |
| 162 | + | elseif x>line3+2 and x<38 and y == 3 then |
| 163 | - | CurrMob() |
| 163 | + | e = " None " |
| 164 | - | reset() |
| 164 | + | CurrMob() |
| 165 | - | y = 7 |
| 165 | + | m.setCursorPos(line3 + 3, 3) |
| 166 | - | sheep() |
| 166 | + | m.setBackgroundColor(colors.red) |
| 167 | m.setTextColor(colors.black) | |
| 168 | - | e = " Blaze " |
| 168 | + | m.write(" Reset ")
|
| 169 | - | CurrMob() |
| 169 | + | reset() |
| 170 | - | reset() |
| 170 | + | sleep(.5) |
| 171 | - | y = 9 |
| 171 | + | m.setCursorPos(line3 + 3, 3) |
| 172 | - | blaze() |
| 172 | + | format() |
| 173 | m.write(" Reset ")
| |
| 174 | - | e = " Slime " |
| 174 | + | selectMob("reset")
|
| 175 | - | CurrMob() |
| 175 | + | end |
| 176 | - | reset() |
| 176 | + |