Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Main()
- function Main()
- x = turtle.getFuelLevel()
- y = turtle.getItemCount(2)
- z = turtle.getItemCount(3)
- function turnAround()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function restart()
- Main()
- end
- print "Booting"
- sleep(2)
- print " "
- if x < 16
- then
- turtle.select(1)
- turtle.turnLeft(1)
- turtle.suck(1)
- turtle.refuel(1)
- turtle.turnRight(1)
- else
- print "Full"
- end
- if x < 16
- then
- print "Empty"
- print "Please Refill"
- print "Stopping"
- sleep(5)
- print "Restartng..."
- restart()
- else
- print " "
- end
- if y ~= 3
- then
- turtle.select(2)
- turnAround()
- turtle.suck(3-y)
- turnAround()
- else
- print "Full"
- end
- if turtle.getItemCount(2) ~= 3
- then
- print "Empty"
- print "Please Refill"
- print "Stopping"
- sleep(5)
- print "Restarting..."
- restart()
- else
- print " "
- end
- if z ~= 4
- then
- turtle.select(3)
- turtle.turnRight()
- turtle.suck(4-z)
- turtle.turnLeft()
- else
- print "Full"
- end
- if turtle.getItemCount(3) ~= 4
- then
- print "Empty"
- print "Please Refill"
- print "Stopping"
- sleep(5)
- print "Restarting..."
- restart()
- else
- print " "
- end
- print "Calculating Supply Count"
- sleep(2.5)
- print " "
- if x < 16 and y = 3 and z = 4
- then
- Print "Ready"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement