Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Program pro farmici zelvu pro farmareni
- --Verze programu beta 0.9.6
- --vytvoril SVty
- --*****************************
- term.clear()
- term.setCursorPos(1,1)
- print("Tento program slouzi pro farmareni")
- print("Osivo rozlozte do slotu jedna az ctyri")
- print("--------------------")
- print("Napiste delku farmy:")
- delka = (read())
- print("Delka farmy je "..delka.. " kostek")
- print("Zadejte sirku farmy:")
- sir = (read())
- print("Sirka farmy je "..sir.." kostek")
- sir = sir /2
- sem = true
- slot = 1
- rada = 0
- sleep(1)
- function palivo()
- if (turtle.getFuelLevel()) < 20 then
- turtle.select(16)
- turtle.refuel(1)
- turtle.select(slot)
- print("Doplnuji palivo")
- end
- end
- palivo()
- if (turtle.detectDown()) then
- turtle.up()
- turtle.dig()
- turtle.forward()
- else
- turtle.dig()
- turtle.forward()
- end
- function left()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- end
- function right()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- end
- function farm()
- rada = rada + 1
- turtle.select(slot)
- for i=1,delka do
- if sem == true then
- if turtle.getItemCount(slot) == 1 then
- slot = slot + 1
- if slot == 5 then
- slot = 1
- print("Nedostatek osiva!")
- sem = false
- end
- turtle.select(slot)
- end
- else
- turtle.select(1)
- print("Pouze okopavam")
- end
- turtle.dig()
- turtle.digDown()
- turtle.digDown()
- if turtle.getItemCount(slot) > 1 then
- turtle.placeDown()
- end
- palivo()
- turtle.forward()
- end
- print(rada)
- end
- function retu()
- sir = sir *2
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- for c=1,sir do
- turtle.forward()
- end
- turtle.turnRight()
- end
- --program
- for d=1,sir do
- farm()
- right()
- farm()
- left()
- end
- --program
- retu()
- print("HOTOVO")
Advertisement
Add Comment
Please, Sign In to add comment