Advertisement
feldore

[CC] Simple Attack

Mar 24th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. -- Attack Turtles by: Feldore
  2. side = "left"
  3. rsOverride = true
  4. numDeposit = 2
  5. cycles = 16
  6.  
  7. count = 0
  8.  
  9. local function deposit()
  10.   local i = numDeposit
  11.   while i > 0 do
  12.     turtle.select(i)
  13.     turtle.drop()
  14.     i = i-1
  15.   end
  16. end
  17.  
  18. deposit()
  19.  
  20. while true do
  21.   signal = (rsOverride or rs.getInput(side))  
  22.  
  23.   if signal then  
  24.     if turtle.attack() then count = count + 1 end
  25.   end
  26.  
  27.   if count > cycles then
  28.     deposit()
  29.     count = 0
  30.   end
  31.    
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement