Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Bitte stehle diesen Code nicht!
- -- Do not steal this scripts!
- -- #####################
- -- # MineOS - v1.2 #
- -- # by Mortimore #
- -- #####################
- function Kiste(s)
- for i=1,s do
- turtle.select(i)
- turtle.drop()
- end
- end
- function Dig()
- turtle.select(1)
- turtle.dig()
- if turtle.detect()==true then
- while turtle.detect()==true do
- turtle.dig()
- db = db + 1
- term.setCursorPos(1,6)
- term.clearLine()
- print("Bloecke abgebaut:" .. db)
- sleep(0.5)
- end
- end
- end
- function DigUp()
- turtle.select(1)
- turtle.digUp()
- if turtle.detectUp()==true then
- while turtle.detectUp()==true do
- turtle.digUp()
- term.setCursorPos(1,6)
- term.clearLine()
- print("Bloecke abgebaut:" .. db)
- sleep(0.5)
- end
- end
- end
- function Place()
- for n=1,14 do
- if turtle.getItemCount(n) > 0 then
- turtle.select(n)
- while turtle.detect()==false and turtle.getItemCount(n) > 0 do
- turtle.place()
- sleep(0.5)
- end
- end
- end
- end
- function PlaceUp()
- for n=1,14 do
- if turtle.getItemCount(n) > 0 then
- turtle.select(n)
- turtle.placeUp()
- end
- end
- end
- function PlaceDown()
- if turtle.detectDown()==false then
- for n=1,14 do
- if turtle.getItemCount(n) > 0 then
- turtle.select(n)
- tester = 0
- while turtle.detectDown()==false and turtle.getItemCount(n) > 0 and tester == 1 do
- if turtle.placeDown()==false then
- tester = 1
- end
- sleep(0.5)
- end
- end
- end
- end
- end
- function Vor()
- while turtle.forward()==false do
- Dig()
- turtle.attack()
- end
- PlaceDown()
- end
- function Turn()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function Back()
- if turtle.back()==false then
- Turn()
- Vor()
- Turn()
- end
- end
- function Forward()
- Dig()
- Vor()
- DigUp()
- end
- function Fackel()
- if turtle.getItemCount(15) > 0 then
- fg = fg + 1
- term.setCursorPos(1,7)
- term.clearLine()
- print("Fackeln gesetzt:" .. fg)
- turtle.select(15)
- turtle.placeUp()
- sleep(0.5)
- if turtle.detectUp()==false then
- turtle.up()
- turtle.turnLeft()
- Place()
- turtle.turnRight()
- Place()
- Dig()
- turtle.turnRight()
- Place()
- turtle.turnRight()
- Place()
- Dig()
- PlaceUp()
- turtle.down()
- turtle.select(16)
- turtle.placeUp()
- Turn()
- end
- elseif turtle.getItemCount(16) > 0 then
- fg = fg + 1
- term.setCursorPos(1,7)
- term.clearLine()
- print("Fackeln gesetzt:" .. fg)
- turtle.select(16)
- turtle.placeUp()
- sleep(0.5)
- if turtle.detectUp()==false then
- turtle.up()
- turtle.turnLeft()
- Place()
- turtle.turnRight()
- Place()
- Dig()
- turtle.turnRight()
- Place()
- turtle.turnRight()
- PlaceUp()
- turtle.down()
- turtle.select(16)
- turtle.placeUp()
- Turn()
- end
- end
- end
- function Seitengang(l)
- for i=1,l * 5 do
- Forward()
- end
- Turn()
- for i=1,l do
- Fackel()
- for j=1,5 do
- Vor()
- end
- end
- end
- fg = 0
- f = 0
- db = 0
- ganganzahl = 0
- ganglaenge = 0
- c = 0
- a = 0
- b = 0
- kiste = 0
- j = 0
- et = 0
- shell.run("clear")
- textutils.slowPrint("MineOs - v1.2")
- textutils.slowPrint("- von Mortimore -")
- sleep(1.5)
- shell.run("clear")
- print("MineOS-1.2 - Gangoptionen 1/4")
- print("=======================================")
- write("Anzahl der Gaenge: ")
- ganganzahl = tonumber(read())
- write("Laenge eines Gangs (x5): ")
- ganglaenge = tonumber(read())
- print("=======================================")
- e = ""
- while e == "" or e == "r" do
- shell.run("clear")
- print("MineOS-1.2 - Kraftstoffverwaltung 2/4")
- print("=======================================")
- print("Kraftstoff: " .. turtle.getFuelLevel())
- if (turtle.getFuelLevel() < 15 * ganglaenge * ganganzahl) then
- print("!Kraftstoff-Level-Warnung!")
- end
- zs = 0
- for i=1,16 do
- zs = turtle.getItemCount(i) + zs
- end
- print("!Auffuellung um " .. zs .. " Einheiten!")
- print("")
- print("Druecke 'Enter' zum aktuallisieren!")
- print("Schreibe 'r' zum auffuellen!")
- print("Schreibe etwas anderes zum fortfahren!")
- write("> ")
- e = read()
- if e == "r" then
- for i=1,16 do
- turtle.select(i)
- turtle.refuel(64)
- end
- end
- end
- e = ""
- while e == "" or e == "s" do
- shell.run("clear")
- print("MineOS-1.2 - Ausruestung 3/4")
- print("=======================================")
- print("EINE Truhe in Feld 14!")
- print("Fackeln in Feld 15+16!")
- print("=======================================")
- f = turtle.getItemCount(15) + turtle.getItemCount(16)
- print("Fackeln: " .. f)
- write("Truhe: ")
- if turtle.getItemCount(14) == 1 then
- if et == 1 then
- print("Endertruhe")
- else
- print("Ja")
- end
- else
- print("Nein")
- end
- print("")
- print("Druecke 'Enter' zum aktuallisieren!")
- print("Schreibe 's' um die Truhe umzustellen!")
- print("Schreibe etwas, um fortzufahren!")
- write("> ")
- e = read()
- if e == "s" then
- if et == 0 then
- et = 1
- elseif et == 1 then
- et = 0
- end
- end
- end
- shell.run("clear")
- print("MineOS-1.2 - Uebersicht 4/4")
- print("=======================================")
- print("Ganglaenge: " .. ganglaenge * 5)
- print("Ganganzahl: " .. ganganzahl)
- vg = ganganzahl - a
- print("Verbleibende Gaenge: " .. vg)
- if (turtle.getItemCount(14) == 1) then
- if et == 0 then
- turtle.turnLeft()
- Dig()
- Vor()
- DigUp()
- Back()
- turtle.select(14)
- turtle.place()
- turtle.turnRight()
- end
- kiste = 1
- end
- for j=0,ganganzahl - 1 do
- a = a + 1
- for k=1,3 do
- Forward()
- if kiste == 1 then
- c = c + 1
- end
- end
- turtle.turnLeft()
- Seitengang(ganglaenge)
- Seitengang(ganglaenge)
- turtle.turnRight()
- vg = ganganzahl - a
- term.setCursorPos(1,5)
- term.clearLine()
- print("Verbleibende Gaenge: " .. vg)
- if a ~= ganganzahl then
- if c == 6 and et == 0 then
- for k=0,j * 3 + 2 do
- Back()
- end
- turtle.turnLeft()
- Kiste(14)
- turtle.turnRight()
- for k=0,j * 3 + 2 do
- Vor()
- end
- c = 0
- elseif c == 6 and et == 1 then
- Dig()
- turtle.select(14)
- turtle.place()
- Kiste(13)
- turtle.select(14)
- turtle.dig()
- end
- end
- if a == ganganzahl then
- for k=0,a * 3 do
- Back()
- end
- DigUp()
- turtle.turnLeft()
- Dig()
- Vor()
- DigUp()
- Fackel()
- turtle.turnRight()
- if kiste == 1 then
- if et == 0 then
- Kiste(16)
- elseif et == 1 then
- Dig()
- turtle.select(14)
- turtle.place()
- Kiste(16)
- turtle.select(14)
- turtle.dig()
- end
- end
- turtle.turnRight()
- print("")
- print("!Fertig!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment