Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Setup and variables
- owner = "Bipedsnowman"
- redProxy = peripheral.find("redstoneIntegrator")
- chest = peripheral.find("enderchests:ender_chest.tile")
- crate = peripheral.find("botania:open_crate")
- detector = peripheral.find("environmentDetector")
- sleeptime = 0.2
- praises = {}
- praises["Rain!"] = "rain"
- praises["Sunny!"] = "sunny"
- praises["Thunder!"] = "thunder"
- items = {}
- items["rain"] = "minecraft:dark_prismarine"
- items["sunny"] = "minecraft:sunflower"
- items["thunder"] = "minecraft:fire_charge"
- --Functions
- function repeatMe()
- while true do
- event, username, message = os.pullEvent("chat")
- print(username .. " just wrote " .. message)
- praise(username, message)
- end
- end
- function setSkies(weather)
- slot, item = items[weather]
- chest.pushItems(peripheral.getName(crate), slot, 1)
- end
- function triggerSide(side)
- rs.setOutput(side, true)
- sleep(sleeptime)
- rs.setOutput(side, false)
- sleep(sleeptime)
- end
- function praise(username, message)
- if praises[message] ~= nil then
- print(username .. " sings your praises. Accepted.")
- setSkies(praises[message])
- end
- end
- --Program body
- if redProxy then
- print ("redstone proxy connected")
- end
- if detector then
- print ("environment detector connected")
- end
- if chest then
- print ("chest connected")
- end
- if crate then
- print ("crate connected")
- end
- repeatMe()
Advertisement
Add Comment
Please, Sign In to add comment