Niseg

3 wide platform builder

Apr 13th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. --floor2
  2.  
  3. local turnLeft=true;
  4. local failCount=0;
  5. local breakFloor=true;
  6. local sel=1;
  7. local slot=1
  8. local width=1;
  9. local length=1;
  10. local stage=0
  11. local args={...}
  12. print("platform 3xlength builder by Niseg")
  13. print("refuel the turtle put tell it to level where you want platform")
  14. print(" builds backwards do turn right 2 ");
  15. turtle.select(sel)
  16.  
  17. if #args>1 then
  18.     --width=tonumber(args[1])
  19.     length=tonumber(args[1])
  20.     --sel=tonumber(args[3])
  21.     if width<1 then
  22.     print("invalid length ")
  23.     exit()
  24.     end
  25. --  print("args3="+args[3])
  26.    
  27. else
  28.  
  29.     repeat
  30.     print("length ")
  31.      
  32.     length=tonumber(read())
  33.     until length>0
  34.      
  35.      
  36.  
  37. end
  38. length= length*3;
  39.  
  40.         for j= 1,length,1 do
  41.             if stage== 0 then
  42.             turtle.turnRight();
  43.             elseif stage==1 then
  44.             turtle.turnLeft();turtle.turnLeft();
  45.              
  46.             elseif stage==2 then
  47.              turtle.turnRight();turtle.back();
  48.             end
  49.             if(not turtle.place()) then sel=sel+1;turtle.select(sel);turtle.place();end
  50.             stage=(stage+1)%3;
  51.         end
  52.  
  53.  
  54.  
  55. print("done")
Advertisement
Add Comment
Please, Sign In to add comment