Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function centerText(text)
- local x,y = term.getSize()
- local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- print(text)
- end
- while true do
- term.clear()
- centerText("Direction (wasd):")
- direction = read()
- if direction == "d" then
- centerText("Ready")
- rednet.send(698,"on")
- os.sleep(120)
- rednet.send(696,"off")
- elseif direction == "w" then
- centerText("Ready")
- os.sleep(120)
- elseif direction == "a"
- rednet.send(699,"on")
- rednet.send(700,"on")
- centerText("Ready")
- os.sleep(120)
- rednet.send(699,"off")
- rednet.send(700,"off")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment