DrFair

Untitled

Mar 22nd, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. Args = {...}
  2. wr = peripheral.wrap("right")
  3.  
  4. function pulse(freq,num)
  5. wr.setFreq(freq)
  6. for i=1,num do
  7. redstone.setOutput("right",true)
  8. os.sleep(0.8)
  9. redstone.setOutput("right",false)
  10. os.sleep(1)
  11. end
  12. end
  13.  
  14. if Args[1] == "for" or Args[1] == "forward" then
  15. pulse(1337,tonumber(Args[2]))
  16. elseif Args[1] == "left" then
  17. pulse(1338,tonumber(Args[2]))
  18. elseif Args[1] == "back" or Args[1] == "backwards" then
  19. pulse(1339,tonumber(Args[2]))
  20. elseif Args[1] == "right" then
  21. pulse(1340,tonumber(Args[2]))
  22. end
Advertisement
Add Comment
Please, Sign In to add comment