Jump to content




Hello, Pro. Nubs got a question :)

computer

10 replies to this topic

#1 MatuOlen

  • Members
  • 19 posts

Posted 10 October 2012 - 06:23 PM

Hello!

So I am building a coffee shop similar to this one:

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!

#2 MatuOlen

  • Members
  • 19 posts

Posted 10 October 2012 - 06: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?

#3 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 10 October 2012 - 07: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!")


#4 MatuOlen

  • Members
  • 19 posts

Posted 10 October 2012 - 07:17 PM

Okay, You got time for some questions out of concusement? :P/>

#5 Doyle3694

  • Members
  • 815 posts

Posted 10 October 2012 - 07:39 PM

I've got time, that's why I exist.

#6 MrZuribachi

  • New Members
  • 44 posts
  • LocationGermany

Posted 10 October 2012 - 07: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.

#7 MatuOlen

  • Members
  • 19 posts

Posted 10 October 2012 - 07:52 PM

Holy crap. Do I have any hope at all if this is all very confusing right now? Posted Image
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/>

#8 MatuOlen

  • Members
  • 19 posts

Posted 10 October 2012 - 08: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!

#9 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 10 October 2012 - 10:10 PM

View PostMrZuribachi, on 10 October 2012 - 07:47 PM, said:

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.

#10 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 11 October 2012 - 01: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!

#11 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 11 October 2012 - 01: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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users