#Dealing with redstone.

1 messages · Page 1 of 1 (latest)

candid dawn
#

I have the following test script:

static powerRedstoneBlock(block) {
    const powered = block.typeId.replace("unpowered", "powered");
    const permutations = block.permutation.getAllStates()

    block.setType(powered)

    for (const [key, value] of Object.entries(permutations)) {
        block.setPermutation(block.permutation.withState(key, value));
    }

    block.setPermutation(block.permutation.withState("redstone_signal", 15));
}

But no matter what I do, I can't get it to cascade/start the chain. It only ever works for one block in the chain. Doing it to repeaters and comparators does nothing except light them up for a second (no signal is emitted to linked redstone). Any ideas, or is having a system that hooks up to redstone a pipe dream still?

lavish epoch
candid dawn
#

like yes it's something I could do, but also that changes literally nothing with the issue I want to fix

#

and you got my hopes up when I saw an @ 😭

small helm
#

You can't do anything about that ig

candid dawn
surreal sierra
#

ah yes, an unpowered powered cable

vernal tinsel
#

you could use a breadth first search to power the redstone manually and cascade the logic, but that could be resource intensive

#

if you dont know what it is is basically you have 2 variables to hold data - one to hold visited blocks the other is a queue of blocks to visit. you visit the first redstone block, add it to visited and add its neighbords to the queue, then go to the next block in the queue in a while loop and do the same, untill the queue becomes empty

candid dawn
vernal tinsel
#

Yeah figured