Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local run = true
- local slot = 1
- local ertek = 0
- local circle = 0
- local vege = 0
- function slotsel()
- turtle.select(slot)
- if turtle.getItemCount(slot) < 1 then
- slot = slot + 1
- turtle.select(slot)
- if slot == 9 and turtle.getItemCount(slot) < 1 then
- run = false
- slot = 1
- end
- end
- end
- function dig()
- if turtle.getItemCount(9) > 0 then
- turtle.placeDown()
- turtle.forward()
- elseif turtle.getItemCount(9) < 1 then
- print("nincs cucc az inventorymban")
- local event, key = os.pullEvent("key")
- end
- end
- function input()
- if ertek == 0 then
- print("mennyit menjek elore")
- ertek = read()
- ertek = ertek + 0
- end
- if circle == 0 then
- print("hany korben?")
- circle = read()
- circle = circle + 0
- vege = circle
- end
- end
- function main()
- for i = 1, ertek do
- slotsel()
- dig()
- if i == ertek then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- end
- end
- for j = 1, ertek do
- slotsel()
- dig()
- if j == ertek then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- vege = vege - 1
- if vege == 0 then
- run = false
- end
- end
- end
- end
- while run do
- input()
- main()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement