Advertisement
DerMarten

Test Programm

Jul 23rd, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. -- Programm bei DerMarten --
  2. ----------------------------
  3. shell.run("clear")
  4. print("Street Turtle")
  5. -- Variablen
  6. -- Programm Schleifen zustandt
  7. active = true
  8. slot = 1
  9. ccout = 0
  10. -- Functionen
  11. function forward()
  12.     if(turtle.detect) then
  13.         --if(turtle.dig()) then
  14.        
  15.         --else
  16.             --active = false
  17.         --end
  18.         turtle.forward()
  19.     end
  20. end
  21. -- Programm Schleife
  22. while(active) do
  23.     --if(turtle.detect()==false) then
  24.         if(turtle.detectDown()) then
  25.            
  26.             count = 0
  27.             if(ccout == 0) then
  28.             shell.run("clear")
  29.             print("Street Turtle .")
  30.             end
  31.             if(ccout == 1) then
  32.             shell.run("clear")
  33.             print("Street Turtle ..")
  34.             end
  35.             if(ccout == 2) then
  36.             shell.run("clear")
  37.             print("Street Turtle ...")
  38.             end
  39.            
  40.             if(turtle.compareDown(slot)) then
  41.                 count = count + 1
  42.                 forward()
  43.                
  44.                 if(turtle.compareDown(slot)) then
  45.                 count = count + 1
  46.                 turtle.turnRight()
  47.                 else
  48.                 turtle.turnLeft()
  49.                 end
  50.             end
  51.             forward()
  52.         end
  53.        
  54.     --else
  55.         --active = false
  56.     --end
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement