Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Program pro farmici zelvu pro farmareni
- --Verze programu beta 1.0.6
- --vytvoril SVty
- --www.youtube.com/SVtyPlay
- --www.pastebin.com/u/SVty
- --*****************************
- term.clear()
- term.setCursorPos(1,1)
- print("Tento program slouzi pro farmareni")
- print("----------------------------------")
- print("Osivo rozlozte do slotu jedna az ctyri (bude slouzit i jako predloha)")
- print("Do 16. slotu vlozte palivo. Bude samovolne odebirano dle potreby")
- print("----------------------------------")
- print("Napiste delku farmy:")
- delka = (read())
- print("Zadejte sirku farmy:")
- sir = (read())
- sir = sir /2
- sir = math.floor(sir)
- sem = true
- slot = 1
- rada = 0
- d = 1
- zp = 0
- sleep(1)
- --Graphical User Interface
- term.clear()
- term.setCursorPos(1,1)
- print("Program pro farmareni")
- term.setCursorPos(1,2)
- print("----------------------------------")
- term.setCursorPos(1,3)
- print("Delka farmy je "..delka.. " kostek")
- term.setCursorPos(1,4)
- print("Sirka farmy je "..(sir * 2).." kostek")
- term.setCursorPos(27,3)
- print("Plocha:")
- term.setCursorPos(27,4)
- print(delka * (sir * 2).." kostek")
- term.setCursorPos(1,5)
- print("----------------------------------")
- term.setCursorPos(1,6)
- print("Stav paliva:")
- print("Dokonceno rad:")
- term.setCursorPos(17,6)
- print(tostring(turtle.getFuelLevel()))
- term.setCursorPos(17,7)
- print("0 / "..(sir * 2))
- --konec Graphical User Interface
- function palivo()
- if (turtle.getFuelLevel()) < 10 then
- turtle.select(16)
- while not turtle.refuel(1) do
- sleep(1)
- term.setCursorPos(1,10)
- print(" ")
- term.setCursorPos(1,10)
- print("Vlozte palivo")
- end
- turtle.select(slot)
- term.setCursorPos(1,10)
- print(" ")
- term.setCursorPos(1,10)
- print("Doplnuji palivo")
- end
- end
- function move()
- while not turtle.forward() do
- sleep(1)
- term.setCursorPos(1,11)
- print("Uvolnete cestu!")
- end
- term.setCursorPos(1,11)
- print(" ")
- end
- function left()
- if zp < sir then
- turtle.turnLeft()
- turtle.dig()
- move()
- turtle.turnLeft()
- turtle.dig()
- move()
- end
- end
- function right()
- turtle.turnRight()
- turtle.dig()
- move()
- turtle.turnRight()
- turtle.dig()
- move()
- end
- function drop()
- if turtle.detect() then
- for sd=5,15 do
- turtle.select(sd)
- turtle.drop()
- end
- end
- 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
- term.setCursorPos(1,8)
- print("Nedostatek osiva!")
- sem = false
- end
- turtle.select(slot)
- end
- else
- turtle.select(1)
- term.setCursorPos(1,9)
- print("Pouze okopavam")
- end
- turtle.dig()
- turtle.digDown()
- turtle.digDown()
- if turtle.getItemCount(slot) > 1 then
- turtle.placeDown()
- end
- palivo()
- move()
- term.setCursorPos(17,6)
- print(tostring(turtle.getFuelLevel()))
- end
- term.setCursorPos(17,7)
- print(rada.." / "..(sir * 2))
- end
- function retu()
- sir = sir *2
- turtle.turnRight()
- for c=1,(sir-1) do
- move()
- end
- turtle.turnLeft()
- drop()
- turtle.turnRight()
- turtle.turnRight()
- end
- --program
- palivo()
- if (turtle.detectDown()) then
- while not turtle.up() do
- sleep(1)
- term.setCursorPos(1,11)
- print("Uvolnete cestu!")
- end
- turtle.dig()
- move()
- else
- turtle.dig()
- move()
- end
- for d=1,sir do
- zp = zp + 1
- farm()
- right()
- farm()
- left()
- end
- retu()
- --konec program
- term.setCursorPos(1,10)
- print("----------------------------------")
- print("HOTOVO")
Advertisement
Add Comment
Please, Sign In to add comment