Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function controls()
- print("Controls")
- print("W - forward; S - back; A - left; D - right;")
- print("E/R/T - dig/up/down;")
- print("C/V/B - place/up/down;")
- print("Shift - down; space - up;")
- print("Arrows - move slot;")
- print("G - gps")
- print("H - refuel")
- print("Fuel: ".. t.getFuelLevel())
- print("Slot: "..slot.."; in slot - "..t.getItemCount(slot).." items")
- end
- t=turtle
- slot=1
- t.select(slot)
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- controls()
- e, keycode = os.pullEvent("key")
- if keycode == 17 then t.forward()
- elseif keycode == 31 then t.back()
- elseif keycode == 42 then t.down()
- elseif keycode == 30 then t.turnLeft()
- elseif keycode == 32 then t.turnRight()
- elseif keycode == 57 then t.up()
- elseif keycode == 35 then t.refuel(64)
- elseif keycode == 203 then
- slot=slot-1
- if slot==0 then
- slot=1
- else
- end
- t.select(slot)
- elseif keycode == 205 then
- slot=slot+1
- if slot==17 then
- slot=16
- else
- end
- t.select(slot)
- elseif keycode == 200 then
- slot=slot-4
- if slot==0 or slot==-1 or slot==-2 or slot==-3 then
- slot=slot+4
- else
- end
- t.select(slot)
- elseif keycode == 208 then
- slot=slot+4
- if slot==20 or slot==17 or slot==18 or slot==19 then
- slot=slot-4
- else
- end
- t.select(slot)
- elseif keycode == 18 then t.dig()
- elseif keycode == 19 then t.digUp()
- elseif keycode == 20 then t.digDown()
- elseif keycode == 46 then t.place()
- elseif keycode == 47 then t.placeUp()
- elseif keycode == 48 then t.placeDown()
- elseif keycode == 16 then os.reboot()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment