Vending Machine Event Setup

How to set up a Vending Machine event.


Vending Machine Event

The script command is very similar to that of the poke market command. For those who are familiar with my Poké Market plugin, the setup should be very easy.


Here's how a vending machine is setup in Essentials by default:

Hint

You can define a method in the 000_VendingMachine_Setup.rb file to clean up your event commands.

As you might have experienced, you need to define the price and all items manually with a lot of conditionals which can make the event look really big and very hard to maintain. But with Arcky's Advanced Vending Machine, the setup is a lot easier:

For example at the bottom of the file, add:

1
def someVendingMachine
2
advancedVendingMachine([
3
:POKEBALL, :GREATBALL,
4
:POTION, :SUPERPOTION, :HYPERPOTION,
5
:REPEL, :SUPERREPEL,
6
:REVIVE,
7
:ANTIDOTE, :PARALYZEHEAL,
8
])
9
end

Now inside your event, you only need to call:

1
someVendingMachine
Hint

Using methods like this helps you:

  • Reuse item lists across multiple events
  • Quickly update all associated events by changing just one method
  • Keep your event clean and easier to manage