Advertisement
saljun

attack turtle

Apr 16th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. local run=true
  2. local attack = false
  3. peripheral.wrap("left")
  4. rednet.open("left")
  5. while run==true do
  6.     while attack == false do
  7.         local senderId, message, protocol = rednet.receive("start")
  8.         attack==true
  9.     end
  10.     while attack == true do
  11.         turtle.attack()
  12.         local senderId, message, protocol = rednet.receive("stop",1)
  13.         if message=="stop" then
  14.             attack==false
  15.         end
  16.    
  17.     end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement