Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("clear") -- Bildschirm leeren
- print("Wie breit soll der Raum sein:")
- breite = read()
- print("Wie tief soll der Raum sein:")
- tiefe = read()
- print("Wie hoch soll der Raum sein:")
- hoehe = read()
- shell.run("clear") -- Bildschirm leeren
- -- Variablen
- breite2 = breite / 2
- blockstotal = breite * tiefe * hoehe
- blockstobreak = blockstotal
- function forward()
- while(turtle.forward()==false) do
- turtle.dig()
- end
- blockstobreak = blockstobreak - 1
- startscreen()
- end
- function forward_odd()
- while(turtle.forward()==false) do
- turtle.dig()
- end
- startscreen()
- end
- function backhome()
- while(turtle.forward()==false) do
- turtle.dig()
- end
- startscreen()
- end
- function up()
- while(turtle.up()==false) do
- turtle.digUp()
- end
- end
- function linie()
- for x=1,tiefe - 1 do
- forward()
- end
- end
- function linie_odd()
- for x=1,tiefe - 1 do
- forward_odd()
- end
- end
- function turnright()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- end
- function turnleft()
- turtle.turnLeft()
- forward()
- turtle.turnLeft()
- end
- function turn()
- turtle.turnRight()
- turtle.turnRight()
- end
- --Anzeige Start
- function time()
- term.setCursorPos(23, 2) -- position auf Zeit setzten
- local day -- locale Variable fuer den Tag in Minecraft
- local zeit -- locale Variable fuer die Uhrzeit in Minecraft
- day = os.day() -- nicht im Gebrauch!
- zeit = textutils.formatTime(os.time(), true) -- wandelt die anzeige in das 24 Stunden Format
- if (string.len(zeit) == 4) then -- zeit Anzeigt vor oder nach 10 Uhr
- print("Zeit: " .. zeit) -- vor 10 Uhr, es geht um die laenge
- else
- print("Zeit: " .. zeit) -- nach 10 Uhr
- end
- end
- function startscreen()
- term.clear()
- term.setCursorPos( 1, 1)
- term.clearLine(1,1)
- fuellevel = turtle.getFuelLevel()
- print("Raum by")
- term.setCursorPos( 23, 1)
- print("Fuel-Level: " .. fuellevel)
- term.setCursorPos( 1, 2)
- print("xXExpchampXx")
- term.setCursorPos( 1, 3)
- print("=======================================")
- term.setCursorPos( 1, 5)
- print("---------------------------------------")
- term.setCursorPos( 1, 6)
- print("Row "..countbreite .. " from "..breite.."finished")
- term.setCursorPos( 1, 7)
- print("Height "..akt_hoehe .. " from "..hoehe.." finished")
- term.setCursorPos( 1, 9)
- print("Blocks to break(Total): " .. blockstotal)
- term.setCursorPos( 1, 10)
- print("Blocks Remaining: " .. (blockstobreak - hoehe))
- term.setCursorPos( 1,11)
- print("---------------------------------------")
- term.setCursorPos( 1,12)
- time()
- end
- --Anzeige Ende
- for x=1,1 do
- local breite3 = breite + 0
- local breite4 = breite3 - 1
- local hoehe2 = hoehe + 0
- akt_hoehe = 0
- for x=1,hoehe do
- countbreite = 0
- for x=1,breite2 do
- linie()
- turnright()
- linie()
- countbreite = countbreite + 2
- if countbreite < breite3 then
- turnleft()
- end
- -- Startet eine letzte Linie, wenn ungrade Breite
- if countbreite == breite4 then
- linie()
- countbreite = countbreite + 1
- turn()
- linie_odd()
- end
- end
- turtle.turnRight()
- for x=1,breite - 1 do
- backhome()
- end
- akt_hoehe = akt_hoehe + 1
- if akt_hoehe < hoehe2 then
- turtle.turnRight()
- up()
- else
- turtle.turnRight()
- for x=1,hoehe - 1 do
- turtle.down()
- end
- end
- end
- while true do -- Endlosschleife nach Beendigung des Programms
- startscreen()
- term.setCursorPos( 1, 4)
- print("--Raum beendet--")
- sleep(1)
- end
- end
Add Comment
Please, Sign In to add comment