Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("back")
- local mtop = peripheral.wrap("top")
- local mleft = peripheral.wrap("left")
- status = 0
- channel = 1
- replyChannel = 2
- modem.open(1)
- function cls()
- term.clear()
- term.setCursorPos(1,1)
- print("Autospawner Computer")
- if(status == 0) then
- print("Autospawner: ACTIVE")
- else
- print("Autospawner: deactivated")
- end
- print(" ")
- end
- function definemob(mob)
- nmob = tonumber(mob)
- if nmob == 1 then
- return "pig"
- else
- return "ERROR"
- end
- end
- redstone.setOutput("bottom", true)
- cls()
- while true do
- print(" ")
- write(": ")
- text = io.read()
- text_number = tonumber(text)
- if text_number == nil then
- if text == "on" then
- redstone.setOutput("bottom", true)
- status = 0
- cls()
- else if text == "off" then
- redstone.setOutput("bottom", false)
- status = 1
- cls()
- else if text == "clear" then
- cls()
- else
- print("invalid input")
- print(" ")
- end
- end
- end
- else if text_number >= 1 then
- if text_number <= 16 then
- modem.transmit(channel, replyChannel, text) -- modem.transmit(number channel, number replyChannel, any message)
- print("Spawner changed to: ", definemob(text))
- mtop.print("Spawner changed to: ", definemob(text))
- end
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment