itssnowing

Untitled

Jul 22nd, 2021
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. --Setup and variables
  2. owner = "Bipedsnowman"
  3. redProxy = peripheral.find("redstoneIntegrator")
  4. rainside="left"
  5. clearside="right"
  6. thunderside="back"
  7. sleeptime = 0.2
  8.  
  9.  
  10.  
  11. --Functions
  12. function repeatMe()
  13. while true do
  14. event, username, message = os.pullEvent("chat")
  15. print(username .. " just wrote " .. message)
  16. if username == owner and message == "rain" then
  17. callRain()
  18. callRain()
  19. end
  20. end
  21. end
  22.  
  23. function callRain()
  24. redProxy.setOutput(rainside, true)
  25. sleep(sleeptime)
  26. redProxy.setOutput(rainside, false)
  27. end
  28.  
  29. function callClear()
  30. redProxy.setOutput(clearside, true)
  31. sleep(sleeptime)
  32. redProxy.setOutput(clearside, false)
  33. end
  34.  
  35. function callThunder()
  36. redProxy.setOutput(thunderside, true)
  37. sleep(sleeptime)
  38. redProxy.setOutput(thunderside, false)
  39. end
  40.  
  41. --Program body
  42. if redProxy then
  43. print ("redstone proxy connected")
  44. end
  45. repeatMe()
Advertisement
Add Comment
Please, Sign In to add comment