Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- qq = 1 --Rednet ID of Turtle
- if not fs.exists("it") then
- pop = fs.open("it", "w")
- pop.write("On")
- pop.close()
- end
- if not fs.exists("Current") then
- pip = fs.open("Current", "w")
- pip.write("Empty")
- pip.close()
- end
- title = "Pokeball Spawner v1"
- message = "Pokeball Switched"
- m = peripheral.wrap("top")
- m.setBackgroundColor(colors.white)
- m.clear()
- going = true
- term.redirect(m)
- function ok(current)
- going = false
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(w/2-#message/2, h/2)
- print(message)
- shell.run("delete Current")
- a = fs.open("Current", "w")
- a.write(current)
- a.close()
- os.sleep(3)
- --term.clear()
- --going = true
- shell.run("mobs")
- end
- term.setTextColor(colors.black)
- w, h = term.getSize()
- term.setCursorPos(1, 1)
- term.setCursorPos(w/2-#title/2, 1)
- print("Pokeball Spawner v1")
- paintutils.drawLine(2, 3, 10,3, colors.black)
- term.setTextColor(colors.purple)
- term.setCursorPos(2, 3)
- print("Enderman")
- term.setTextColor(colors.black)
- paintutils.drawLine(13, 3, 21, 3, colors.brown)
- term.setCursorPos(14, 3)
- print("Zombie")
- paintutils.drawLine(w-20, 3, w-12, 3, colors.green)
- term.setCursorPos(w-19, 3)
- print("Creeper")
- paintutils.drawLine(w-9, 3, w-1, 3, colors.lightGray)
- term.setCursorPos(w-9, 3)
- print("Skeleton")
- paintutils.drawLine(2, 5, 10, 5, colors.green)
- term.setCursorPos(4, 5)
- print("Dryad")
- paintutils.drawLine(13, 5, 21, 5, colors.purple)
- term.setCursorPos(15, 5)
- print("Witch")
- paintutils.drawLine(w-20, 5, w-12, 5, colors.brown)
- term.setCursorPos(w-17, 5)
- print("Cow")
- paintutils.drawLine(w-9, 5, w-1, 5, colors.black)
- term.setTextColor(colors.white)
- term.setCursorPos(w-8, 5)
- print("Wither")
- --term.setTextColor(colors.black)
- paintutils.drawLine(2, 7, 10, 7, colors.black)
- term.setCursorPos(3, 7)
- print("Spider")
- term.setTextColor(colors.black)
- paintutils.drawLine(13, 7, 21, 7, colors.lightGray)
- term.setCursorPos(14, 7)
- print("Sheep")
- paintutils.drawLine(w-20, 7, w-12, 7, colors.green)
- term.setCursorPos(w-18, 7)
- print("Slime")
- paintutils.drawLine(w-9, 7, w-1, 7, colors.red)
- term.setCursorPos(w-9, 7)
- print("Mooshroom")
- paintutils.drawLine(2, 9, 10, 9, colors.orange)
- term.setCursorPos(4, 9)
- print("Blaze")
- paintutils.drawLine(w-20, 9, w-12, 9, colors.lightGray)
- term.setCursorPos(w-18, 9)
- print("Wolf")
- --paintutils.drawLine(1, h-1, 7, h-1, colors.red)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(1, h-1)
- print("Remove")
- term.setCursorPos(w-14, h-1)
- print("Currently:")
- term.setCursorPos(w-3, h-1)
- er = fs.open("it", "r")
- ab = er.readAll()
- if ab == "Off" then
- print("Off")
- elseif ab == "On" then
- print("On")
- end
- er.close()
- b = fs.open("Current", "r")
- c = b.readAll()
- inside = c
- term.setCursorPos(w/2-9/2-7, h-1)
- print("Current: "..c)
- b.close()
- paintutils.drawLine(13, 9, 21, 9, colors.lightGray)
- term.setCursorPos(14, 9)
- print("Ghast")
- paintutils.drawLine(w-9, 9, w-1, 9, colors.red)
- term.setCursorPos(w-8, 9)
- print("Hellcow")
- while going do
- er = fs.open("it", "r")
- ab = er.readAll()
- event, side, xpos, ypos = os.pullEvent("monitor_touch")
- if xpos >= 2 and xpos <= 10 and ypos == 3 then
- rednet.send(qq, "one")
- ok("Enderman")
- elseif xpos >= 13 and xpos <= 21 and ypos == 3 then
- rednet.send(qq, "two")
- ok("Zombie")
- elseif xpos >= w-20 and xpos <= w-12 and ypos == 3 then
- rednet.send(qq, "three")
- ok("Creeper")
- elseif xpos >= w-9 and xpos <= w-1 and ypos == 3 then
- rednet.send(qq, "four")
- ok("Skeleton")
- elseif xpos >= 2 and xpos <= 10 and ypos == 5 then
- rednet.send(qq, "five")
- ok("Dryad")
- elseif xpos >= 13 and xpos <= 21 and ypos == 5 then
- rednet.send(qq, "six")
- ok("Witch")
- elseif xpos >= w-20 and xpos <= w-12 and ypos == 5 then
- rednet.send(qq, "seven")
- ok("Cow")
- elseif xpos >= w-9 and xpos <= w-1 and ypos == 5 then
- rednet.send(qq, "eight")
- ok("Wither")
- elseif xpos >= 2 and xpos <= 10 and ypos == 7 then
- rednet.send(qq, "nine")
- ok("Spider")
- elseif xpos >= 13 and xpos <= 21 and ypos == 7 then
- rednet.send(qq, "ten")
- ok("Sheep")
- elseif xpos >= w-20 and xpos <= w-12 and ypos == 7 then
- rednet.send(qq, "eleven")
- ok("Slime")
- elseif xpos >= w-9 and xpos <= w-1 and ypos == 7 then
- rednet.send(qq, "twelve")
- ok("Mooshroom")
- elseif xpos >= 2 and xpos <= 10 and ypos == 9 then
- rednet.send(qq, "thirteen")
- ok("Blaze")
- elseif xpos >= 13 and xpos <= 21 and ypos == 9 then
- rednet.send(qq, "fourteen")
- ok("Ghast")
- elseif xpos >= w-20 and xpos <= w-12 and ypos == 9 then
- rednet.send(qq, "fifteen")
- ok("Wolf")
- elseif xpos >= w-9 and xpos <= w-1 and ypos == 9 then
- rednet.send(qq, "sixteen")
- ok("Hellcow")
- elseif xpos >= 1 and xpos <= 6 and ypos == h-1 then
- rednet.send(qq, "stop")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(w/2-16/2, h/2)
- print("Pokeball Removed")
- os.sleep(3)
- shell.run("delete Current")
- g = fs.open("Current", "w")
- g.write("Empty")
- g.close()
- shell.run("mobs")
- elseif xpos >= w-3 and xpos <= w and ypos == h-1 then
- term.setBackgroundColor(colors.white)
- if ab == "On" then
- rednet.send(qq, "off")
- er.close()
- shell.run("delete it")
- to = fs.open("it", "w")
- to.write("Off")
- to.close()
- term.setCursorPos(1, h-1)
- term.clearLine()
- term.setCursorPos(1, h-1)
- print("Remove")
- term.setCursorPos(w/2-9/2-7, h-1)
- print("Current: "..inside)
- term.setCursorPos(w-14, h-1)
- print("Currently:")
- term.setCursorPos(w-3, h-1)
- print("Off")
- elseif ab == "Off" then
- rednet.send(qq, "on")
- er.close()
- shell.run("delete it")
- to = fs.open("it", "w")
- to.write("On")
- to.close()
- term.setCursorPos(1, h-1)
- term.clearLine()
- term.setCursorPos(1, h-1)
- print("Remove")
- term.setCursorPos(w/2-9/2-7, h-1)
- print("Current: "..inside)
- term.setCursorPos(w-14, h-1)
- print("Currently:")
- term.setCursorPos(w-3, h-1)
- print("On")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement