Jump to content




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


  • You cannot reply to this topic
13 replies to this topic

#1 bbqroast

  • Members
  • 124 posts

Posted 27 July 2012 - 08: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:
Posted Image
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.

#2 Mendax

  • Members
  • 366 posts

Posted 27 July 2012 - 11:08 AM

Isn't CC currently 1.33? Anyway looks cool.

#3 bbqroast

  • Members
  • 124 posts

Posted 27 July 2012 - 11:53 PM

View Postmrminer84403, on 27 July 2012 - 11:08 AM, said:

Isn't CC currently 1.33? Anyway looks cool.
My bad :)/>.

#4 bbqroast

  • Members
  • 124 posts

Posted 28 July 2012 - 10: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 :)/>.

#5 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 28 July 2012 - 10:47 AM

Go and edit your first post then click on Use full editor.

#6 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 28 July 2012 - 12:02 PM

I just edited it to read 1.33+ for you :)/>

#7 bbqroast

  • Members
  • 124 posts

Posted 29 July 2012 - 06:08 AM

View PostCloudy, on 28 July 2012 - 12:02 PM, said:

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.

#8 bbqroast

  • Members
  • 124 posts

Posted 03 August 2012 - 11:05 PM

Me thinks I have a working SMP build.

#9 wjykk

  • Members
  • 10 posts

Posted 09 August 2012 - 07:12 PM

Does it support carts from other mods, e.g. Railcraft or the Trains Mod, as they will also trigger a block update?

#10 Loopin

  • Members
  • 31 posts

Posted 11 September 2012 - 04:59 PM

Can you do an example of program?

#11 giodamelio

  • Members
  • 3 posts

Posted 25 September 2012 - 10:33 PM

View Postbbqroast, on 27 July 2012 - 08:13 AM, said:

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.

#12 bbqroast

  • Members
  • 124 posts

Posted 06 October 2012 - 08:09 PM

View Postgiodamelio, on 25 September 2012 - 10:33 PM, said:

View Postbbqroast, on 27 July 2012 - 08:13 AM, said:

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.

#13 rickydaan

  • Members
  • 93 posts
  • LocationThe Netherlands

Posted 02 December 2012 - 02:22 AM

Update please?

#14 RichardG867

  • Members
  • 196 posts

Posted 02 December 2012 - 02:34 AM

It will be on MiscPeripherals, but will be improved and won't work the same way.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users