Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("left")
- for i = 1, 16 do -- loop through the slots
- turtle.select(i) -- change to the slot
- if turtle.refuel(0) then -- if it's valid fuel
- local halfStack = math.ceil(turtle.getItemCount(i)/2) -- work out half of the amount of fuel in the slot
- turtle.refuel(halfStack) -- consume half the stack as fuel
- end
- end
- print("This turtle is under my control!")
- while true do
- id, msg = rednet.receive()
- if msg == "w" then
- turtle.forward()
- end
- if msg == "a" then
- turtle.turnLeft()
- end
- if msg == "s" then
- turtle.back()
- end
- if msg == "d" then
- turtle.turnRight()
- end
- if msg == "e" then
- turtle.up()
- end
- if msg == "q" then
- turtle.down()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement