Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Global variables
- x = turtle.getItemCount(1)
- -- Global variables^
- -- Main function
- function enterShop()
- turtle.down()
- turtle.down()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.up()
- turtle.up()
- end
- function getBack()
- turtle.down()
- turtle.down()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.up()
- turtle.up()
- end
- function beNice()
- turtle.drop(1)
- end
- function getSnack()
- turtle.turnLeft()
- turtle.suck()
- turtle.drop(turtle.getItemCount(1) - 1)
- turtle.turnRight()
- end
- function listen()
- while true do
- if redstone.getInput("top") == true then
- go()
- else os.sleep(0.1)
- end
- end
- end
- function go()
- enterShop()
- os.sleep(2)
- beNice()
- getBack()
- getSnack()
- end
- -- Main function^
- -- Execute
- listen()
- -- Execute^
Advertisement
Add Comment
Please, Sign In to add comment