Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slot1 = 2
- slot2 = 3
- function treibstoff()
- turtle.select(1)
- turtle.refuel(1)
- end
- function hindernisvor()
- while turtle.detect() do
- turtle.dig()
- end
- end
- function hindernisauf()
- while turtle.detectUp() do
- turtle.digUp()
- end
- end
- function hindernisab()
- while turtle.detectDown() do
- turtle.digDown()
- end
- end
- function vor()
- if turtle.getFuelLevel() < 10 then
- treibstoff()
- end
- while turtle.forward() == false do
- hindernisvor()
- turtle.attack()
- end
- end
- function auf()
- if turtle.getFuelLevel() < 10 then
- treibstoff()
- end
- while turtle.up() == false do
- hindernisauf()
- turtle.attackUp()
- end
- end
- function ab()
- if turtle.getFuelLevel() < 10 then
- treibstoff()
- end
- while turtle.down() == false do
- hindernisab()
- turtle.attackDown()
- end
- end
- function setzen()
- if turtle.getItemCount(slot1) == 0 then
- slot1 = slot1 + 2
- end
- turtle.select(slot1)
- turtle.placeDown()
- end
- function setzenzaun()
- if turtle.getItemCount(slot2) == 0 then
- slot2 = slot2 + 2
- end
- turtle.select(slot2)
- turtle.placeDown()
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Please put fuel in slot 1!")
- print("Please place platform or roof material in slot 2, 4, 6, 8, 10, 12, 14 and 16!")
- print("If the fence mode is activated, please place the fence material in slot 3, 5, 7, 9, 11, 13 and 15!")
- print("Press any key to continue!")
- os.pullEvent("key")
- shell.run("clear")
- print("How long should the bridge be?")
- term.setCursorPos(22,12)
- print("(c)vantheman1wald")
- term.setCursorPos(1,2)
- write("Length:")
- laenge = tonumber(read())
- term.clearLine()
- term.setCursorPos(1,1)
- term.clearLine()
- print("Length:"..laenge)
- print("How wide should the bridge be?")
- write("Width:")
- breite = tonumber(read())
- term.clearLine()
- term.setCursorPos(1,2)
- term.clearLine()
- print("Width:"..breite)
- print("In which direction should the turtle build? (Left or right)")
- write("Direction:")
- richtung = read()
- term.clearLine()
- term.setCursorPos(1,3)
- term.clearLine()
- print("Direction:"..richtung)
- if string.lower(richtung) == "rechts" then
- richtung = "turnRight"
- end
- if string.lower(richtung) == "links" then
- richtung = "turnLeft"
- end
- print("Should the turtle build a:")
- print("1) platform")
- Print("2) a bridge with a fence")
- Print("3) a covered bridge")
- Print("1, 2 or 3")
- write("Number:")
- zaun = read()
- term.setCursorPos(1,4)
- term.clearLine()
- print("Number:"..zaun)
- term.setCursorPos(1,5)
- term.clearLine()
- term.setCursorPos(1,6)
- term.clearLine()
- term.setCursorPos(1,7)
- term.clearLine()
- term.setCursorPos(1,8)
- term.clearLine()
- if string.lower(zaun) == "1" then
- turtle.placeDown()
- for a = 1, laenge do
- turtle[richtung]()
- for x = 2, breite do
- setzen()
- vor()
- end
- setzen()
- auf()
- setzenzaun()
- for asdf = 0,1 do
- turtle[richtung]()
- end
- for c = 2, breite do
- vor()
- end
- setzenzaun()
- turtle[richtung]()
- vor()
- ab()
- end
- end
- if string.lower(zaun) == "2" then
- for d = 1, laenge do
- setzen()
- turtle[richtung]()
- for y = 2, breite do
- vor()
- setzen()
- end
- for ad = 0,2 do
- turtle[richtung]()
- end
- vor()
- for af = 0,2 do
- turtle[richtung]()
- end
- for f = 2, breite do
- vor()
- end
- turtle[richtung]()
- end
- end
- if string.lower(zaun) == "3" then
- turtle.placeDown()
- for a = 1, laenge do
- turtle[richtung]()
- for x = 2, breite do
- setzen()
- vor()
- end
- setzen()
- auf()
- setzenzaun()
- for xy = 1,2 do
- turtle[richtung]()
- end
- for c = 2, breite do
- vor()
- end
- setzenzaun()
- auf()
- setzenzaun()
- for xy = 1,2 do
- turtle[richtung]()
- end
- for c = 2, breite do
- vor()
- end
- setzenzaun()
- auf()
- setzenzaun()
- for xy = 1,2 do
- turtle[richtung]()
- end
- for c = 2, breite do
- vor()
- end
- setzenzaun()
- auf()
- setzen()
- for xy = 1,2 do
- turtle[richtung]()
- end
- for c = 2, breite do
- vor()
- setzen()
- end
- for xy = 1,2 do
- turtle[richtung]()
- end
- for c = 2, breite do
- vor()
- end
- turtle[richtung]()
- vor()
- for xyz = 1,4 do
- ab()
- end
- end
- end
- turtle.select(1)
- term.clear()
- term.setCursorPos(1,1)
Add Comment
Please, Sign In to add comment