13 posts
                
             
            
                Posted 14 May 2012 - 07:24 PM
                Hi.
When I try my script it gives me: bios:206: [string "filename"]:20:" '=' expected.
And the line 20 is on a print command. Very strange, my code is like this to the error (The rest is not important i think).
os.pullEvent = os.pullEventRaw
function club()
print ("asdasd")
print ("asdasd")
input = io.read()
if input == "commands" then
print("asdasd")
club()
elseif input == "shutdown" then
print("Shutting down...")
sleep(1)
os.shutdown
elseif input == "reboot" then
print("Rebooting...")
sleep(1)
os.reboot
(I removed some of the prints as they are not important so its not literally line 20 in the code here, but it is ingame)
The line 20 is 
print("Rebooting...")
I do not understand!
Please help, thank you.
-PetruZ
 
                
             
         
        
        
            
            
                
                    
                
                2447 posts
                
             
            
                Posted 14 May 2012 - 08:08 PM
                It is always useful to look on the line before 20.
os.shutdown should be os.shutdown()
                
             
         
        
        
            
            
                
                    
                
                13 posts
                
             
            
                Posted 14 May 2012 - 08:14 PM
                Oh such a foolish mistake. Thanks  :P/>/> I'll keep that in mind!
                
             
         
        
        
            
            
                
                    
                
                146 posts
                
                    
                        Location
                        the Netherlands
                    
                
             
            
                Posted 14 May 2012 - 08:18 PM
                And os.reboot should be os.reboot()
                
             
         
        
        
            
            
                
                    
                
                504 posts
                
                    
                        Location
                        Seattle, WA
                    
                
             
            
                Posted 15 May 2012 - 04:38 AM
                I'm not sure if this is all of the code given, but you also never end your function club() or your if statement. I doubt that is the cause of the problem because that issue was already addressed by previous posters.
                
             
         
        
        
            
            
                
                    
                
                13 posts
                
             
            
                Posted 15 May 2012 - 02:23 PM
                It was just a bit of the code :P/>/> It is all solved now.
                
             
         
        
        
            
            
                
                    
                
                59 posts
                
                    
                        Location
                        Washington, United States
                    
                
             
            
                Posted 17 May 2012 - 04:05 AM
                Instead of "elseif", do "else if". Also, it is good practice to add parantheses around the condition variables.
What the error is trying to say is "You're adding an extra = !" It believes that "elseif" is a variable, for it is not a keyword.
Also, you forgot to add an "end" command at the end of the code. That would also be required, for if you ignore that, you will get a different error after the other error is fixed.
                
             
         
        
        
            
            
                
                    
                
                1111 posts
                
                    
                        Location
                        Portland OR
                    
                
             
            
                Posted 17 May 2012 - 04:21 AM
                Instead of "elseif", do "else if". Also, it is good practice to add parantheses around the condition variables.
What the error is trying to say is "You're adding an extra = !" It believes that "elseif" is a variable, for it is not a keyword.
Also, you forgot to add an "end" command at the end of the code. That would also be required, for if you ignore that, you will get a different error after the other error is fixed.
else if is not a valid Lua command you are executing two commands an else and an if if you do else if. It can and will cause you problems if you do it that way, and does not really perform the same checks as elseif.
You need to do elseif.
 
                
             
         
        
        
            
            
                
                    
                
                59 posts
                
                    
                        Location
                        Washington, United States
                    
                
             
            
                Posted 19 May 2012 - 04:25 AM
                Uhh…. should there be an end command at the end of your code to end the function?