Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The "Vending Machine" Notion
#1
Lightbulb 
So.

One of the projects I'm going to be working on for the Official LP Server is a "Trade Depot" for spawn. I want to design this to be a transit center between everyone's bases (initially via Teleporter, eventually via Minecart as well if possible). We've got a ton of ideas for the space and I can't wait to get started on it. BUT .. one of the core concepts driving it is 'trade'. Everyone on the server is a nice and honorable person, we could work entirely off the honor system.

However I really do like the notion of a working set of "Vending Machines": buy something for the cost of something.. definable by the person who owns the machine setup. Trouble is I would normally do something like this with Steve's Factory Manager (or the updated alternative ASM that we have), and we are REMOVING ASM in the next major update (1.3) specifically because it is buggy as frog poop.

So here I am. Stuck. If you've got ideas I would love to hear them. Anyone that comes up with the 'final design' that we end up using .. I'll give a guest appearance in the episode of "Vaygrim's Chance 3" that has us BUILDING IT.

Idea submissions start now, GO!
Reply
#2
Obligatorily, here is an OpenComputers program I wrote. Completely customizable, works with any type of chest and any number of vending machines connected to a single computer. There is a config file for specifying which slots do what and for specifying Redstone IO -> transposer pairs. The only requirement is that all chests connected to one computer have the same number of slots (they should be the same type of chest, for example an Iron Chest).

The program is capable of trading multiple items at once (e.g. if one item costs 2 emeralds and you give the program 5, it will return 2 items and 1 remaining emerald).
There is one limitation: The required payment specified must be relative to a single item, that is, you cannot say "sell x items for y emeralds", you can only say "sell 1 item for y emeralds".

The Stock chest contains the stock of items. The slots the payment is placed in can be specified in the config, too. A transfer will not happen if the payment slots are full or if the machine is out of stock.

The program will take a few seconds to process a transfer. It's not very fast but it works.

Here is an example setup. The RFTools screens are very useful for displaying available stock and offers.


It hasn't been tested extremely thoroughly (I only wrote it today, took about 150 minutes to write and test), but everything seems to be working. If anyone is going to test it, please notify me of any issues you might find.

The code can be found at https://github.com/OpenPrograms/Vexatos-...er/vending for now. I may add it to OPPM for easy and convenient installation. Make sure to edit mapping.lua and configure it as you need (if you are going to use Vanilla Chests, the only thing you should need to change is the first three characters of the Redstone IO and Transposer address strings as well as the directions of the chests relative to the Transposer).
Reply
#3
That is really, truly impressive. Exceptional job, Vexatos!

Mer, at a loss for words
Reply
#4
I second Mer's comment, truly impressive.
Reply
#5
Thanks for the nice comments. I am glad you like it.
Reply
#6
I've updated the vending machine program. It now works slightly differently: You now have to specify a range of stock slots; the slots that were previously item specification and stock at once now serve only for specifying the offer and the amount to return. This means that you can now specify how much to return (e.g. "offer 5 saplings for 3 emeralds").
By default (with a Vanilla chest), the second row is used for stock now. Here is a new example.

I hope you like this change. It resolves the only real limitation the program used to have.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)