Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- while true do
- evnt = {os.pullEvent("rednet_message")}
- --[[for i = 1,#evnt do
- print(i..". "..evnt[i])
- end]]--
- args = {}
- for word in evnt[3]:gmatch("%w+") do
- table.insert(args,word)
- --print("Arg:"..word)
- end
- if #args == 1 then
- cmd = string.lower(args[1])
- if cmd == "up" then
- turtle.up()
- elseif cmd == "down" then
- turtle.down()
- elseif cmd == "left" then
- turtle.turnLeft()
- elseif cmd == "right" then
- turtle.turnRight()
- elseif cmd == "go" then
- turtle.forward()
- elseif cmd == "back" then
- turtle.back()
- end
- elseif #args == 2 then
- cmd = string.lower(args[1])
- action = " "
- if cmd == "up" then
- action = "turtle.up()"
- elseif cmd == "down" then
- action = "turtle.down()"
- elseif cmd == "left" then
- action = "turtle.turnLeft()"
- elseif cmd == "right" then
- action = "turtle.turnRight()"
- elseif cmd == "go" then
- action = "turtle.forward()"
- elseif cmd == "back" then
- action = "turtle.back()"
- end
- if action ~= " " then
- if tonumber(args[2]) then
- for n = 1,tonumber(args[2]) do
- loadstring(action)()
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment