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

Need help with a ComputerCraft door

Started by 3ncrypt3d, 24 February 2014 - 11:35 AM
3ncrypt3d #1
Posted 24 February 2014 - 12:35 PM
Here's the dilemma that I'm in. I got and edited some code for a door on the internet, that uses a monitor button system. Only issue I have, is that a player has to manually toggle the button again, If anyone could help, I would be much appreciated. Here's the pastebin with the code: http://pastebin.com/51HYV1Xs
ClassicRockFan #2
Posted 24 February 2014 - 05:27 PM
I'm not sure if this will work because I can't test it but if you add in an os.reboot() after the gettouch(or whatever function it is) should solve the problem. Name the program startup of course. That's probably the easiest way I can think of to do it
Edited on 24 February 2014 - 04:28 PM
Bomb Bloke #3
Posted 24 February 2014 - 06:03 PM
Around line 158, we have:

      print("Touch on button: "..name)
      toggleBundledOutput(name)
      break

So to make it automatically toggle back after a few seconds, do:

      print("Touch on button: "..name)
      toggleBundledOutput(name)
      sleep(3)
      toggleBundledOutput(name)
      break
ClassicRockFan #4
Posted 24 February 2014 - 09:31 PM
I thought you meant te program had to be reset, not the door. Then in that case, do what bomb bloke said but instead of toggling a second color you have to toggle the number 0. You also need a side as an argument with the bundled outputs.
3ncrypt3d #5
Posted 24 February 2014 - 09:58 PM
Around line 158, we have:

	  print("Touch on button: "..name)
	  toggleBundledOutput(name)
	  break

So to make it automatically toggle back after a few seconds, do:

	  print("Touch on button: "..name)
	  toggleBundledOutput(name)
	  sleep(3)
	  toggleBundledOutput(name)
	  break

Worked for me, thanks :D/>