This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
viking170's profile picture

Error I HAVE TRIED EVERYTHING!

Started by viking170, 19 March 2012 - 09:32 PM
viking170 #1
Posted 19 March 2012 - 10:32 PM
i have tried everything even the codex of error slaying, videos,searching it and i come up with a different problem everytime! here is my code :


print ("password correct!")
redstone.setoutput("left", true )
sleep(2)
redstone.setoutput("left", false )



edit: redstone.setOutput("left" true )



and i have tried doing end but i get <eof> expected!
i also tried watching many videos but no luck
HELP!
i have tried MANT VIDEOS nothing will work i also tried what espen said :C
I CANT TELL YOU THE ERROR CAUSE I GET ALL OF THEM!
MysticT #2
Posted 19 March 2012 - 10:37 PM
Use commas to separate functions parameters:

print ("password correct!")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", true )
Also, it's setOutput, not setoutput.
viking170 #3
Posted 19 March 2012 - 11:14 PM
i meant to put a comma
viking170 #4
Posted 19 March 2012 - 11:23 PM
Use commas to separate functions parameters:

print ("password correct!")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", true )
Also, it's setOutput, not setoutput.




i tried before and i tried just now it didnt work
Espen #5
Posted 19 March 2012 - 11:31 PM
What exactly do you mean with "it didn't work"?
Does it print an error message? Does it run, but not as you expected?
Not trying to bash you here, but we can't read minds, you're going to have to use words. :D/>/>

Having said that, let me try to guess what you might've meant:
You're never actually shutting off the redstone signal, because instead of setting it to false after the sleep(), you set it to true again, effectively not changing it from what it was before that.
I.e. instead of…

print ("password correct!")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", true )
… you might've wanted to do this…

print ("password correct!")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", false )  -- Changed 'true' to 'false'.

Is that what you meant? If not: Please explain. :)/>/>
viking170 #6
Posted 20 March 2012 - 03:53 AM
What exactly do you mean with "it didn't work"?
Does it print an error message? Does it run, but not as you expected?
Not trying to bash you here, but we can't read minds, you're going to have to use words. :)/>/>

Having said that, let me try to guess what you might've meant:
You're never actually shutting off the redstone signal, because instead of setting it to false after the sleep(), you set it to true again, effectively not changing it from what it was before that.
I.e. instead of…

print ("password correct!")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", true )
… you might've wanted to do this…

print ("password correct!")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", false )  -- Changed 'true' to 'false'.

Is that what you meant? If not: Please explain. :)/>/>



it says attempt to call nil or ) expected
what do i do when it says ')' expected?
ps. i tried it :D/>/>
i tried re-installing the mod and watching many videos and the error slayer forum post nothing will work! plus it says syntax error :P/>/>
AND STILL NOTHING WILL WORK
i have gotten every error on the error slayer!
when i fix one another one comes

i tried this:
print ("hi")
redstone.setOutput("left" true )
sleep(2)
redstone.setOutput("left" true )

i have tried doing end also >:C!
Luanub #7
Posted 20 March 2012 - 05:04 AM
Can you post the entire code that you are using? Its possible that something before this line of code is causing the issue. Also post what your current error message is. We can work from there.

Got home and plugged the last thing that you posted into a CC Computer, and I got the ')' expected error.

I noticed you are missing comma's after the "left" in your redstone statements this is causing the error, without the comma the next character to get the syntax correct would be a ).

Fix that and it should work.

should be..

print ("hi")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", false )

Tested and works great.
Edited on 20 March 2012 - 07:47 AM
viking170 #8
Posted 20 March 2012 - 01:55 PM
Can you post the entire code that you are using? Its possible that something before this line of code is causing the issue. Also post what your current error message is. We can work from there.

Got home and plugged the last thing that you posted into a CC Computer, and I got the ')' expected error.

I noticed you are missing comma's after the "left" in your redstone statements this is causing the error, without the comma the next character to get the syntax correct would be a ).

Fix that and it should work.

should be..

print ("hi")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", false )

Tested and works great.
sorry does not work
viking170 #9
Posted 20 March 2012 - 01:57 PM
What exactly do you mean with "it didn't work"?
Does it print an error message? Does it run, but not as you expected?
Not trying to bash you here, but we can't read minds, you're going to have to use words. :D/>/>

Having said that, let me try to guess what you might've meant:
You're never actually shutting off the redstone signal, because instead of setting it to false after the sleep(), you set it to true again, effectively not changing it from what it was before that.
I.e. instead of…

print ("password correct!")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", true )
… you might've wanted to do this…

print ("password correct!")
redstone.setOutput("left", true )
sleep(2)
redstone.setOutput("left", false )  -- Changed 'true' to 'false'.

Is that what you meant? If not: Please explain. :)/>/>



) expected!

I HAVE LOOKED AT HUNDREDS OF VIDEOS AND TRIED ALL OF THEM NOTHING WILL WORK!
viking170 #10
Posted 20 March 2012 - 01:59 PM
.
. . .
. . .
. . .
. . .
. . .
. . . NOTHING WILL WORK!
. .
Espen #11
Posted 20 March 2012 - 02:33 PM
) expected!

I HAVE LOOKED AT HUNDREDS OF VIDEOS AND TRIED ALL OF THEM NOTHING WILL WORK!
I'm beginning to suspect you're trolling. :D/>/>
When it says ") expected", that is not all it said, was it? There had to be at least the name of the program AND a line number where the error occurred.
Can you please give us the whole error message?

Also, if you copy and pasted the code, then there shouldn't be any problem at all.
But since you still seem to get errors I suspect that you copied everything by hand? If that's the case then you have made typos.
Therefore, to find out exactly where the error occurs: Please give the full error message, thx. :)/>/>
Luanub #12
Posted 20 March 2012 - 08:33 PM
Make sure your using notepad++ or something like that and copy and paste the code to make sure your getting exactly what we put. If you are using exactly what we put and still getting the error then something else is wrong. There is nothing wrong with that code.

As Espen said please post the full message, and we will probably need more of the code you are using as there is probably an error somewhere there.

If you're uncomfortable for whatever reason posting your code feel free to PM me and I'll try to help there. :D/>/>
Dirkus7 #13
Posted 23 March 2012 - 11:03 PM
i don't think this is your whole program, can you please copy the whole code and paste it inside a spoiler? Because i suspect the error is not in this part of the code. And please tell us the entire error. Maybe we can help you then.
Zukamimozu #14
Posted 24 March 2012 - 04:07 AM
nvm