NicolaosGreene

Untitled

Dec 18th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. local bEnd = false;
  2.  
  3. print( "press <SPACE> to stop attacking." )
  4.  
  5. parallel.waitForAny(
  6. function()
  7. while not bEnd do
  8. local event, key = os.pullEvent("key");
  9. if key ~= 1 then
  10. bEnd = true;
  11. print("Aborting...");
  12. end
  13. end
  14. end,
  15. function()
  16. while not bEnd do
  17. turtle.attack()
  18. sleep(0.25)
  19. end
  20. end
  21. )
Advertisement
Add Comment
Please, Sign In to add comment