Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- local place = 0
- local function moveTo()
- turtle.down()
- turtle.forward()
- end
- local function moveFrom()
- turtle.back()
- turtle.up()
- end
- local function check()
- while true do
- event, id, text = os.pullEvent()
- if event == "rednet_message" then
- if text == "KILL" then
- if place == 0 then
- moveTo()
- place = 1
- end
- else if text == "BACK OFF" then
- if place == 1 then
- moveFrom()
- place = 0
- end
- end
- end
- end
- end
- local function attack()
- while true do
- turtle.attack()
- end
- end
- parrallel.waitforAny(attack, check)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement