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

Program Error that doesn't make any sense

Started by Ninjawolf0007, 02 April 2013 - 11:58 AM
Ninjawolf0007 #1
Posted 02 April 2013 - 01:58 PM
I'm getting a "bios:338: [string "startup"]:16: 'do' expected" error… it doesn't make sense though… Please help me… Thank you very much.

while true do

  if redstone.getInput("left") == true and redstone.getInput("right") == true then
	redstone.setOutput("top", true)
	sleep(5)
	redstone.setOutput("top", false)
	sleep(.1)
  end

end
would this fix it or not?


while true do

  if redstone.getInput("left") == true and redstone.getInput("right") == true then
	redstone.setOutput("top", true)
	sleep(5)
	redstone.setOutput("top", false)
	sleep(.1)
  end

  if redstone.getInput("left") == true and redstone.getInput("right") == false then
	sleep(1)
  end

end
SuicidalSTDz #2
Posted 02 April 2013 - 02:00 PM
Like I said before:

The bios is what boots CraftOS..
Now, your program which is obviously startup does go up to 16 or else we would not be seeing that error now would we?
Check to make sure you can't scroll down any further than the end of your code. If you can, then there must spaces which means there might be a character or something at line 16 that is causing an error.
Ninjawolf0007 #3
Posted 02 April 2013 - 02:08 PM
Like I said before:

The bios is what boots CraftOS..
Now, your program which is obviously startup does go up to 16 or else we would not be seeing that error now would we?
Check to make sure you can't scroll down any further than the end of your code. If you can, then there must spaces which means there might be a character or something at line 16 that is causing an error.

It doesn't go up that high which is why it doesn't make any sense.
all my code:


while true do
if redstone.getInput("left") == true and redstone.getInput("right") == true then
redstone.setOutput("top", true)
sleep(5)
redstone.setOutput("top", false)
sleep(.1)
end
end

It's very confusing why this is happening.For proof:
SpoilerI do all my coding in Notepad++ and that's as far down it goes and that's why I'm confused…
theoriginalbit #4
Posted 02 April 2013 - 02:11 PM
delete the program and make it again…
SuicidalSTDz #5
Posted 02 April 2013 - 02:12 PM
So after your code there are no more lines? That is odd. I can't see anything that would be causing this error except for what I mentioned before.

EDIT: And the ninja arrives.. Typical :P/>
Ninjawolf0007 #6
Posted 02 April 2013 - 02:15 PM
So after your code there are no more lines? That is odd. I can't see anything that would be causing this error except for what I mentioned before.

EDIT: And the ninja arrives.. Typical :P/>

Exactly, no more lines than that… :(/> So I am retyping it… atleast it's only 8 lines.

Now I don't even have a startup file and it's giving me the same error… what's going on?
theoriginalbit #7
Posted 02 April 2013 - 02:16 PM
EDIT: And the ninja arrives.. Typical :P/>
*wild ninja appears* :ph34r:/> :ph34r:/> :ph34r:/> :ph34r:/> :ph34r:/> *screams* karate-post! :P/>
SuicidalSTDz #8
Posted 02 April 2013 - 02:21 PM
So after your code there are no more lines? That is odd. I can't see anything that would be causing this error except for what I mentioned before.

EDIT: And the ninja arrives.. Typical :P/>

Exactly, no more lines than that… :(/> So I am retyping it… atleast it's only 8 lines.

Now I don't even have a startup file and it's giving me the same error… what's going on?
Some sorcery of the highest degree i'll tell you what!

I honsetly have no idea..
Ninjawolf0007 #9
Posted 02 April 2013 - 02:23 PM
So after your code there are no more lines? That is odd. I can't see anything that would be causing this error except for what I mentioned before.

EDIT: And the ninja arrives.. Typical :P/>

Exactly, no more lines than that… :(/> So I am retyping it… atleast it's only 8 lines.

Now I don't even have a startup file and it's giving me the same error… what's going on?
Some sorcery of the highest degree i'll tell you what!

I honsetly have no idea..

I might just have to ask dan200 himself… does he respond to random members?
theoriginalbit #10
Posted 02 April 2013 - 02:28 PM
I might just have to ask dan200 himself… does he respond to random members?
Nope never… thats why the "Ask a Pro" section is here… have you tried deleting the file and starting again to check? 'Cause I see and get no errors with the code…
SuicidalSTDz #11
Posted 02 April 2013 - 02:29 PM
Damn ninja's and their damn shurikens hitting my damn posts
theoriginalbit #12
Posted 02 April 2013 - 02:30 PM
He usually answers to most people.
Shhhh don't say that, otherwise he will be flooded with heaps of messages :P/>
Ninjawolf0007 #13
Posted 02 April 2013 - 02:33 PM
I might just have to ask dan200 himself… does he respond to random members?
Nope never… thats why the "Ask a Pro" section is here… have you tried deleting the file and starting again to check? 'Cause I see and get no errors with the code…
I deleted the whole startup file and it still gave me the error… How does that work?!
SuicidalSTDz #14
Posted 02 April 2013 - 02:39 PM
He usually answers to most people.
Shhhh don't say that, otherwise he will be flooded with heaps of messages :P/>
Dan might get pretty mad if he had to take time out of.. Oh, you're still there? Be gone with you!


I deleted the whole startup file and it still gave me the error… How does that work?!
Ok, listen closely.. Are you using CC-Emu?
NeverCast #15
Posted 02 April 2013 - 02:52 PM
Disk Drive is on your computer
Disk Drive has a disk in it
disk has a startup on it
It has more than 16 lines and has an error in it.

If my assumptions are correct then I assume you're trying to edit the startup on the disk, hence the confusion.

To edit the file on the disk you edit /disk/startup, not edit startup or edit /startup.
Ninjawolf0007 #16
Posted 02 April 2013 - 03:13 PM
Thank you everyone! It's hopefully about to work! :)/>
remiX #17
Posted 02 April 2013 - 09:47 PM
Make sure you are not using the wrong computer ID lol
NeverCast #18
Posted 03 April 2013 - 06:38 PM
Wrong Computer ID? How is that even related to his question?
remiX #19
Posted 03 April 2013 - 11:04 PM
He could be looking at the wrong computer id in the saves folder…
1lann #20
Posted 04 April 2013 - 02:15 AM
Wrong Computer ID? How is that even related to his question?
I do all my coding in Notepad++…
NeverCast #21
Posted 04 April 2013 - 01:11 PM
Gotcha. That didn't even cross my mind.. I guess you'd have to be special kind of foolish for that mistake, else tired.