Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- local side = "back"
- local int = 0
- local name = "null"
- local state = "false"
- active =
- {
- ["test"] = false,
- ["cow"] = false,
- ["wither"] = false,
- ["sheep"] = false,
- ["squid"] = false,
- ["ghast"] = false,
- ["blaze"] = false,
- ["creeper"] = false,
- ["witch"] = false,
- ["pigman"] = false,
- ["enderman"] = false,
- ["golem"] = false,
- ["blizz"] = false,
- ["zombie"] = false
- }
- redstone.setBundledOutput(side, 0)
- function update()
- if int >= 0 then
- redstone.setBundledOutput(side, int)
- else
- int = 0
- print("ERROR://INT=MINUS")
- end
- end
- while true do
- id, cmd = rednet.receive()
- -- Sheep, white
- if cmd == "sheep on" then
- if active["sheep"] == false then
- int = int + 1
- active["sheep"] = true
- update()
- end
- elseif cmd == "sheep off" then
- if active["sheep"] == true then
- int = int - 1
- active["sheep"] = false
- update()
- end
- -- Wither skeletons, black
- elseif cmd == "wither on" then
- if active["wither"] == false then
- int = int + 32768
- active["wither"] = true
- update()
- end
- elseif cmd == "wither off" then
- if active["wither"] == true then
- int = int - 32768
- active["wither"] = false
- update()
- end
- -- Squid, blue
- elseif cmd == "squid on" then
- if active["squid"] == false then
- int = int + 2048
- active["squid"] = true
- update()
- end
- elseif cmd == "squid off" then
- if active["squid"] == true then
- int = int - 2048
- active["squid"] = false
- update()
- end
- -- Cow, brown
- elseif cmd == "cow on" then
- if active["cow"] == false then
- int = int + 4096
- active["cow"] = true
- update()
- end
- elseif cmd == "cow off" then
- if active["cow"] == true then
- int = int - 4096
- active["cow"] = false
- update()
- end
- -- TEST, yellow
- elseif cmd == "test on" then
- if active["test"] == false then
- int = int + 16
- active["test"] = true
- update()
- end
- elseif cmd == "test off" then
- if active["test"] == true then
- int = int - 16
- active["test"] = false
- update()
- end
- -- Ghast, light gray
- elseif cmd == "ghast on" then
- if active["ghast"] == false then
- int = int + 256
- active["ghast"] = true
- update()
- end
- elseif cmd == "ghast off" then
- if active["ghast"] == true then
- int = int - 256
- active["ghast"] = false
- update()
- end
- -- Blaze, red
- elseif cmd == "blaze on" then
- if active["blaze"] == false then
- int = int + 16384
- active["blaze"] = true
- update()
- end
- elseif cmd == "blaze off" then
- if active["blaze"] == true then
- int = int - 16384
- active["blaze"] = false
- update()
- end
- -- Creeper, green
- elseif cmd == "creeper on" then
- if active["creeper"] == false then
- int = int + 8192
- active["creeper"] = true
- update()
- end
- elseif cmd == "creeper off" then
- if active["creeper"] == true then
- int = int - 8192
- active["creeper"] = false
- update()
- end
- -- Witch, purple
- elseif cmd == "witch on" then
- if active["witch"] == false then
- int = int + 1024
- active["witch"] = true
- update()
- end
- elseif cmd == "witch off" then
- if active["witch"] == true then
- int = int - 1024
- active["witch"] = false
- update()
- end
- -- Pigman, orange
- elseif cmd == "pigman on" then
- if active["pigman"] == false then
- int = int + 2
- active["pigman"] = true
- update()
- end
- elseif cmd == "pigman off" then
- if active["pigman"] == true then
- int = int - 2
- active["pigman"] = false
- update()
- end
- -- Enderman, light blue
- elseif cmd == "enderman on" then
- if active["enderman"] == false then
- int = int + 8
- active["enderman"] = true
- update()
- end
- elseif cmd == "enderman off" then
- if active["enderman"] == true then
- int = int - 8
- active["enderman"] = false
- update()
- end
- -- Golem, gray
- elseif cmd == "golem on" then
- if active["golem"] == false then
- int = int + 128
- active["golem"] = true
- update()
- end
- elseif cmd == "golem off" then
- if active["golem"] == true then
- int = int - 128
- active["golem"] = false
- update()
- end
- -- Zombie, lime green
- elseif cmd == "zombie on" then
- if active["zombie"] == false then
- int = int + 32
- active["zombie"] = true
- update()
- end
- elseif cmd == "zombie off" then
- if active["zombie"] == true then
- int = int - 32
- active["zombie"] = false
- update()
- end
- -- Blizz, magenta
- elseif cmd == "blizz on" then
- if active["blizz"] == false then
- int = int + 4
- active["blizz"] = true
- update()
- end
- elseif cmd == "blizz off" then
- if active["blizz"] == true then
- int = int - 4
- active["blizz"] = false
- update()
- end
- end
- end
Add Comment
Please, Sign In to add comment