Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Setup and variables
- owner = "Bipedsnowman"
- redProxy = peripheral.find("redstoneIntegrator")
- rainside="left"
- clearside="right"
- thunderside="back"
- sleeptime = 0.2
- --Functions
- function repeatMe()
- while true do
- event, username, message = os.pullEvent("chat")
- print(username .. " just wrote " .. message)
- if username == owner and message == "rain" then
- callRain()
- callRain()
- end
- end
- end
- function callWeather(weather)
- if weather == "rain" then
- triggerSide(rainside)
- else if weather == "clear" then
- triggerSide(clearside)
- else if weather == "thunder" then
- triggerside(thunderside)
- end
- end
- function triggerSide(side)
- redProxy.setOutput(side, true)
- sleep(sleeptime)
- redProxy.setOutput(side, false)
- end
- --Program body
- if redProxy then
- print ("redstone proxy connected")
- end
- repeatMe()
Advertisement
Add Comment
Please, Sign In to add comment