Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - --
 - -- Windmill Placer v1.0 by Joseph Jones
 - --
 - -- Instructions found at:
 - --
 - --
 - -- Needs 420 cables. Uses slots 1-14
 - -- Needs 60 windmills. Uses slot 15
 - -- Needs 960 fuel. Uses slot 16
 - --
 - --
 - -- ChangeLog:
 - -- June 29, 2013: [v1.0] Finished initial release
 - --
 - local currWireSlot = 1
 - --Checks the number of wires in curr slot and changes if 0
 - function checkWireCountInSlot()
 - --Checks the slot with wires to see if there are wires
 - while(turtle.getItemCount(currWireSlot)==0) do
 - currWireSlot = currWireSlot + 1
 - --checks to make sure there are wires in the inventory
 - if(currWireSlot==15) then
 - print("There is not enough cable.")
 - print("Press enter to continue.")
 - io.read()
 - currWireSlot=1
 - end
 - turtle.select(currWireSlot)
 - end
 - end
 - function forwardPlaceCable()
 - checkWireCountInSlot()
 - while (turtle.forward()==false) do end
 - turtle.placeDown()
 - end
 - function placeWindmill()
 - while (turtle.up()==false) do end
 - checkWireCountInSlot()
 - turtle.placeDown()
 - while (turtle.up()==false) do end
 - checkWireCountInSlot()
 - turtle.placeDown()
 - while (turtle.up()==false) do end
 - turtle.select(15)
 - --checks to make sure there are windmills in the inventory
 - while(turtle.getItemCount(15)==0) do
 - print("There is not enough windmills in slot 15.")
 - print("Press enter to continue.")
 - io.read()
 - end
 - turtle.placeDown()
 - turtle.select(currWireSlot)
 - end
 - function placeWings(numOfWindMills)
 - local temp = numOfWindMills - 1
 - temp = temp * 5
 - while(temp>0) do
 - forwardPlaceCable()
 - temp = temp - 1
 - end
 - temp = numOfWindMills - 1
 - placeWindmill()
 - while(temp>0) do
 - if(temp>0) then
 - while (turtle.back()==false) do end
 - while (turtle.down()==false) do end
 - while (turtle.down()==false) do end
 - while (turtle.down()==false) do end
 - end
 - local temp2 = 4
 - while(temp2>0) do
 - while (turtle.back()==false) do end
 - temp2 = temp2 - 1
 - end
 - placeWindmill()
 - temp = temp - 1
 - end
 - turtle.turnRight()
 - while (turtle.forward()==false) do end
 - while (turtle.down()==false) do end
 - while (turtle.down()==false) do end
 - while (turtle.down()==false) do end
 - end
 - --obtains 960 fuel at the beginning of the program
 - function fuel()
 - turtle.select(16)
 - while(turtle.getFuelLevel() < 960) do
 - if(turtle.refuel(1)==false) then
 - print("Turtle needs more fuel in slot 16. Press enter to continue")
 - io.read()
 - end
 - end
 - end
 - --Main program
 - fuel()
 - turtle.select(currWireSlot)
 - local currSide = 4
 - while(currSide > 0) do
 - local temp = 25
 - while(temp>0) do
 - forwardPlaceCable()
 - temp = temp - 1
 - end
 - temp = 1
 - turtle.turnRight()
 - while(temp<6) do
 - placeWings(temp)
 - temp = temp + 1
 - while (turtle.forward()==false) do end
 - while (turtle.forward()==false) do end
 - while (turtle.forward()==false) do end
 - while (turtle.forward()==false) do end
 - turtle.turnLeft()
 - end
 - currSide = currSide-1
 - end
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment