I have been going heavily into railcraft recently and have tasked myself with building the perfect train yard. That will probably never happen because I am not the best builder but I have been doing a couple of things recently which I thought were good enough to share with the community. Please bear in mind that this is a work in progress so and some of the programs are not very good (might be difficult to install properly in a new similar set up). Also I play in creative so I have been quite liberal with resource use. There might be more frugal ways of doing this. Also the forums don't handle picture uploads very well.
I have written this up with pictures on imgur as well,
http://imgur.com/a/233eN
If you don't mind reading the wall of text below, I try to explain a cool system that unloads long trains at the same time, and measures and records the items that get unloaded.
Uses:
Railcraft
Computercraft
Open peripherals
Translocators
Buildcraft
Minefactory Reloaded
Computer controlled item depot
When a train pulls up the first thing it does is go over a line of train detectors set up to emit redstone on trains of different lengths, from 3 to 7. Trains can consist of a locomotive at the front, anywhere between 1 and 5 chest carts in the middle and an anchor cart at the end. The train detectors are hooked up with rednet cable to a computer and the computer waits for a redstone event. Depending on the length of the train, the computer receives a different coloured signal so it knows how long the train is. This will be important later.
Meanwhile the train also passes a routing detector. I will skip over that for now.
After going round a short loop the train hits a holding track and the chest carts line up next to some advanced item unloaders. I used advanced because it allowed me to make a cleaner build but normal ones will work the same. The tracks were laid on top of item detectors that were each lined up just the same as the unloaders so each chest cart was being acted on by one detector and one unloader. The unloaders detected empty chest carts.
The detectors were hooked up to the same computer that i mentioned earlier (that measures the train length) using rednet cable. It is important that each detector is on a different colour.
The computer is also controlling the holding track for the locomotive. When it detects that all chest carts are empty it lets the locomotive go. It needed to test for the train length for two reasons. It is a practical way of letting the computer know that a train has arrived and it needs to start doing its thing, and also it needs to know how many signals from the item detectors it needs to AND together to let the train go. My program can support a train with between 1-5 chest carts and a loco and anchor at wither end. Meanwhile, the unloaders deposit the items into iron chests and they are then quickly piped out using diamond autarchic gates (for speed) into a pair of diamond chests. Those diamond chests are wrapped to another computer as peripherals. The same computer also needs a wireless modem and a printer. I managed to upload this picture to demonstrate. (Ignore the logistics pipes they aren't doing anything).
That computer is also connected to a large mfr rednet network (including a controller). That network is kept seperate from the one that the other computer was using with the detectors. This picture will hopefully show you that there are two seperate rednet networks.
When the locomotive leaves the holding track it immediately passes a detector which triggers the second computer into action. The second computer immediately sends out a redstone signal which is inverted by a rednet controller to turn off another holding track stopping the locomotive. It is only temporary (just while the computer finishes its short job to - it is a preventative measure coupled with some signalling to make sure I don't have loads of trains arriving at once).
Then the computer sleeps for a bit to allow all the items to fill up the diamond chests. Using open peripherals I could iterate through each slot in the chests and get the name and amount of the items within. This data is compiled into a large table. When two slots are occupied by the same item, e.g there is 64 iron ore in slot 1 and slot 2, the contents of each slot are added together. Then, using a printer I print out that information and record the time and date. I also give the inventory a unique key (not important it was just for fun). The last component of the book is sorted out by the routing detector.
Right now I only have one routing detector but I plan on having more, one for each train I have going through this depot. The train I have set up is meant to carry ores to the facility for processing. It is given a ticket which says
Dest=CloudyMountainItemDepot/Ores
Every train that goes through here will have the CloudyMountainItemDepot bit on there ticket but the bit after the dash gives some info about what they are carrying. I have a routing table inside the detector which matches the ticket and when a matching train goes past it outputs a redstone signal which is measured by a pair of computers. I have used a pair of them because of the way I chose to record it (it is probably not the best way, but it works well enough). The first stores a redstone signal based on which detector gets fired. It will only change its output if it gets a reset command or if its redstone input changes and it the input is nonzero (to get around the fact that the detectors only pulse). The second computer takes that redstone signal and uses it to decide what the cargo is. In this case it sets the trains cargo id to "Raw ore delivery". It stores that information until it is requested by the printer computer, at which point it starts again and commands the detector computer to refresh as well.
Then the whole book gets printed (I haven't automated crafting the books yet or removing stuff from the printer, but you can do that however you want). The computer sends out a redstone signal that triggers a translocator to empty the diamond chests into the sorting system and it waits until the chests are empty. I have used buildcraft gates to emit redstone when the chests are empty. The signals from the two gates are anded by the rednet controller and when both chests are empty the train is properly released and the system resets.
I then get a nice book like this
It has a title. CMD stands for cloudy mountain depot and the code is the unique identifier.
As an aside, I used two different types of copper ore when I ran this test and it added the amounts together properly inside the same entry!
Finally, some item names are too long to fit onto a line on the page so I took a special measure against that should a name be too long
I just need to test my computer programs properly and then I will post pastebin links for them should any of you wish to use them. I will also put together an imgur album to explain it a bit better.
EDIT: OK I have tested my programs and they all work fine together (or at least I hope they do). I will include the pastebins below for each of the four computers I have used. They should work but the set up might be a bit tricky. I haven't designed them to be extremely user friendly because I did not expect to put them up one day. However it shouldn'y be too difficult if you use the pictures from the upcoming imgur album to help, especially if you can read the code.
Cargo Taker = [url]http://pastebin.com/j78rdihh[/URL]
Important EDIT: About 10 minutes ago I realised I forgot to take a break out that I was using during testing. I missed it because I am a derp. I don't think anyone has downloaded this yet but if you have, either get the new version using the new code or go to line 253 and remove the word break. Sorry.
This computer is the one that reads the chest inventories and prints the contents out. It also uses a wireless modem. I have written it so that the chests are on the top and right, the printer is on the left, the modem is on the bottom and the rednet cable is on the back. You will have to change the code manually if you want to put the peripherals on different sides (the same goes for the other programs).
Routing Redstone Reader = 2ssAtrkn
This computer is connected via rednet cable on the top to a line of routing detectors and on the right it has a rednet connection to the Train Identifier computer. There is also a modem on the back.
Train Identifier = Q71RjLat
Uses the signal put out by Routing redstone reader to name the cargo. Rednet connection on the left, modem on the back.
Unloader Manager = 6g4Aw0DT
Seperate from the inventory scanning network, this computer makes sure that the whole train gets completely emptied before sending it off. This can function independantly of the other three programs. Rednet cable goes on the bottom, the lockdown track must be placed on top of the computer.
The imgur album will probably come tomorrow.
I have written this up with pictures on imgur as well,
http://imgur.com/a/233eN
If you don't mind reading the wall of text below, I try to explain a cool system that unloads long trains at the same time, and measures and records the items that get unloaded.
Uses:
Railcraft
Computercraft
Open peripherals
Translocators
Buildcraft
Minefactory Reloaded
Computer controlled item depot
When a train pulls up the first thing it does is go over a line of train detectors set up to emit redstone on trains of different lengths, from 3 to 7. Trains can consist of a locomotive at the front, anywhere between 1 and 5 chest carts in the middle and an anchor cart at the end. The train detectors are hooked up with rednet cable to a computer and the computer waits for a redstone event. Depending on the length of the train, the computer receives a different coloured signal so it knows how long the train is. This will be important later.
Meanwhile the train also passes a routing detector. I will skip over that for now.
After going round a short loop the train hits a holding track and the chest carts line up next to some advanced item unloaders. I used advanced because it allowed me to make a cleaner build but normal ones will work the same. The tracks were laid on top of item detectors that were each lined up just the same as the unloaders so each chest cart was being acted on by one detector and one unloader. The unloaders detected empty chest carts.
The detectors were hooked up to the same computer that i mentioned earlier (that measures the train length) using rednet cable. It is important that each detector is on a different colour.
The computer is also controlling the holding track for the locomotive. When it detects that all chest carts are empty it lets the locomotive go. It needed to test for the train length for two reasons. It is a practical way of letting the computer know that a train has arrived and it needs to start doing its thing, and also it needs to know how many signals from the item detectors it needs to AND together to let the train go. My program can support a train with between 1-5 chest carts and a loco and anchor at wither end. Meanwhile, the unloaders deposit the items into iron chests and they are then quickly piped out using diamond autarchic gates (for speed) into a pair of diamond chests. Those diamond chests are wrapped to another computer as peripherals. The same computer also needs a wireless modem and a printer. I managed to upload this picture to demonstrate. (Ignore the logistics pipes they aren't doing anything).
That computer is also connected to a large mfr rednet network (including a controller). That network is kept seperate from the one that the other computer was using with the detectors. This picture will hopefully show you that there are two seperate rednet networks.
When the locomotive leaves the holding track it immediately passes a detector which triggers the second computer into action. The second computer immediately sends out a redstone signal which is inverted by a rednet controller to turn off another holding track stopping the locomotive. It is only temporary (just while the computer finishes its short job to - it is a preventative measure coupled with some signalling to make sure I don't have loads of trains arriving at once).
Then the computer sleeps for a bit to allow all the items to fill up the diamond chests. Using open peripherals I could iterate through each slot in the chests and get the name and amount of the items within. This data is compiled into a large table. When two slots are occupied by the same item, e.g there is 64 iron ore in slot 1 and slot 2, the contents of each slot are added together. Then, using a printer I print out that information and record the time and date. I also give the inventory a unique key (not important it was just for fun). The last component of the book is sorted out by the routing detector.
Right now I only have one routing detector but I plan on having more, one for each train I have going through this depot. The train I have set up is meant to carry ores to the facility for processing. It is given a ticket which says
Dest=CloudyMountainItemDepot/Ores
Every train that goes through here will have the CloudyMountainItemDepot bit on there ticket but the bit after the dash gives some info about what they are carrying. I have a routing table inside the detector which matches the ticket and when a matching train goes past it outputs a redstone signal which is measured by a pair of computers. I have used a pair of them because of the way I chose to record it (it is probably not the best way, but it works well enough). The first stores a redstone signal based on which detector gets fired. It will only change its output if it gets a reset command or if its redstone input changes and it the input is nonzero (to get around the fact that the detectors only pulse). The second computer takes that redstone signal and uses it to decide what the cargo is. In this case it sets the trains cargo id to "Raw ore delivery". It stores that information until it is requested by the printer computer, at which point it starts again and commands the detector computer to refresh as well.
Then the whole book gets printed (I haven't automated crafting the books yet or removing stuff from the printer, but you can do that however you want). The computer sends out a redstone signal that triggers a translocator to empty the diamond chests into the sorting system and it waits until the chests are empty. I have used buildcraft gates to emit redstone when the chests are empty. The signals from the two gates are anded by the rednet controller and when both chests are empty the train is properly released and the system resets.
I then get a nice book like this
It has a title. CMD stands for cloudy mountain depot and the code is the unique identifier.
As an aside, I used two different types of copper ore when I ran this test and it added the amounts together properly inside the same entry!
Finally, some item names are too long to fit onto a line on the page so I took a special measure against that should a name be too long
I just need to test my computer programs properly and then I will post pastebin links for them should any of you wish to use them. I will also put together an imgur album to explain it a bit better.
EDIT: OK I have tested my programs and they all work fine together (or at least I hope they do). I will include the pastebins below for each of the four computers I have used. They should work but the set up might be a bit tricky. I haven't designed them to be extremely user friendly because I did not expect to put them up one day. However it shouldn'y be too difficult if you use the pictures from the upcoming imgur album to help, especially if you can read the code.
Cargo Taker = [url]http://pastebin.com/j78rdihh[/URL]
Important EDIT: About 10 minutes ago I realised I forgot to take a break out that I was using during testing. I missed it because I am a derp. I don't think anyone has downloaded this yet but if you have, either get the new version using the new code or go to line 253 and remove the word break. Sorry.
This computer is the one that reads the chest inventories and prints the contents out. It also uses a wireless modem. I have written it so that the chests are on the top and right, the printer is on the left, the modem is on the bottom and the rednet cable is on the back. You will have to change the code manually if you want to put the peripherals on different sides (the same goes for the other programs).
Routing Redstone Reader = 2ssAtrkn
This computer is connected via rednet cable on the top to a line of routing detectors and on the right it has a rednet connection to the Train Identifier computer. There is also a modem on the back.
Train Identifier = Q71RjLat
Uses the signal put out by Routing redstone reader to name the cargo. Rednet connection on the left, modem on the back.
Unloader Manager = 6g4Aw0DT
Seperate from the inventory scanning network, this computer makes sure that the whole train gets completely emptied before sending it off. This can function independantly of the other three programs. Rednet cable goes on the bottom, the lockdown track must be placed on top of the computer.
The imgur album will probably come tomorrow.
Last edited: