Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args={...}
- narg=#args
- local input
- local input
- local wallp
- local sidep
- local sentb
- local sentt
- if(narg< 5 ) then
- if fs.exists("sentsetup") then
- local f=fs.open("sentsetup","r");
- input =f.readLine()
- wallp =f.readLine()
- sidep =f.readLine()
- sentb=f.readLine()
- sentt=f.readLine()
- f.close()
- else
- print("sentry <input> <wall pist> <side pist> <sent bot> <sent top>")
- error()
- end
- else
- local f=fs.open("sentsetup","w");
- for i=1,5 do f.writeLine(args[i]) end
- f.close()
- input =args[1];
- wallp =args[2]
- sidep =args[3]
- sentb=args[4]
- sentt=args[5]
- end
- redstone.setOutput(wallp,true);
- redstone.setOutput(sidep,true);
- while true do
- --os.pullEvent("redstone")
- if redstone.getInput(input) then
- redstone.setOutput(wallp,false);
- sleep(0.3)
- redstone.setOutput(sidep,false);
- sleep(0.3)
- redstone.setOutput(sentb,true);
- sleep(0.3)
- redstone.setOutput(sentt,true);
- else
- redstone.setOutput(sentt,false);
- sleep(0.3)
- redstone.setOutput(sentb,false);
- sleep(0.3)
- redstone.setOutput(sidep,true);
- sleep(0.3)
- redstone.setOutput(wallp,true);
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment