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

Hello, Pro. Nubs got a question :)

Started by MatuOlen, 10 October 2012 - 05:23 PM
MatuOlen #1
Posted 10 October 2012 - 07:23 PM
Hello!

So I am building a coffee shop similar to this one: http://www.youtube.com/watch?v=K3FIlu2-Xq8

I have the coffee making system done, so far only one type.
I am stuck with the computer part of it.
The goal seems to have three wires going from under 3 different buttons to a computer, which tells filters and deployers, which coffee will be made.
And the most confusing part: how can I make the screen comment on the progress?

If I find help from here, I will be very VERY happy!
MatuOlen #2
Posted 10 October 2012 - 07:51 PM
So, as I understand, first thing I need to know is how to use
rs.setBundledInput and rs.setBundledOutput
Right?
And also create a folder and a file?
Cozzimoto #3
Posted 10 October 2012 - 08:09 PM
have the three buttons go to a computer to read the input and output the correct wires to the filters and deployers to make the coffee the customer wants. and as for the monitor you would have to wrap the monitor and just run a update on the screen everytime a redstone signal changes on the computer input. that way if the system is idle it wont waist time doing a refresh when it doesnt need to.

put the wrap in a var so you can just call it and write stuff directly on the monitor itself

Mon = peripheral.wrap( side )

Mon.write("Cozzy is awesome!")
MatuOlen #4
Posted 10 October 2012 - 08:17 PM
Okay, You got time for some questions out of concusement? :P/>/>
Doyle3694 #5
Posted 10 October 2012 - 08:39 PM
I've got time, that's why I exist.
MrZuribachi #6
Posted 10 October 2012 - 08:47 PM
Well one important think you should know is that I think bundled outputs can only be set once. If your for example set the red bundled output to true, all other bundles from this side will turn off. For example:
You tell the computer to set the backward's green bundled output to true. The green one will turn on.
Then you set the computer's backward's red bundled output to true. The green one will turn off and the red will turn on at the same time.

That's how I think about it, although I'm also quite new to computer craft and red power. I'm not sure whether it helped you or not, but it was just a try worth.
MatuOlen #7
Posted 10 October 2012 - 08:52 PM
Holy crap. Do I have any hope at all if this is all very confusing right now?
And also, is it like
Cold Coffee button - Red Alloy Wire - White Insulated Wire - Bundled wire - Computer - Bundled Wire - AND THEN white insulated wires to machines that will make cold coffee?
And 2 other colors for 2 other coffee types?
And are those item detectors that get information trough the computer to the monitor?
hooh..braindamage :P/>/>
MatuOlen #8
Posted 10 October 2012 - 09:02 PM
Also, if someone has nothing to do and wants to help in live, my server is running on Hamachi.

I would be pleased when someone joins in a few hours. Right now I am going to practice. Ill be back in 2 hours.
Thanks in advance!
Lyqyd #9
Posted 10 October 2012 - 11:10 PM
Well one important think you should know is that I think bundled outputs can only be set once. If your for example set the red bundled output to true, all other bundles from this side will turn off. For example:
You tell the computer to set the backward's green bundled output to true. The green one will turn on.
Then you set the computer's backward's red bundled output to true. The green one will turn off and the red will turn on at the same time.

That's how I think about it, although I'm also quite new to computer craft and red power. I'm not sure whether it helped you or not, but it was just a try worth.

This is true, unless you're also using colors.combine, or otherwise creating an integer with multiple bits set high. Then you can output any combination of colors you see fit.
Cozzimoto #10
Posted 11 October 2012 - 02:11 AM
what you would want to do is store your current color that is on and place it in a var and if you want to turn on another color like red and keep green on you would have to do something like this


coffeeA= { colors.red, colors.green }

button1 = colors.combine(coffeeA[1] , coffeeA[2])

something along those lines, i didnt put much thought into it but just throwing out an example to try and help you out. each color has a binary color and computercraft has this neat api so you dont have to remember the binary numbers at all. binary for red is 16384 and green is 8192. when you setBundled output you are setting the binary of that output, to get multiple colors it adds the two numbers of the binaries together and that is exactly what colors.combine does. so to have red and green on at the same time would be binary 24576. hope this helps!
Cozzimoto #11
Posted 11 October 2012 - 02:28 AM
you can have three inputs for three different coffee, like button1 button2 and button three and you an make those represent a color when the button is pressed it can output a certain color combination to turn on the machines to make a that certain coffee type.

buttonStates = { colors.white, colors.orange. colors.magenta }
currentInputState = rs.getBundledInput("top")
coffee = { type1, type2, type3 }
combinations = {
	type1combo{ colors.red , colors.green, colors.white },
	type2combo{ colors.black, colors.green, colors.cyan },
	type3combo{ colors.brown, colors.yellow, colors.lime }
}
i would recommend placing everything in a table so you can reference it later and control what should be on and off at any given time.

so to activate type1 to make coffee A that would kindof look like the following


if currentInputState == buttonStates[1] then
    rs.setBundledOutput("back", colors.combine(combinations[1]type1combo[1], combinations[1]type1combo[2], combinations[1]type1combo[3]))
end
this is only if one of the inputs would be turned on

i know this is very basic, and you can expand on it and make the code more neat but for demostration purposes i feel like setting it up this way would work for you.