Advertisement
dlord

/mobfarm/turtles

Apr 4th, 2014
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. local input="bottom"
  2. local attackInterval=1
  3.  
  4. function doAttack()
  5.     print("Switching to Attack Mode")
  6.  
  7.     while(rs.getInput(input)) do
  8.         turtle.attack(attackInterval)
  9.         sleep(attackInterval)
  10.     end
  11.  
  12.     print("Switching to Passive Mode")
  13. end
  14.  
  15. while(true) do
  16.     if(rs.getInput(input)) then
  17.         doAttack()
  18.     end
  19.  
  20.     os.pullEvent("redstone")
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement