itssnowing

Untitled

Jul 22nd, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. --Setup and variables
  2. owner = "Bipedsnowman"
  3. redProxy = peripheral.find("redstoneIntegrator")
  4. chest = peripheral.find("enderchests:ender_chest.tile")
  5. crate = peripheral.find("botania:open_crate")
  6. detector = peripheral.find("environmentDetector")
  7.  
  8. sleeptime = 0.2
  9.  
  10. praises = {}
  11. praises["Rain!"] = "rain"
  12. praises["Sunny!"] = "sunny"
  13. praises["Thunder!"] = "thunder"
  14.  
  15. items = {}
  16. items["rain"] = "minecraft:dark_prismarine"
  17. items["sunny"] = "minecraft:sunflower"
  18. items["thunder"] = "minecraft:fire_charge"
  19.  
  20. for slot, item in pairs(chest.list()) do
  21. print(("%d x %s in slot %d"):format(item.count, item.name, slot))
  22. end
  23.  
  24.  
  25. --Functions
  26. function repeatMe()
  27. while true do
  28. event, username, message = os.pullEvent("chat")
  29. print(username .. " just wrote " .. message)
  30. praise(username, message)
  31.  
  32. end
  33. end
  34. function setSkies(weather)
  35. slot, item = items[weather]
  36. chest.pushItems(crate, slot, 1)
  37. end
  38.  
  39. function triggerSide(side)
  40. rs.setOutput(side, true)
  41. sleep(sleeptime)
  42. rs.setOutput(side, false)
  43. sleep(sleeptime)
  44. end
  45.  
  46. function praise(username, message)
  47. if praises[message] ~= nil then
  48. print(username .. " sings your praises. Accepted.")
  49. setSkies(praises[message])
  50. end
  51. end
  52.  
  53. --Program body
  54. if redProxy then
  55. print ("redstone proxy connected")
  56. end
  57. if detector then
  58. print ("environment detector connected")
  59. end
  60. if chest then
  61. print ("chest connected")
  62. end
  63. if crate then
  64. print ("crate connected")
  65. end
  66. repeatMe()
Advertisement
Add Comment
Please, Sign In to add comment