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

Starting with the apology, this should be an easy answer.

Started by ff255away, 25 November 2012 - 01:54 PM
ff255away #1
Posted 25 November 2012 - 02:54 PM
even messed up the title, its an error message of:
bios:338: [string "test"]:4: '<eof>' expected

I am trying to set up something that, after entering the program name, sends a redstone signal, waits, stops sending the redstone signal, and then stops the program. It is for a simple IC2 breeder reactor, and I want to avoid wasting fuel. The current code I've written is this:

redstone.setOutput("back",true)
sleep( 1420 )
redstone.setOutput("back,false)
end

This is a really simple program, which means that I'm missing something that should be hitting me in the face. My only prior programming experience is Forth, with Eloraam's computers, but redpower isn't currently in the FTB pack.
Kingdaro #2
Posted 25 November 2012 - 03:03 PM
This script made me panic a bit.

On line 2, the sleep amount is in seconds, not milliseconds. Change that value to 1.42, or just 1.5 if you don't really care about being specific.

On line 3, you're missing a second quote on the string "back".

On line 4…there shouldn't be a line four. That "end" shouldn't be there.
ff255away #3
Posted 25 November 2012 - 03:10 PM
On line 2, thats the sleep I need for the reactor to fully charge one round of depleted uranium- its a little over 23 minutes.

On line 3, thats a typo not found on the program (its on a server, so no copypaste).

Will delete "end" from line 4.

And… it works, now (ran a test for 5 seconds). Thank you, Kingdaro!
Expenox #4
Posted 25 November 2012 - 04:01 PM

redstone.setOutput("back", true)
sleep(1.42)
redstone.setOutput("back", false)