The plugin allows to execute math operations in the server or console.

Overview

General

The plugin allows to execute math operations in the server or console with /calculator command

Arithmetic Operators

Constants

Math functions

  • List of supported math functions: abs, acos, acosh, asin, asinh, atan2, atan, atanh, ceil, cos, cosh, deg2rad, exp, expm1, fdiv, floor, fmod, getrandmax, hypot, intdiv, lcg_value, log10, log, max, min, mt_getrandmax, mt_rand, pi, pow, rad2deg, rand, round, sin, sinh, sqrt, srand, tan, tanh.
  • Description of math functions: https://github.com/Muqsit/arithmexp/wiki/Function
  • Eg: /calculator sqrt(369) > Result: 19.2

Commands & Permissions

commands:
  calculator:
    description: "Perform a math operation"
    usage: "/calculator <expression>"
    permission: calculator.command
    aliases: ["calc"]
permissions:
  calculator.command:
    default: true
    description: "Allows the use of /calculator"

Config

---
# Prefix of messages.
prefix: "&f[&6Calculator&f]&r"

# {prefix} : Prefix.
# {result} : The result of the math.
result: "{prefix} &aResult: &b{result}"

# {prefix} : Prefix.
# {error} : Error information.
error: "{prefix} &cError: {error}"

# playSound: true > A sound will be sent to the player when a math operation is performed.
playSound: true
...

Contact

Discord
You can contact me directly via Discord NhanAZ#9115

You might also like...
The Pantheon CLI — a standalone utility for performing operations on the Pantheon Platform

terminus : Pantheon's Command-Line Interface Status About Terminus is Pantheon's Command Line Interface (CLI), providing at least equivalent functiona

Install an execute script of specify quality tools to your git pre-commit hook, and it executes only for changed files

Quality Hook Installer Install an execute script of specify quality tools to your git pre-commit hook, and it executes only for changed files Install

Elevator - A simple PocketMine-MP plugin that allows to create elevators on your server
Elevator - A simple PocketMine-MP plugin that allows to create elevators on your server

Elevator - A simple PocketMine-MP plugin that allows to create elevators on your server. How to use You just have to setup an id in the config.yml. Plac

A Simplistic Plugin to Implement Server Claims to your Minecraft: Bedrock Server.
A Simplistic Plugin to Implement Server Claims to your Minecraft: Bedrock Server.

Claims This plugin allows administrators to create, edit, list, and teleport to land claims on a PocketMine server. These claims have a variety of cus

A console noughts and crosses game written in php

Tic-tac-toe A console noughts and crosses game written in php To play, simply clone the file Navigate to the file directory on your terminal and run t

The package contains a bootstrap for running Yii3 console application.
The package contains a bootstrap for running Yii3 console application.

Yii Console Runner The package contains a bootstrap for running Yii3 console application. Requirements PHP 8.0 or higher. Installation The package cou

A PHP framework for console artisans
A PHP framework for console artisans

This is a community project and not an official Laravel one Laravel Zero was created by, and is maintained by Nuno Maduro, and is a micro-framework th

Demo of symfony/console features to build rich command line utilities

Symfony Console Demo This project is a demonstration of symfony/console features. To run the project with Docker. With bash: docker build -t myconsole

Comments
  • Using square brackets and curly brackets

    Using square brackets and curly brackets

    Hi first thank you for making this, It is much better than other calculator plugins. Can you make it so I can use square brackets [ ] and curly brackets { } So if there are many brackets in the command I can use different brackets to make it more clear like a + {[b - (c / d)] * 3}

    opened by Jack10270 7
  • Bump lib `muqsit/arithmexp` to `0.1.29`

    Bump lib `muqsit/arithmexp` to `0.1.29`

    Fixed unary positive operation resulting in negation since v0.1.28 (80ceccf) Further optimized expression evaluation (6d0c799) Implemented modulo operator strength reduction for identity property ((a % n) % n => a % n) (bca7b17, 9853547) Removed functions rand() and getrandmax() (these functions exist in PHP only for backward compatibility) (ce8dfb3) mt_rand() now accepts zero parameters (in addition to accepting two parameters) (8194bf3, f73be61) Implemented mode constants for round() (HALF_UP, HALF_DOWN, HALF_EVEN, HALF_ODD) (c21ce74, 90c0f5d) Renamed FunctionRegistry::register() to FunctionRegistry::register() (ad07641) Renamed ConstantRegistry::register() to ConstantRegistry::registerLabel() (1b0d2d5) Moved FunctionRegistry::registerMacro() to MacroRegistry::registerFunction() (0d0889f) Implemented object-like macros that can be registered by calling MacroRegistry::registerObject() (34e5ad7)

    opened by NhanAZ 0
  • Setting value of variable

    Setting value of variable

    Hi this request for adding variable support to plugin

    When user types expression sender can set value of variable:

    (Sender) /calc x + 1
    (Server) Enter value for variable x:
    (Sender) 3
    (Server) x + 1 = 4 where x = 3
    
    (Sender) /calc x + 1
    (Server) Enter value for variable x:
    (Sender) pi / 4
    (Server) x + 1 = 1.7 where x = 0.7
    

    For this cyou can use await-std to be done easy (code adapted from https://github.com/SOF3/await-std-examples/blob/master/BanHammer/src/SOFe/BanHammer/Main.php)

    $expr = implode(" ", $args);
    Await::f2c(function() use($sender, $expr) : Generator{
    	try{
    		$values = [];
    		foreach(expr variables as variable){
    			$sender->sendMessage("Enter value for variable "  + $variable);
    			$value = $std->consumeNextChat($sender);
    			$values[variable] = $value;
    		}
    
    		evaluate expression using $values
    	}catch(QuitException){
    		// do nothing if $sender quit
    	}
    });
    
    help wanted 
    opened by Jack10270 5
Owner
NhanAZ's PocketMine-MP Plugins
Source code repositories for my PocketMine-MP plugins and related code
NhanAZ's PocketMine-MP Plugins
Sey is a powerful math interpreter with infinite-precision.

Sey, pronounce say, is a powerful math interpreter with infinite-precision.

Félix Dorn 13 Oct 1, 2022
Comprehensive Plugin for composer to execute PHP Quality assurance Tools

NOT MAINTANED ANYMORE The development of composer-plugin-qa was dropped in favor of phpqa which is actively maintained. The project use docker and can

Webysther Nunes 25 Apr 30, 2021
A plugin that allows you to hear the sound "Welcome to the server!" when you join the server by NhanAZ for PocketMine-MP

General A plugin that allows you to hear the sound "Welcome to the server!" when you join the server by NhanAZ for PocketMine-MP Contacts You can cont

NhanAZ's PocketMine-MP Plugins 10 Sep 27, 2022
Execute time consuming tasks as late as possible in a request

Procrastinator for PHP: do stuff later A few classes to help you executing complicated tasks (like sending mails) later. Example using fastcgi_finish_

Lars Strojny 62 Apr 29, 2021
A back-off strategy interface for retrying operations.

EventSauce BackOff This library provides an interface for encapsulated back-off strategies. composer require eventsauce/backoff Leveraging the back-of

EventSauce 59 Dec 19, 2022
Quickly execute Composer package binaries from anywhere. ⚡️

✨ Help support the maintenance of this package by sponsoring me. cpx Quickly execute Composer package binaries from anywhere. ⚡️ Installation Run the

Ryan Chandler 57 Dec 25, 2022
Execute Artisan commands on remote servers

Execute Artisan commands on remote servers This package provides a command to execute Artisan command on a remote server. Here's an example that will

Spatie 238 Dec 29, 2022
Simplifies GST calculation and operations

Simplifies GST calculation and operations Installation You can install the package via composer: composer require gaurangsharma/gst-calculator Usage u

Gaurang Sharma 1 Oct 21, 2021
Learning about - Basic HTML & CSS, JSON, XML, Session & Cookies, CRUD Operations in Php using MySQL and Create MVC from scratch

This Project is based on course CSC 3215. Learning about - Basic HTML & CSS, JSON, XML, Session & Cookies, CRUD Operations in Php using MySQL and Create MVC (Model–View–Controller) from scratch. Just learning about web technologies, Not focusing on UI (Bootstrap or other 3rd-Party UI libraries or frameworks).

Alvi Hasan 5 Sep 21, 2022
StringBuffer is a PHP class providing operations for efficient string buffering

StringBuffer is a PHP class providing operations for efficient string buffering

null 1 May 26, 2022