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

[1.6.4 / Cc1.57] Redstone Startup Bug

Started by Pinkishu, 15 November 2013 - 05:43 AM
Pinkishu #1
Posted 15 November 2013 - 06:43 AM
This bug seems to fit into a collection of bugs happening around startup
(also tested with 1.5.2 direwolf20 1.1.3 pack)


rs.setOutput("front",true)
print(rs.getOutput("front"))

will output "false", even though it should output true.
No, the delay between the 2 doesn't matter, if the program is run as a normal program it works without any issue, it just fails if it is the startup file and ran when you restart the computer (also ofc things started by the startup file)

So while

rs.setOutput("front",true)
sleep(0)
print(rs.getOutput("front"))
fixes it

sleep(0)
rs.setOutput("front",true)
print(rs.getOutput("front"))
does too, or running it from shell instead of from startup

(Note: this is a simplified version, the full example used bundled cables and a function to add or remove colors from the cable, uisng bit.band/bit.bor/bit.band and rs.getBundledOutput to work, ofc since getBundledOutput passed back 0 even though it was set to something else previously, it screwed up the process)
electrodude512 #2
Posted 17 November 2013 - 06:21 PM
The peripheral API also seems to be doing things like this for me on 1.5.2. I still should investigate more (and try a recent version of CC). This is probably related to a bug that probably still exists (and isn't really a bug) in which a computer would still be able to interact with peripherals after you broke its block until the it coroutine.yield()ed.