5 posts
                
             
            
                Posted 19 August 2012 - 01:08 AM
                So what I have been trying to do is get the turtle to mine a 2x2 hole to layer 12, and then mine a 2x2 tunnel until its inventory is full, when it comes back up to the top and sleeps while it is emptied. When I run it, I get: bios:206: [string "Tunnel"]:28: 'do' expected
http://pastebin.com/2PmHz9BpI am very new to programming, please help!
 
                
             
         
        
        
            
            
                
                    
                
                3790 posts
                
                    
                        Location
                        Lincoln, Nebraska
                    
                
             
            
                Posted 19 August 2012 - 01:33 AM
                When referring back to a variable in a place like line 28, we need to use "==" which means "evaluates equal" If you change it to that on the line, you should have no problem. Same with line 41. Needs to be "=="
                
             
         
        
        
            
            
                
                    
                
                5 posts
                
             
            
                Posted 19 August 2012 - 01:50 AM
                Thanks for the help, after that it throws out no errors but doesn't do anything! What is wrong with the program?
                
             
         
        
        
            
            
                
                    
                
                149 posts
                
             
            
                Posted 19 August 2012 - 01:50 AM
                Not related to the helping out, but seeing as i just made my own sort of tunneling turtle i want to provide a pointer:
For those "turtle.dig()" and "turtle.forward()" lines first set these right at the top:
function RIGHT()
turtle.turnRight()
end
function LEFT()
turtle.turnLeft()
end
ETC
This way you just need to type in LEFT() or RIGHT() instead of a long line of "turtle.turnLeft"
EDIT:
OK i think you forgot to run the function "inv()" ? Since i see nothing thats executing an function after setting them up.
                
             
         
        
        
            
            
                
                    
                
                5 posts
                
             
            
                Posted 19 August 2012 - 01:58 AM
                Thanks, I changed that now, but the turtle still sits and does nothing.
                
             
         
        
        
            
            
                
                    
                
                864 posts
                
                    
                        Location
                        Sometime.
                    
                
             
            
                Posted 19 August 2012 - 04:59 AM
                Thanks, I changed that now, but the turtle still sits and does nothing.
Your turtle must be on hardcore mode. Go to your config file and change it to 0.
 
                
             
         
        
        
            
            
                
                    
                
                5 posts
                
             
            
                Posted 19 August 2012 - 10:41 AM
                I'm using version 1.33 on a server, and I made another program and it worked without fuel. I have tried filling the turtle with fuel, but it does nothing.
                
             
         
        
        
            
            
                
                    
                
                992 posts
                
             
            
                Posted 19 August 2012 - 11:14 AM
                Here is your code fixed so it will run. i haven't fixed other errors example the face it spins around a lot doing not much
http://pastebin.com/KPb2SBK1 
                
             
         
        
        
            
            
                
                    
                
                5 posts
                
             
            
                Posted 20 August 2012 - 10:43 AM
                Thank you! I fixed the stupid movement order, I might have been a bit tired when I wrote that.
                
             
         
        
        
            
            
                
                    
                
                997 posts
                
                    
                        Location
                        Wellington, New Zealand
                    
                
             
            
                Posted 20 August 2012 - 02:04 PM
                The reason it didn't do anything before is that all of your code was inside the inv function.