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

Gate Reader Tutorial

Started by GamerNebulae, 04 August 2013 - 08:57 AM
GamerNebulae #1
Posted 04 August 2013 - 10:57 AM
For the people that never heard of a Gate Reader. It's part of the MiscPeripherals mod and works the same as a Gate from BuildCraft. The only difference is that this one can be computer controlled. Ofcourse a Gate can be too, but that would only be possible with a standard Gate and with redstone pulses. This Gate Reader is alot more efficient and can detect everything and is rather inexpensive to make.

There is a ton of information a Gate Reader can give to you. This is passed in tables. For a good tutorial about tables, look here: http://lua-users.org/wiki/TablesTutorial

To diagnose what information the object can give you, you can use this code:

--# This is just demonstrative code!
m = peripheral.wrap("right")
data = m.get() --#This will give you the table
--# Now to print the table, you need a for loop that will use pairs.
for i,j in pairs(data) do
  print(tostring(i)..": "..(j))
end

Let's say you want to check if a chest is full (I handled this question in the 'Ask a Pro' section) and want to emit a redstone pulse when it is full. You need to check if a value in the table 'data' equals "Inventory Full" (exactly spelled like that). That would look like this:

if data["Inventory Full"] then --#You don't need == true, it already checks if it is true
  rs.setOutput("back", true)
  sleep(1)
  rs.setOutput("back", false)
end

If you want to see any improvements, please tell me.
LayZee #2
Posted 16 October 2013 - 07:48 PM
Please describe to me and/or show me how to attach/place the Gate Reader. I have been unable to get it working, ever.
GamerNebulae #3
Posted 19 November 2013 - 03:29 AM
Please describe to me and/or show me how to attach/place the Gate Reader. I have been unable to get it working, ever.

Just place it next to Computer (doesn't matter if it is an advanced computer) and wrap the peripheral. Please use the script above, but change the side where the peripheral is attached to. Note that it doesn't matter on which side of the block you attach the chest to.
theoriginalbit #4
Posted 19 November 2013 - 06:48 AM
Just place it next to Computer (doesn't matter if it is an advanced computer) and wrap the peripheral. Please use the script above, but change the side where the peripheral is attached to. Note that it doesn't matter on which side of the block you attach the chest to.
Perhaps if you have to explain this you should put it into the tutorial. A good tutorial covers all bases and gives as much information as possible. This tutorial definitely could do with some work. Strive to end up with something like this, or this, making sure to go into detail and providing images whenever possible, as the old saying goes, an image is worth 1000 words…