Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

praryboy

Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by praryboy

  1. This forum is very helpful, thank you very much for your responses.

     

    In case you didn't notice (because maybe I check github too much), there's now a way to get all the bundled redstone values at once: just don't pass in a color to the getBunldedInput (or getBundledOutput) method. https://github.com/MightyPirates/OpenComputers/commit/ffd38e59ff373e63a204314475de829383523b56

    Authored 3 days ago
    

    Awesome, I was just about to update OC anyway.

  2. I am using a Tier 2 card. The problem is not that I can't get the value of the color cable. The problem is that the color is not returned by the redstone_changed event, so you have to loop through all the colors calling getBundledInput() on each looking for the one that changed. If the change was initiated by a normal wooden button on the white channel, for example, unless the code is fast enough, there is a good chance the button has turned off already by the time the code gets to checking the white cable.

     

    What I've managed to do since posting the question is create a loop that quickly calls getBundledInput() on all the colors and puts it in a table, which I can then use the slower loop to search through. It works 90% of the time, so it will do for now.

     

    I doubt this is the right place to post this, but I'd really like for the redstone_changed event to return the color as well as the value, or failing that a function in the redstone api that returns a table with the values of all the colors at once. Otherwise many systems that only give short pulses over redstone essentially can't be monitored effectively, as the pulse would be long over by the time the computer can react to it. 

  3. I am building a simple microcontroller to use as a sort of toggle latch. The idea is I'll have multiple buttons connected to different colored wires connected to the input, and pressing one will set that color to ON on the output until the user presses a different button.

     

    The problem is the redstone_changed event doesn't pass back which color initiated the event, and in the time it takes for a For loop to iterate through the colors and find the one that is currently ON, it has already turned OFF again (minecraft buttons only issue a pulse for a moment). Is there any way to get the color that initiated the redstone_changed event or a way to get a snapshot of the current input of all colors that I can then iterate through, or any other solution?

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.