Jump to content

Retriever with computercraft?


scizo

Recommended Posts

Im trying to make an automated Tavern , for example u go to the computer, the computer asks u what u wanna order. press 1 for coffee 2 for rum etc

when u press 1 the retriever go gets the coffee from the right chest with a tube to you. is that possible?

Link to comment
Share on other sites

Yes but you are going to need to learn to write LUA. The best way I can think of doing this would be a series of filters (one for each item) hooked up to RedPower wire which is attached to the computer via bundled wire.

Program is quite simple:

If userInput == 1:

(activate appropriate filter and what ever else you want)

elseif userInput == 2:

and so on and so forth.

Link to comment
Share on other sites

I think computercraft understands it by itself. I THINK (but haven't tested) that if you put it like this:

y

[C]====r

g

(C for computer, = for bundled, y/r/g for colored redstone wire)

the computer will read that as y, r and g connected.

I don't know if the computer can understand item id's in a simple way, can they that?

Link to comment
Share on other sites

Computer doesn't need to understand item id's. Lets say you use red insulated wire to connect to the chest with coffee and coffee is option 1. The bundled cable is connected to the top in this example (the insulated redwire is attached to the bundled cable).

if input == "1" then

rs.setBundledOutput("top", rs.getBundledOutput("top") + colors.red)

pause (1)

rs.setBundledOutput("top", rs.getBundledOutput("top") - colors.red)

Your filter only needs a pulse. You could even stick it into a loop that counts to the amount of coffee that has been order. So you can take out the right amount.

If you want to stick more item types in a chest, you could use seperate filters on the chest' sides, each assigned to a different insulated redwire colour and item.

Link to comment
Share on other sites

I'm not sure what you mean with awkward. You need to be able to specify the right colour in the bundled cable if you want to do something with it. Redstone signals can only be turned on or off and can't look into inventories as far as I know.

You can code names to item id's, but the computer can't 'look' into chests without additional items that already have that function (like a redpower filter or regulator etc). It is supposed to act like real computers. Your computer can't look into a chest either without the help of specific peripherals. Think of the machines in minecraft that you control with your computer as peripheral equipment.

Link to comment
Share on other sites

It's awkward as in it requires a huge setup that, if you have maybe 20 different kinds of food, will be larger than the tavern itself.

I don't know how retrievers work though, I've never used them - I thought maybe they could pick items based on item ID.

I've got one question though - if someone can help me. I'm trying to set up a remote system for controlling my nuke plant, and have a few wireless transmitters hooked up to colored cables, going through a bundled cable into the computer.

When I type a certain command, I want it to switch a certain color on. This is the code right now:

input = read()

if input = "lights" then

redstone.setBundledOutput (back, color.lightblue)

end

So, the error message I get is this:

program:37: attempt to index ? (a nil value)

(line 37 is the redstone line).

Anyone know what I do wrong?

Link to comment
Share on other sites

The side of the computer you use is supposed to be a string. And it is colors.lightBlue , not color.lightBlue .Can also use colours btw.

input=read()

if input="lights" then

redstone.setBundledOutput("back",colors.lightBlue)

end

Keep in mind that this command turns the other colours off if you have connected those. If you just want to control lightblue and not mess with other attached colours, you might want to use :

input=read()

if input="lights" then

redstone.setBundledOutput("back", rs.getBundledOutput("back")+colors.lightBlue)

end

and to turn off just lightblue:

redstone.setBundledOutput("back",rs.getBundledOutput("back")-colors.lightBlue)

There are other ways too if you want to call a function that does this annoying long syntax for you and you just add or substract the colours at input.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...