Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- x,y = term.getSize()
- -- screen display
- term.setCursorPos(3, y/3-1)
- print("Q")
- term.setCursorPos(x/2, y/3-1)
- print("W")
- term.setCursorPos(x-3, y/3-1)
- print("E")
- term.setCursorPos(1, y/3)
- print("Quit")
- term.setCursorPos(x/2-3, y/3)
- print("Forward")
- term.setCursorPos(x-5, y/3)
- print("place")
- term.setCursorPos(x/5, y/3*2)
- print("A")
- term.setCursorPos(x/2, y/3*2)
- print("S")
- term.setCursorPos(x/5*4, y/3*2)
- print("D")
- term.setCursorPos(x/5-2, y/3*2+1)
- print("Left")
- term.setCursorPos(x/2-2, y/3*2+1)
- print("Back")
- term.setCursorPos(x/5*4-2, y/3*2+1)
- print("Right")
- term.setCursorPos(1, y-3)
- print("[Shift]")
- term.setCursorPos(3,y-2)
- print("Up")
- term.setCursorPos(1, y-1)
- print("[Ctrl]")
- term.setCursorPos(x/2-3, y-1)
- print("[Space]")
- term.setCursorPos(x-8, y-1)
- print("[<-] [->]")
- term.setCursorPos(2, y)
- print("Down")
- term.setCursorPos(x/2-1, y-1)
- print("Dig")
- term.setCursorPos(x-6, y-1)
- print("Slot")
- --select slot 1 by default
- turtle.select(1)
- slot = 1
- --button selection
- while true do
- event, p1 = os.pullEvent()
- if p1 == "a" then
- turtle.turnLeft()
- elseif p1 == "s" then
- turtle.back()
- elseif p1 == "d" then
- turtle.turnRight()
- elseif p1 == "w" then
- turtle.forward()
- elseif p1 == 42 then
- turtle.up()
- elseif p1 == 29 then
- turtle.down()
- elseif p1 == 57 then
- turtle.dig() -- change to turtle.attack() for melee turtle
- elseif p1 == "q" then
- term.clear()
- term.setCursorPos(1,1)
- break
- elseif p1 == "e" then
- turtle.place()
- elseif p1 == 205 then
- slot = slot+1
- if slot > 16 then
- slot = 1
- turtle.select(slot)
- else
- turtle.select(slot)
- end
- elseif p1 == 203 then
- slot = slot - 1
- if slot < 1 then
- slot = 16
- turtle.select(slot)
- else
- turtle.select(slot)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement