Advertisement
Guest User

basicArea

a guest
Apr 5th, 2020
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. local x,y,richtung, sFunk = ...
  2. local teste = x
  3.  
  4. term.setBackgroundColor(colors.black)
  5. shell.run("clear")
  6.  
  7. term.setTextColor(colors.blue)
  8.  
  9. write("X-Richtung: "..(x or ""))
  10. x = (x or read())+0
  11. if teste then print() end
  12.  
  13. write("Y-Richtung: "..(y or ""))
  14. y = (y or read())+0
  15. if teste then print() end
  16.  
  17. write("Gehe in Richtung (r/l): "..(richtung or ""))
  18. richtung = richtung or read()
  19. if teste then print() end
  20.  
  21. term.setTextColor(colors.green)
  22.  
  23. write("Funktion ausfuehren: "..(sFunk or ""))
  24. local funk = loadstring(sFunk or read())
  25.  
  26. local xL = 1
  27. local yL = 1
  28.  
  29. while yL <= y do
  30.  
  31.  while xL < x do
  32.   funk(xL,yL)
  33.   turtle.forward()
  34.   xL = xL + 1
  35.  end
  36.   funk()
  37.  xL = 1
  38.  
  39.  if yL < y then
  40.   if richtung == "r" then
  41.    richtung = "l"
  42.    turtle.turnRight()
  43.    turtle.forward()
  44.    turtle.turnRight()
  45.   else
  46.    richtung = "r"
  47.    turtle.turnLeft()
  48.    turtle.forward()
  49.    turtle.turnLeft()
  50.   end
  51.  end
  52.  
  53.  yL = yL + 1
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement