Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --rc_sou01
- --Local
- local id = XXX
- local left_msg = "strafe_left"
- local right_msg = "strafe_right"
- local forward_msg = "go_forward"
- local back_msg = "go_back"
- mon = peripheral.wrap("top")
- --Function
- function init()
- term.clear()
- term.setCursorPos(1,1)
- print(" w ")
- print("a d")
- print(" s ")
- end
- --Wileress Position
- --left or right or top
- rednet.open("xxx")
- while true do
- init()
- local event,moji = os.pullEvent("char")
- print("OK")
- if moji == "w" then
- rednet.send(id,forward_msg)
- elseif moji == "a" then
- rednet.send(id,left_msg)
- elseif moji == "s" then
- rednet.send(id,back_msg)
- elseif moji == "d" then
- rednet.send(id,right_msg)
- else
- print("NG")
- end
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement