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

Urgent bios eof Emergency...

Started by mumble118, 01 January 2013 - 10:42 AM
mumble118 #1
Posted 01 January 2013 - 11:42 AM
Dear Pros,

I am create a Tekkit Lamp New Year's Eve countdown clock. I'm using a Computer to sequence the lights using Bundled cables. I have set the program named under "new", and I've tested it, but it's come up with 'bios:206: [string "new"]:24: '<eof>' expected. Can you help?
Here's the code:


rs.setBundledOutput("right", colors.white)
sleep (.1)
rs.setBundledOutput("right", colors.cyan)
sleep (.1)
rs.setBundledOutput("right", colors.lightblue)
sleep (.1)
rs.setBundledOutput("right", colors.brown)
sleep (.1)
rs.setBundledOutput("right", colors.orange)
sleep (.1)
rs.setBundledOutput("right", colors.purple)
sleep (.1)
rs.setBundledOutput("right", colors.pink)
sleep (.1)
rs.setBundledOutput("right", colors.black)
sleep (.1)
rs.setBundledOutput("right", colors.lightgray)
sleep (.1)
rs.setBundledOutput("right", colors.red)
sleep (.1)
rs.setBundledOutput("right", colors.blue)
sleep (.15)
rs.setBundledOutput("right", colors.yellow)
end

Please help as quick as you can. There's a deadline!

-mumble118
dissy #2
Posted 01 January 2013 - 11:45 AM
The "end" at the end is causing the EOF error, since there is nothing to start a new block that needs to be ended.
Just take that out and it should work fine.
mumble118 #3
Posted 01 January 2013 - 11:52 AM
It now just says 'new:5: bad argument: int expected, got nil' What do I do now?
Luanub #4
Posted 01 January 2013 - 11:55 AM
It is colors.lightBlue not colors.lightblue
dissy #5
Posted 01 January 2013 - 12:08 PM
I missed those too.

Both "lightblue" to "lightBlue"
and "light gray" to "lightGray"
mumble118 #6
Posted 01 January 2013 - 12:13 PM
It works now, Thank you Guys!
remiX #7
Posted 01 January 2013 - 01:17 PM
Instead of that code, writing all that out, there is a way to loop through all the colours. If i remember, it's something like this:

for v in colors do
    rs.setBundledOutput("right", colours[v])
    sleep(0.1)
end
ChunLing #8
Posted 01 January 2013 - 01:50 PM
Hmmm…you don't need to check for type? Cause the colors table should contain functions too. Like:
for v in colors do
    if type(colors[v]) == "number" then rs.setBundledOutput("right", colors[v]) end
    sleep(0.1)
end
Though does anything bad happen if you don't check?