Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --temps de repos (s)
- rest=3600
- --temps d'arrosage par champ (s)
- watering=300
- --connection side
- side="top"
- local fields = {} --fields colors config
- table.insert(fields, colors.orange) --NO
- table.insert(fields, colors.magenta) --N
- table.insert(fields, colors.lightBlue) --NE
- table.insert(fields, colors.yellow) --O
- table.insert(fields, colors.lime) --center
- table.insert(fields, colors.pink) --E
- table.insert(fields, colors.gray) --SO
- table.insert(fields, colors.lightGray) --S
- table.insert(fields, colors.cyan) --SE
- -----------------------------------------------------------
- function fertilize(field)
- print("Watering "..field)
- add(side,field)
- sleep(watering)
- rem(side,field)
- return get(side)
- end
- function get(side)
- return redstone.getBundledOutput(side)
- end
- function set(side, value)
- return redstone.setBundledOutput(side, value)
- end
- function test(side, color)
- return colors.test(get(side), color)
- end
- function add(side, color)
- return set(side, colors.combine(get(side), color))
- end
- function rem(side, color)
- return set(side, colors.subtract(get(side), color))
- end
- -----------------------------------------------------------
- while true do
- print("Regulating watering cans for "..#fields.." fields")
- print("Connected side to rednet cable : "..side)
- print("Sleep Time : "..rest.." seconds")
- print("Watering Time /per field : "..watering.." seconds")
- for i=1,#fields do
- fertilize(fields[i])
- end
- print("Sleeping for"..rest.." seconds.")
- sleep(rest)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement