Advertisement
Niseg

pulser

Apr 12th, 2013
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. args = {...}
  2. local i;
  3. local f;
  4. local pulser_set={}
  5. if #args==0 then
  6.  
  7. if not fs.exists("pulsersetting") then print("enter sides to light up in arg");exit(1); end
  8. f=fs.open("pulsersetting","r")
  9. pulser_set= textutils.unserialize(f.readAll())
  10. f.close()
  11. else
  12. pulser_set[1]=#args
  13. for i=1, pulser_set[1] do
  14. pulser_set[i+1]=args[i]
  15.  
  16. end
  17. end
  18. f=fs.open("pulsersetting","w")
  19. f.write(textutils.serialize(pulser_set))
  20. f.close()
  21.  
  22. while true do
  23. for i=1, pulser_set[1] do
  24. redstone.setOutput(pulser_set[i+1],true);
  25. end
  26. sleep(0.1)
  27. for i=1, pulser_set[1] do
  28. redstone.setOutput(pulser_set[i+1],false);
  29. end
  30. sleep(0.400)
  31.  
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement