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

[MC 1.2.5 | CC 1.33/1.4] Digital Rail Reader. Monitor those carts!

Started by bbqroast, 27 July 2012 - 07:13 AM
bbqroast #1
Posted 27 July 2012 - 09:13 AM
What is it?
The digital rail reader is a peripheral for computer craft. It consists of a single block that, when given a block update will check for a Minecart above it. It will then queue an event for the Computer it is bound to containing all sorts of juicy information.
How do I use this magic?
Simply place the Minecart reader next to a computer, then place a detector rail on top of the Minecart reader. When a cart goes over the rail it will trigger a block update, the reader will get information from the cart and queue it in an event.
Installation
You need CC 1.34 installed (along with Forge obviously).
1. Place the zip in your .minecraft/mods/
2. Run Minecraft
3. If you get an error along the lines of "Slot x is already occupied when adding…" then you have an ID conflict. In the .minecraft/config/DigitalRailReader/ folder there should be a main.cfg text file. Open it with notepad (or any other plain text editor) and change the block ID for "block" to something else (a number between 120ish-255). Run Minecraft again. Rinse and repeat until you find a block ID which is clear.
Crafting
O - Iron
R - Redstone
T - Redstone Torch

ORO
TOT
OOO
Parameters
Using os.pullEvent() you will get the following parameters back:

Note 1: The username param will only be returned if occupied is true.
Note 2: entityID is a unique ID given to each entity, use for tracking Minecarts.
Download
Client:
http://www.mediafire...25atx2rf022o4r2
Todo
1. Port to SMP (priority).
2. Carts seem to be double registering, I might have to implement some sort of debounce feature.
3. Investigate giving the contents of a chest cart and the fuel span of a funai cart.
Mendax #2
Posted 27 July 2012 - 12:08 PM
Isn't CC currently 1.33? Anyway looks cool.
bbqroast #3
Posted 28 July 2012 - 12:53 AM
Isn't CC currently 1.33? Anyway looks cool.
My bad :)/>/>.
bbqroast #4
Posted 28 July 2012 - 11:26 AM
Seems to be working with 1.4. Except my consoles have all frozen up (seems to be a Windows thing, happened to both my installs simultaneously when I set quantum run on one of them to capslock before using a computer. Weird as hell) so I haven't been able to test it really (but no errors?).

Does anyone know how to change the title of a thread?
UPDATE: Works fine! (Yay!). Above question still needs answering :)/>/>.
xuma202 #5
Posted 28 July 2012 - 11:47 AM
Go and edit your first post then click on Use full editor.
Cloudy #6
Posted 28 July 2012 - 01:02 PM
I just edited it to read 1.33+ for you :)/>/>
bbqroast #7
Posted 29 July 2012 - 07:08 AM
I just edited it to read 1.33+ for you :ph34r:/>/>
Thanks Cloudy!
Just edited it to read 1.33/1.4 (it seems to work fine on both, thanks for the tip xuma).
It seems carts get registered twice, I'll fix that ASAP (I just need to check if I'm registering the event twice, or having my event trigger twice). Working on SMP now… Hopefully.
bbqroast #8
Posted 04 August 2012 - 12:05 AM
Me thinks I have a working SMP build.
wjykk #9
Posted 09 August 2012 - 08:12 PM
Does it support carts from other mods, e.g. Railcraft or the Trains Mod, as they will also trigger a block update?
Loopin #10
Posted 11 September 2012 - 05:59 PM
Can you do an example of program?
giodamelio #11
Posted 25 September 2012 - 11:33 PM
Carts seem to be double registering, I might have to implement some sort of debounce feature.

This is because you get a block update both when the redstone activates and deactivates.
bbqroast #12
Posted 06 October 2012 - 09:09 PM
Carts seem to be double registering, I might have to implement some sort of debounce feature.

This is because you get a block update both when the redstone activates and deactivates.
My apologies. I'm pretty sure it checks for a redstone signal so the deactivating rail wouldn't trigger it, but I'll check anyway.
rickydaan #13
Posted 02 December 2012 - 02:22 AM
Update please?
RichardG867 #14
Posted 02 December 2012 - 02:34 AM
It will be on MiscPeripherals, but will be improved and won't work the same way.