Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- codes couleurs --
- white=1
- orange=2
- magenta=4
- lightBlue=8
- yellow=16
- lime=32
- pink=64
- gray=128
- lightGray=256
- cyan=512
- purple=1024
- blue=2048
- brown=4096
- green=8192
- red=16384
- black=32768
- blank=0
- -- état des sorties redstone et statut des portes --
- Sortie=0
- etat=fermer
- -- function --
- function fermeture()
- print("Fermeture en cours")
- for i = 1,6 do
- redstone.setBundledOutput("bottom", red)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- end
- print("Fermer")
- end
- function ouverture()
- print("Ouverture en cours")
- for i = 1,6 do
- redstone.setBundledOutput("bottom", white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- end
- print("Ouvert")
- end
- fermeture()
- etat = 0
- while true do
- event = os.pullEvent()
- if colors.test (redstone.getBundledInput("top"), colors.white) and etat==1 then
- fermeture()
- etat = 0
- sleep(2)
- end
- if colors.test (redstone.getBundledInput("top"), colors.white) and etat==0 then
- ouverture()
- etat = 1
- sleep(2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement