Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function switch()
- repeat
- redstone.setOutput("left", true)
- redstone.setOutput("right", true)
- redstone.setOutput("top", true)
- sleep(1)
- redstone.setOutput("left", false)
- redstone.setOutput("right", false)
- redstone.setOutput("top", false)
- sleep(10)
- until redstone.getInput("back")
- end
- function checkPower(value)
- power = redstone.getAnalogInput("back")
- if value == "full" then
- return power == 15
- elseif value == "empty" then
- return power == 0
- end
- end
- while true do
- if checkPower(arg[1]) then
- print("Switching Power Cell")
- switch()
- else
- print("Not switching")
- end
- os.pullEvent("redstone")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement