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

Two Door Controller

Started by a1fonzo, 07 February 2014 - 11:51 PM
a1fonzo #1
Posted 08 February 2014 - 12:51 AM
The Two Door Controller


Created by: a1fonzo

Hello everyone,

Current Verison: 1.1

Features:
+Support for one or two doors
+Two modes - Player Detect and Toggle
-Toggle simply toggles the doors up or down
-Player Detect will detect when a player is nearby and open or close, can also be locked closed - Requires some sort of mod that supplies a player detector that can emit a redstone signal
+Configurable peripherals - Put your monitor, router, player detecter, etc. where you want them)
+Touch-screen monitor - Right-clicking the door's button opens or closes the respective door
+Functional display - Display changes colors as the doors open and close

Version History:
Spoilerv1.0 - Initial release
v1.0.1 - Updated forum post, optimized code (for now), added comments, fixed a bug that caused a delay with the update of the monitor
v1.1 - Now supports 1 or 2 doors, supports toggle mode or player detect for both doors, supports the ability to change what sides things are on, updated forum post

Planned Features:
Spoiler+A GUI to enter variables into
+Support for different size monitors
+Support for more than two doors
+Support for OpenPeripheral's Terminal Glasses

Pictures
SpoilerThe controller in my base.


The back door locked open and the front door on player detector mode.


The back door locked closed and the front door locked open.


Installation
SpoilerStep 1: Craft an advanced computer, 1 advanced monitor, 1 or 2 computers (depends on # of doors you want), 2 or 3 wireless routers, and some sort of door that is activated by a redstone signal (piston door, drawbridge door, regular door, etc.) In my pictures I am using drawbridges with iron bars. If you want player detect mode then you also need some sort of player detector that can emit a redstone signal.

Step 2: Place your advanced monitor where you want your display to go, place the advanced computer somehow connected to that and a wireless router somehow connected to your advanced computer. Then take your computers place them wherever you want and attach a router to them. Along with this attach redstone to the computer that will control the door and if you want player detect mode on then connect the player detectors to your computer as well. Be sure the various redstone components are not in a configuration in which they connect to each other, and they go into different sides.

Step 3: Next you need to label all of your computers and get their number IDs, I suggest naming the advanced computer "doorControl" and the door computers "door1" and "door2".

Step 4: Once you have the ID's, you need to download the programs enter this command into your advanced computer (pastebin get FEbBLuya doorControl) and enter this command into the door computers (pastebin get LeSwRDeW door) .

Step 5: Now in your advanced computer write edit doorcontrol, you will have to manually enter all of the variables until i come up with a way to do it automatically, just follow the instruction there. Do the same with the door computers except type in edit door, and edit those variables, again just follow the instructions.

Step6: Now that you have done that, save all of the variables and put all of these programs in the startup program and there you go it's done. Yay.

If you have any problems with the installation or the program in general, please post something here so that i can address it. Also any criticisms or suggestions are gladly accepted.

Pastebin Links
doorControl: http://pastebin.com/FEbBLuya
door: http://pastebin.com/LeSwRDeW

Thank you.
Edited on 08 February 2014 - 02:54 PM
a1fonzo #2
Posted 08 February 2014 - 12:54 PM
Hello everyone,

I have decided to take on the task of taking this code that i have initially wrote and expanding it to what I have outlined in the Plans for the Future section of the initial post.

Thank you.
a1fonzo #3
Posted 08 February 2014 - 01:55 PM
Updated the code:
v1.0.1 - Updated forum post, optimized code (for now), added comments, fixed a bug that caused a delay with the update of the monitor
a1fonzo #4
Posted 08 February 2014 - 03:55 PM
Update:
v1.1 - Now supports 1 or 2 doors, supports toggle mode or player detect for both doors, supports the ability to change what sides things are on, updated forum post