Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local wi = peripheral.find("WorldInterface")
- local block
- local function isGlass(x,y,z)
- block = wi.getBlockInfos(x,y,z)
- return block.blockName=="minecraft:glass"
- or block.blockName=="minecraft:stained_glass"
- end
- local function isBroken(o)
- if o[1]==o[2] and o[1]==o[3] then
- return false
- else
- return true
- end
- end
- local function valid(a,b)
- return a[1] ~= b[1]
- end
- --verif gates
- --Trieur fermé -586 23~25 121
- --local trieur_close = {
- -- isGlass(-586,23,121),
- -- isGlass(-586,24,121),
- -- isGlass(-586,25,121),
- --}
- --Trieur ouvert -587 23~25 121
- local trieur_open = {
- isGlass(-587,23,121),
- isGlass(-587,24,121),
- isGlass(-587,25,121),
- }
- --Tueur fermé -586 23~25 123
- --local tueur_close = {
- -- isGlass(-586,23,123),
- -- isGlass(-586,24,123),
- -- isGlass(-586,25,123),
- --}
- --Tueur ouvert -587 23~25 123
- local tueur_open = {
- isGlass(-587,23,123),
- isGlass(-587,24,123),
- isGlass(-587,25,123),
- }
- if isBroken(tueur_open)
- or isBroken(trieur_open)
- or not valid(trieur_open,tueur_open)
- then
- rs.setOutput("top",true)
- sleep(.3)
- rs.setOutput("top",false)
- sleep(.3)
- end
Add Comment
Please, Sign In to add comment