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

Help with advanced trade system

Started by Rext, 19 July 2012 - 10:31 PM
Rext #1
Posted 20 July 2012 - 12:31 AM
Hey guys I'm Rext. I just started playing around with computer craft. I know how to program in a few languages and have experience with lua before but I need some help getting into this. So what I'm trying to do is to basicly make a computer version of the Trade-o-mat in Industrial craft. Yes I am playing with tekkit.

So here is my basic idea.

I want to make a comp that you can put items into(like a chest next to it) and have the items be converted to EMC. It will work like a bank. According to the player using the comp is will display a menu and how much "Trade Points"(EMC) they have in the bank. So possibly to remember different players it may need a login system. The entire idea is the play puts in what they want to convert to EMC in return they will get whatever they want with there EMC/Trade Points. However the point of it is that the player will get like a fee so 10% of the EMC they put in will go to My warehouse for me.

For Example:

1)Jeff places 10000 cobblestone in the chest(well any items that add up to 10000EMC)
2)Jeff Opens the Comp and Logs in.
3)Jeff is shown a menu that says, "Convert Items to ____ Trade Points"(In this case 10000), "Purchase Items", "Pick Up Order"
4)Jeff selects the first option and the items are pumped out of the chest to a warehouse.
5)Now Jeff has 10,000 'trade points" in his bank.
6)So now his selects "Purchase Items" and a list of the items in stock are selected.(the items "In stock" are just the items that have been programmed into the comp)
7)He selects diamond(the screen now displays that he will pay 8819 because the EMC value of a diamond is 8192EMC but the comp adds 10% and rounds to get a price(Like a tax basicly) and then selects confirm purchase
8)Now over at the warehouse a "request" is sent to a monitor which will display "Jeff has requested: 1 diamond".
9) a "worker" will send a diamond back to a holding chest.
10)Jeff will check back in on his "order" and the menu will now display "1 Diamond ready for pick up"
11)Jeff selects "Pick Up Oreder" and the diamond is pumped into a chest.


I know it is complicated but it would be extremely useful. It would be great if someone could help me write this code but I doubt that will happen. All I want is for someone to put me on the right track. Also if there is a list of all the commands the comp can execute like: redstone.setOutput("back",true) That would be nice to know.(cause there should be many but I havn't seen any of them together in one post. Isn't there one to make it pulse?)

Thanks for all your help
Rext
the computercraft noob…

…but not for long :P/>/>
MysticT #2
Posted 20 July 2012 - 01:07 AM
I would recommend reading the wiki. You can see all the available apis and functions there.
This is a pretty hard project for your first program, so it would be better if you something else first. Start with the basics, then move on to bigger projects.
Rext #3
Posted 20 July 2012 - 01:35 AM
I would recommend reading the wiki. You can see all the available apis and functions there.
This is a pretty hard project for your first program, so it would be better if you something else first. Start with the basics, then move on to bigger projects.

Ya I figured but I have a tendency to push the limits on pretty much everything :P/>/>
kazagistar #4
Posted 20 July 2012 - 07:03 AM
Do you know of anyone that is likely to use your bank? I assume it is largely for the cool factor…
lieudusty #5
Posted 20 July 2012 - 07:06 AM
This seems like a cool idea…