Create custom command

PhantomBot Version: 3.0.0
OS Version: Windows 10
Java Version: 1.8.0_211
Browser and Version (for Panel Support): Google Chrome 74.0.3729.169 (Official Build) (64-bit)
Stock PhantomBot: Yes/No (Yes if you have not modified the scripts or Java Core)

Let us know what help you need:

I am trying to create a command like a betting game. The viewer can bet either blue or red team with a certain amount of chips by saying !red 1000 or !blue 2500. The bot will store each player’s chip amount and if they win they would get their reward as the percentage they have on their team pool and earn the same percentage from the red pool.

For example, if Pooky bet blue team with 2500 chips and the blue team pool total is 50000. In the end, the blue team won it, so he would get 5% of the red team pool chips plus his original bet.

I can code this up but how can I add my code into it and with which language should I use.

PhantomBot modules use a form of JavaScript which uses the Mozilla Rhino engine. This use JavaScript syntax and JavaScript functionality, including the ability to call Java - except none of the web-based functionality is available (because it isn’t Chrome, Firefox, etc).

You can review other modules as guidelines or the sample code in Git at:

https://raw.githubusercontent.com/PhantomBot/PhantomBot/master/development-resources/moduleExample.js

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.