Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Arbitrary ToDo List
- -- DONE code for turtle to place and retrieve safari net from spawner
- -- DONE remote communication from MobBoard to MobTurtle
- -- DONE badly - turtle loading interface (asks for safari nets to be placed in specific slots)
- -- DONE turtle listen program; must have ability to figure out what it has placed on restart and restore communication with board
- -- board program will need to listen for turtle and when it has a turtle put up the button board
- -- create dictionary of safari nets and change to one function for all nets
- rs.setBundledOutput("back", 0)
- m = peripheral.wrap("right")
- m.setBackgroundColor(colors.black)
- m.setTextColor(colors.white)
- m.setTextScale(1)
- m.setCursorPos(1,1)
- m.setTextColor(colors.black)
- m.setBackgroundColor(colors.lightGray)
- m.write(" MFR Auto-Spawner Control Panel ")
- m.setCursorPos(1,3)
- m.setTextColor(colors.black)
- m.setBackgroundColor(colors.lightGray)
- m.write("Current Mob:")
- e = " None "
- line1 = 2
- line2 = 15
- line3 = 28
- y = 0
- modem = peripheral.wrap("left")
- --Functions--
- function selectMob(selection)
- modem.transmit(1001,999,selection)
- end
- function reset()
- rs.setOutput("top", true)
- sleep(1)
- rs.setOutput("top", false)
- end
- function format()
- m.setTextColor(colors.black)
- m.setBackgroundColor(colors.lightGray)
- end
- function CurrMob()
- m.setCursorPos(15, 3)
- format()
- m.write(e)
- end
- --Main--
- reset()
- m.setCursorPos(line3 + 3, 3)
- format()
- m.write(" Reset ")
- m.setCursorPos(1,5)
- format()
- m.write("--------------Select One---------------")
- m.setCursorPos(line1, 7)
- format()
- m.write(" Enderman ")
- m.setCursorPos(line2, 7)
- format()
- m.write(" Ghast ")
- m.setCursorPos(line3, 7)
- format()
- m.write(" Sheep ")
- m.setCursorPos(line1, 9)
- format()
- m.write(" Blaze ")
- m.setCursorPos(line2, 9)
- format()
- m.write(" Slime ")
- m.setCursorPos(line3, 9)
- format()
- m.write(" Witch ")
- m.setCursorPos(line3, 11)
- format()
- m.write(" Creeper ")
- m.setCursorPos(line1, 11)
- format()
- m.write(" Cow ")
- m.setCursorPos(line2, 11)
- format()
- m.write("Iron Golem")
- m.setCursorPos(line1, 13)
- format()
- m.write(" Wither Skeleton ")
- -- Main event loop
- while true do
- event, p1, p2, p3 = os.pullEvent("monitor_touch")
- x = p2
- y = p3
- m.setCursorPos(15,3)
- format()
- m.write(e)
- if x>line1 and x<12 and y == 7 then
- e = " Enderman "
- CurrMob()
- reset()
- y = 7
- selectMob("enderman")
- elseif x>line2 and x<25 and y == 7 then
- e = " Ghast "
- CurrMob()
- reset()
- y = 7
- selectMob("ghast")
- elseif x>line3 and x<38 and y == 7 then
- e = " Sheep "
- CurrMob()
- reset()
- y = 7
- selectMob("sheep")
- elseif x>line1 and x<12 and y == 9 then
- e = " Blaze "
- CurrMob()
- reset()
- y = 9
- selectMob("blaze")
- elseif x>line2 and x<25 and y == 9 then
- e = " Slime "
- CurrMob()
- reset()
- y = 9
- selectMob("slime")
- elseif x>line3 and x<38 and y == 9 then
- e = " Witch "
- CurrMob()
- reset()
- y = 9
- selectMob("witch")
- elseif x>line1 and x<12 and y == 11 then
- e = " Cow "
- CurrMob()
- reset()
- y = 11
- selectMob("cow")
- elseif x>line2 and x<25 and y == 11 then
- e = "Iron Golem"
- CurrMob()
- reset()
- y = 11
- selectMob("ironGolem")
- elseif x>line1 and x<19 and y == 13 then
- e = "Wither Skelly"
- CurrMob()
- reset()
- y = 13
- selectMob("witherSkelly")
- elseif x>line3 and x<38 and y == 11 then
- e = " Creeper "
- CurrMob()
- reset()
- y = 13
- selectMob("creeper")
- elseif x>line3+2 and x<38 and y == 3 then
- e = " None "
- CurrMob()
- m.setCursorPos(line3 + 3, 3)
- m.setBackgroundColor(colors.red)
- m.setTextColor(colors.black)
- m.write(" Reset ")
- reset()
- sleep(.5)
- m.setCursorPos(line3 + 3, 3)
- format()
- m.write(" Reset ")
- selectMob("reset")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement