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

Touchscreen, Only One Button Can Be On

Started by cartmen180, 30 July 2013 - 05:59 PM
cartmen180 #1
Posted 30 July 2013 - 07:59 PM
Hello mighty gurus of computercraft :P/>
I am trying to write a light control program than can handle multiple lights. So far everything works but, and this is a big but, i can only have 1 light on at the time.

here is the pastebin: http://pastebin.com/ZF76tLKH

any help would be greatly appreciated, have been trying for 6 hours why I can only have one light on at the same time.


p.s. I can turn lights on and off. I can have them all off but only 1 can be on.
(if you want to run it you need a 3x2 advanced screen)

edit: everytime i startup the program it doesn't show the on/off buttons. It writes them on the screen after i clicked their positions on the monitor.
cartmen180 #2
Posted 31 July 2013 - 05:20 AM
noone has a clue? :(/>
apemanzilla #3
Posted 31 July 2013 - 07:04 AM
Do you mean you want more than one on, but only on turns on, or you want only one on at a time but more are on?
cartmen180 #4
Posted 31 July 2013 - 07:31 AM
i want any combination possible. At this time only one button can be on and i cant figure out why.
MR_nesquick #5
Posted 31 July 2013 - 06:34 PM
I was bored and needed a challenge, so i made a button program.(the world totally needed one)

only thing you need to do is add the right color.numbers and maybe some miner adjustment's.i wasn't sure if the numbers under 'corridors' and 'staircases' was input or output so i every thing output.

:)/> good luck :)/>

edit: updated. now works with BoundleCables.
pastebin get ZP8M2W98 <name>
http://pastebin.com/ZP8M2W98



old..
Spoilerhttp://pastebin.com/DKVQPZz5

pastebin get DKVQPZz5
MR_nesquick #6
Posted 01 August 2013 - 01:41 PM
Did you test this code at all?

Maybe the set/getBundledOutput routines have changed and the wiki not updated, but based on what I'm reading they don't do the bitwise operations for you. That means that one way or another you need to manage the bit settings on your own and then pass the resulting value to setBundledOutput in order to achieve the desired result.

i do test my programs and it works. not sure what you are talking about tough.
MR_nesquick #7
Posted 01 August 2013 - 04:50 PM
turn false and run
rs.setBundledOutput("back",num)
too lazy to spot that.. :P/>
i did try something and i did forget that…