Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local call
- local button = 0
- print("W,A,S,D,Q,E - control. R - refuel. Z - DigDown. X - Dig. C - DigUp. F = exit")
- while true do
- while call ~= "char" do
- call, button = os.pullEvent()
- end
- if button == 'w' then
- turtle.forward()
- end
- if button == 's' then
- turtle.back()
- end
- if button == 'a' then
- turtle.turnLeft()
- end
- if button == 'd' then
- turtle.turnRight()
- end
- if button == 'q' then
- turtle.down()
- end
- if button == 'e' then
- turtle.up()
- end
- if button == 'f' then
- return 0
- end
- if button == 'r' then
- turtle.refuel()
- end
- if button == 'z' then
- turtle.digDown()
- end
- if button == 'x' then
- turtle.dig()
- end
- if button == 'c' then
- turtle.digUp()
- end
- call = ""
- button = 0
- end
Add Comment
Please, Sign In to add comment