Jump to content




Program Error that doesn't make any sense

computer lua help

20 replies to this topic

#1 Ninjawolf0007

  • Members
  • 46 posts

Posted 02 April 2013 - 12: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


#2 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 02 April 2013 - 01:00 PM

Like I said before:

View PostSuicidalSTDz, on 02 April 2013 - 12:55 PM, said:

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.


#3 Ninjawolf0007

  • Members
  • 46 posts

Posted 02 April 2013 - 01:08 PM

View PostSuicidalSTDz, on 02 April 2013 - 01:00 PM, said:

Like I said before:

View PostSuicidalSTDz, on 02 April 2013 - 12:55 PM, said:

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:
Spoiler


#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 02 April 2013 - 01:11 PM

delete the program and make it again...

#5 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 02 April 2013 - 01: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

#6 Ninjawolf0007

  • Members
  • 46 posts

Posted 02 April 2013 - 01:15 PM

View PostSuicidalSTDz, on 02 April 2013 - 01:12 PM, said:

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?

#7 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 02 April 2013 - 01:16 PM

View PostSuicidalSTDz, on 02 April 2013 - 01:12 PM, said:

EDIT: And the ninja arrives.. Typical :P
*wild ninja appears* :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: *screams* karate-post! :P

#8 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 02 April 2013 - 01:21 PM

View PostNinjawolf0007, on 02 April 2013 - 01:15 PM, said:

View PostSuicidalSTDz, on 02 April 2013 - 01:12 PM, said:

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..

#9 Ninjawolf0007

  • Members
  • 46 posts

Posted 02 April 2013 - 01:23 PM

View PostSuicidalSTDz, on 02 April 2013 - 01:21 PM, said:

View PostNinjawolf0007, on 02 April 2013 - 01:15 PM, said:

View PostSuicidalSTDz, on 02 April 2013 - 01:12 PM, said:

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?

#10 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 02 April 2013 - 01:28 PM

View PostNinjawolf0007, on 02 April 2013 - 01:23 PM, said:

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...

#11 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 02 April 2013 - 01:29 PM

Damn ninja's and their damn shurikens hitting my damn posts

#12 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 02 April 2013 - 01:30 PM

View PostSuicidalSTDz, on 02 April 2013 - 01:29 PM, said:

He usually answers to most people.
Shhhh don't say that, otherwise he will be flooded with heaps of messages :P

#13 Ninjawolf0007

  • Members
  • 46 posts

Posted 02 April 2013 - 01:33 PM

View Posttheoriginalbit, on 02 April 2013 - 01:28 PM, said:

View PostNinjawolf0007, on 02 April 2013 - 01:23 PM, said:

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?!

#14 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 02 April 2013 - 01:39 PM

View Posttheoriginalbit, on 02 April 2013 - 01:30 PM, said:

View PostSuicidalSTDz, on 02 April 2013 - 01:29 PM, said:

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!


View PostNinjawolf0007, on 02 April 2013 - 01:33 PM, said:

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?

#15 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 02 April 2013 - 01: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.

#16 Ninjawolf0007

  • Members
  • 46 posts

Posted 02 April 2013 - 02:13 PM

Thank you everyone! It's hopefully about to work! :)

#17 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 02 April 2013 - 08:47 PM

Make sure you are not using the wrong computer ID lol

#18 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 03 April 2013 - 05:38 PM

Wrong Computer ID? How is that even related to his question?

#19 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 03 April 2013 - 10:04 PM

He could be looking at the wrong computer id in the saves folder...

#20 1lann

  • Members
  • 516 posts
  • LocationSeattle

Posted 04 April 2013 - 01:15 AM

View PostNeverCast, on 03 April 2013 - 05:38 PM, said:

Wrong Computer ID? How is that even related to his question?

View PostNinjawolf0007, on 02 April 2013 - 01:08 PM, said:

I do all my coding in Notepad++...






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users