Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --start
- rednet.open("back")
- local c2 = {"sl"}
- local c3 = {"s", "z", "b", "e", "w"}
- status = {
- fans = true,
- skeleton = nil,
- zombie = nil,
- blaze = nil,
- enderman = nil,
- wither = nil,
- slime = nil
- }
- --function is locking for the right reciever
- local function contains(val)
- for i=1,#c2 do
- if c2[i] == val then
- return 2
- end
- end
- for i=1,#c3 do
- if c3[i] == val then
- return 3
- end
- end
- return false
- end
- --function for status update
- function statusUpdate(internel)
- if (not internel) then
- id, newStatus, pro = rednet.receive()
- if (id==2) then
- status["slime"] = newStatus["slime"]
- elseif (id==3) then
- status["skeleton"] = newStatus["skeleton"]
- status["zombie"] = newStatus["zombie"]
- status["blaze"] = newStatus["blaze"]
- status["enderman"] = newStatus["enderman"]
- status["wither"] = newStatus["wither"]
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Fans: ", not redstone.getOutput("bottom"))
- print("Skeleton: ", status["skeleton"])
- print("Zombie: ", status["zombie"])
- print("Blaze: ", status["blaze"])
- print("Enderman: ", status["enderman"])
- print("Wither-Skelton: ", status["wither"])
- print("SLime: ", status["slime"])
- end
- --main part
- statusUpdate(true)
- while true do
- msg = read()
- if (msg=="f") then
- redstone.setOutput("bottom", not redstone.getOutput("bottom"))
- statusUpdate(true)
- else
- receiver = contains(msg)
- if (receiver == false) then
- print("ERROR")
- else
- rednet.send(receiver, msg)
- statusUpdate(false)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement