Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- print("Enter Turtle ID: ")
- ID = read() + 0
- while true do
- local event, key, isHeld = os.pullEvent("key")
- action = keys.getName(key)
- if action == "w" then
- rednet.send(ID, "forward")
- elseif action == "s" then
- rednet.send(ID, "back")
- elseif action == "a" then
- rednet.send(ID, "left")
- elseif action == "d" then
- rednet.send(ID, "right")
- elseif action == "space" then
- rednet.send(ID, "up")
- elseif action == "leftShift" then
- rednet.send(ID, "down")
- elseif action == "e" then
- rednet.send(ID, "mine")
- elseif action == "w" and isHeld == true then
- rednet.send(ID, "keepForward")
- elseif action == "space" and isHeld == true then
- rednet.send(ID, "keepUp")
- elseif action == "leftShift" and isHeld == true then
- rednet.send(ID, "keepDown")
- elseif action == "r" then
- rednet.send(ID, "mineUp")
- elseif action == "f" then
- rednet.send(ID, "mineDown")
- elseif action == "q" then
- rednet.send(ID, "attack")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement