BoxOfDevs / Functions

Create your own commands with ease! For PocketMine, a Minecraft PE server software
Other
17 stars 11 forks source link
command custom mcpe minecraft-pocket-edition pocketmine

Functions Description

Poggit-CI

Ever wanted to make your own commands? Well, now you can! Using the functions plugin a user can set a function, and then on running a certain command, that function will be run - Enjoy :D



Changelog

Version 2.0.0: May 13, 2018. Thanks to JackMD!

- Updated to version 2.0.0 in config
- Compatibility with API 3.0.0-ALPHA12 through ALPHA14
- Code reformatting
- Shorthand commands: /func, for example
- Typehints added (ew, but yeah fiiineeeee)
- Help message redesign, looking great!
- Remove unnecessary return statements
- File structure improved
- Author name fixed
- Minor improvements

Commands

All the commands currently implemented into Functions:

- /function create <name of the function>
    Create a function!

- /function addcmd <function name> <command>
    Add a command to a function!

- /function setcmd <function name> <id> <command> (Functions 1.2+)
    Set a command to a function by it's id (can be found using read)!

- /function usage <function name> <usage> (Functions 1.2+)
    Set the usage of a function!

- /function desc <function name> <description> (Funtions 1.2+)
    Set the description of a function!

- /function read <function name>
    Show every command of the function (nothink executes no commands!)

- /function resetcmd <function name> <command id>
    Reset a command (leave it to blank to be changed later)

- /function removecmd <function name> <command id>
    Remove the command (remove the space used for the command)

Permissions

All the permissions used by Functions:

- func.command.function : Allows /function, Default: OP

Special replacements

Those are what in the command will be replace by what :~)

You can also enter:

Here comes the complex part: the if statements. (Functions 1.2+)
If statements follows a simple syntax in the command (removed after execution):
{if:<conditon>;then:<action>}

List of possible conditions:

List of possible actions:

AND and OR

You can check multiple conditions using && (and) or || (or). DO NOT USE BOTH IN THE SAME CONDITION !

Combined with other replacements, you can do thousands of things. Here are a few example:

... create your own conditions will help you to really make interactive commands.

Importing / Exporting Functions (Functions 1.2.1+)

What's even cooler with this plugin is the fact that you can easily share Functions with other servers/on your network with a simple really light file.

Basic import/export

So first, you need to have a created function on your server.
Then, you need to run /function export <function name>
If succefull, you would see a new file in the function folder called <function name>.func .
This file basicly stores the function and is needed to import the function on other servers.
So share this file and put it into the Functions folder of the wanted server.
Then, on this server, run command /function import <name of he file without the .func> .
And voila ! You have succefully imported a function to an another server.

Import/export with password

Sometimes, you wouldn't like your shared functions to be leaked, so Functions comes with a buildt in feature of encrypting functions with passwords.
Passwords are encrypted using an sha512 encryption then converted to ANSII, then reencrypted into 1 number so there is NO way back to the original password.

So how to do this:
First of all, as you did before, you need to have the function you want to share on a server.
Then, run command /function export <function name> <password> .
You would see if functions successfully encrypted your password at the success message.
Now, as we did before, share it into an another server and put it into the Functions plugin folder.
And finally run command /function import <name of he file without the .func> <password> .
If no password included for a function that need one, you will get a message telling you to enter the password.
If the password entered is wrong (could not decrypt the function), you will also get an error message.

Authors

All contributors to Functions:

- Ad5001

- applqpak

- HimbeersaftLP

- TheDragonRing

- remotevase

- Dog2puppy

- ErkamKahriman

- JackMD

- TheRoyalBlock (AvgZing)

- DarkWav

Read The License!!!

Please make sure you read the license, upon downloading any file of the software, you agree to all its terms. The license may be found [here.] (http://bit.ly/2jikqXv)