-- 送信
local args = {...}
local id = tonumber(args[1])
rednet.open("back")
local table = {
w = "turtle.forward()",
a = "turtle.turnLeft() turtle.forward() turtle.turnRight()",
d = "turtle.turnRight() turtle.forward() turtle.turnLeft()",
space = "turtle.up()",
leftShift = "turtle.down()",
right = "turtle.turnRight()",
left = "turtle.turnLeft()"
}
print("Press 'q' to terminate")
while true do
local event, scancode = os.pullEvent("key")
local key = keys.getName(scancode)
if key == "q" then
break
end
local message = table[key]
print(key, "=>" , message or "none")
if message then
rednet.send(id, message)
end
end
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme