Guest User

boden

a guest
Oct 20th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. -- Variablen Vergeben
  2. Auswahl = 1 + 0
  3. Richtung = "Rechts"
  4. print("Wie weit soll ich vor?")
  5. Lang = io.read() - 1
  6. Lang2 = Lang + 1
  7. print("Gut, ich Baue "..Lang2.." Vor!")
  8.  
  9. print("Wie oft soll ich nach Rechts?")
  10. Breit = io.read()
  11. print("Ai ai! "..Breit.." nach Rechts.")
  12. print(" ")
  13. print("Ich arbeite in 5 Sekunden!")
  14. sleep(5)
  15. -- Funktionen
  16. function Blockcheck()
  17.  if turtle.getItemCount(Auswahl) == 0 then
  18.   Auswahl = Auswahl + 1
  19.   turtle.select(Auswahl)
  20.  end
  21. end
  22.  
  23. -- Programm
  24.  
  25. for i = 1,Breit do
  26.  
  27.  for i = 1,Lang do
  28.   Blockcheck()
  29.   turtle.placeDown()
  30.   turtle.forward()
  31.   Blockcheck()
  32.   turtle.placeDown()
  33.  end
  34.  --Abfrage wie Turtle abbiegen soll
  35.  if Richtung == "Rechts" then
  36.   turtle.turnRight()
  37.   turtle.forward()
  38.   turtle.turnRight()
  39.   Richtung = "Links"
  40.  elseif Richtung == "Links" then
  41.   turtle.turnLeft()
  42.   turtle.forward()
  43.   turtle.turnLeft()
  44.   Richtung = "Rechts"
  45.  end
  46.    
  47. end
Add Comment
Please, Sign In to add comment