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

Program None Responsive

Started by Scorp, 21 June 2015 - 05:05 AM
Scorp #1
Posted 21 June 2015 - 07:05 AM
So, I'm lost and out of ideas :(/> , any help would be great. I just finished editing a program to control a majority of the things in my house. It uses the Touchpoint API.

What it is doing:

When I run the program, it loads fine. It will switch between menus just fine. The "Back" button works flawlessly. But for some reason when I hit any other button, it doesn't work properly.

For example, if I hit "Door" from "Main Menu", it takes me to the "Door Menu". From here I hit the "Open" button, and it opens the door as it should. But here is the issue, when I hit the "Close" button, nothing happens. So it seems like the buttons work to turn on, but do not turn off. Where did I go wrong?

Code is located here:

http://pastebin.com/MSnd0uj1

By the way, Props Lyqyd on the amazing API!
Scorp #2
Posted 21 June 2015 - 07:48 AM
Omg. I feel dumb, I figured it out. I had:

rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom", 1))) – for white wire

needed:

rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), 1)) – the ) is what killed it >.<
Creator #3
Posted 21 June 2015 - 09:06 AM
There is always that bug that has been stopping you for days and then when you resolve it, you feel like "how did I overlook this".

Why do you use colors.combine? Yiu've only provided a single color.
Scorp #4
Posted 21 June 2015 - 10:01 AM
the full program uses several different colors
and using rs.setBundledOutput("bottom", 0) would shut off all others that are on, so this is the only way i could think of to keep it from happening.
Lyqyd #5
Posted 21 June 2015 - 05:44 PM
Scorp, on 21 June 2015 - 10:23 AM said:
I was wondering if you could assist me with monitoring power within my program at "realtime".

Here is what I have: http://pastebin.com/MSnd0uj1

I added this:

function rsStored()
page3:flash("Stored: "..cellStored)
powerMenu()
end

to try and get it to refresh what it is reading but it doesn't do like I was hoping. Any help would be great!

Thanks, Scorp

I'll reply to this question here. You'll likely want to be renaming the button, not flashing it. In the code, you're only grabbing the stored value once, at the very top of the code. You'll want to grab that value again and rename the button (possibly keeping the same name via the table renaming way, see the Touchpoint documentation) to update the displayed value.
Scorp #6
Posted 21 June 2015 - 06:55 PM
Hmm, okay. Ill give it a shot.

Any suggestions on how to go about it, before I really start messing things up?
Lyqyd #7
Posted 22 June 2015 - 06:09 AM
So, if you declared your Stored button like so:


page3:add("Stored", rsStored, 4, 5, 32, 9, colors.pink, colors.lime)

You could rename it like so (pastebin link to preserve whitespace): http://pastebin.com/HHumC6h3

Note that if you use the table renaming method, it has to exactly match the area the button takes up on the screen.