SimpleCalc
SimpleCalc
Description:
SimpleCalc is a chat/console based calculator. It can calculate any mathematical expression containing decimals and the following operators:
- Addition: +
- Subtraction: -
- Multiplication: *
- Division: /
- Powers: ^
- Remainder: %
- Parentheses: ( and )
- ANS variable
- Functions: sin, cos, log, ln, sqrt, spawnX/Y/Z, locX/Y/Z
- Math constants: pi, e
Here are some examples of propper expressions:
- 5.6+3.3 or 5,6+3,3
- 3*4+5
- (3+4)*3/8
- (7+2^4)/3
- -5*3
- (-7+3*(12%5))/32
- After executing one calculation: ANS()+3
To use pi and the loc and spawn functions, append () to them!
You can separate the numbers/operators with spaces or not, both will be accepted and, if the expression is valid, will be calculated. The parantheses in ANS() are needed to work!
If you have Spout installed and use the Spoutcraft client you can now open a Calculator Window by using "/calc" without any arguments!
Command(s):
Quote:/calc <expression>: Calculates the given mathematical expression
Alias: /scalc <expression>
Quote:/calc: If Spout is installed it opens the Calculator Panel (needs Spoutcraft Client), else views the help
Alias: /scalc
DEV Version:
Download & Source:
SimpleCalc is released under GNU GPLv3 for more information, refer here.
CB 1.1-R6 and Newer:
Download v 2.4
Mirror(BukkitDev)
Download v2.3
CB 1.1-R3/CB 1.1-R4:
v2.2 (BukkitDev)
CB#
1185 & CB#
1240:
Download v 2.1
Mirror(BukkitDev)
Download v 2.0
Mirror(BukkitDev)
Source:
Source on GitHub
TO-DO:
Changelog:
- v2.4
- Fixed Listener throwing errors when spout was not installed
- Fixed loading errors if spout was not installed
- Added two new functions: distance2D() and distance3D(). It calculates the distance between the player and the spawn location either in the xz-plane(2D) and in xyz(3D)
- Added possibility to use the keyboard while the GUI is open to enter an expression, but currently no capital letters are possible if the text field is not selected.
- Added a Key-Binding when Spout is installed to open the GUI without the need to enter the command /calc. Default is C but it can be changed by the user!
- v2.3
- Added variables: You can now set variables with /calc set <variable> <value>. A variable is any letter except small e. Like: a,B,Z,O and g
- Added more functions like: sin, cos, sqrt, ln....
- Added SpawnX(), SpawnY(), SpawnZ() and LocX(), LocY(), LocZ() to get the locations of the spawn from your current world and your current location. This does only work when used ingame from a player!
- Added "Sience" window to the gui to use the new functions.
- v2.2
- Updated to new EventSystem
- Added ANS function.
- Rearranged CalcWindow
- v2.1:
- Change in namespace
- Made the error messages a bit more specific.
- v2.0:
- BUGFIX: Commas threw an error instead of beeing accepted
- FEATURE: Spout support. You can now use /calc to open a Calculator Window
- Update to CB #1185
- v1.0:
- Initial release
Version 0.1 to 0.9 are merely a list of my development progression:
- v0.1:
- Initial start of coding the plugin
- v0.2:
- Added all math functions i thought would be nice to have
- v0.3:
- Added RegEx functions for normal 2 arguments calculation (this means we do have a working 2 values calculator \o/)
- v0.4:
- Started working on a parser to make complex calculations possible
- v0.5:
- Removed original RegEx functions
- Created logic for the parser
- v0.6:
- Created logic to compute the given equation
- v0.7:
- Created my own Exception class to pass through parser errors
- v0.8 and v0.9:
- Several bug fixes and corrections
This plugin works smoothly but I noted that its last update was in 2012 and suggesting something would be useless. I just wanted to have a configuration to edit the messages sent from the plugin...
Surprised this baby still works so smoothly without an update in a year! Really wish that "c" wouldn't show up on the calculator when opening it with Spout though..
@Lathanael I'm sure this plugin is dead by now, but if you decide to pick it back up, could you make it so that you don't have to use a "/" so it just functions in chat, as 2+2. Also, could you make a configurable prefix?
@jesusthekiller
Glad you like it :)
Got it on my server :3
Ok version 2.4 released ;)
@Chaznuts
Yep, i haven't had much time the last months to look further into it. This behaviour is due to spout. Not sure if it is fixed.
I am also aware that in the DEv version if one is not using Spout the server crashes :(
You're probably aware of it, but on the developmental version, opening the Spout GUI with C works fine the first time, but once it's closed, to be open again the player has to press "t" to open the chat and then exit that chat screen. Once the chat is closed, the calculator can be opened once more, then requires another press of "t" etc.
Anyways, awesome plugin. Keep the updates up! Thanks for your contribution! :)
Yet another DEV version released
New DEV-SNAPSHOT: 2.4-SNAPSHOT (BUILD 13.03.2012 @ 00:26:13)
pushed version 2.3 to release!
Releasing a Dev version: 2.3
@Yonom
It would be possible with Spout, but it will create a "huge" overhead for the server as i would have to listen to every keystroke and check if it:
I might add an option to activate it, but not by default, as i feel that it would make the plugin less performant than i'd like it to be.
I love the SpoutUI, I only wish you would add the support for number and other keys, so i can type the numbers instead of clicking them. Other than that, its an awesome plugin :D
Your wish is my command :D
Sorry had not much time lately.
Update please! D:
@xXZymosisXx
Could you please fill a Ticket and give me a list of plugins you are using. I can't reproduce the error :(
There might be a new version soon, including a workover to the calc screen and ability to use functions (no functions made yet though)
@Lathanael
Yeah, everything is right, and I do use CB 1337. I noticed that if I press numbers, click the "hide" button, and reopen the calculator, I can see the numbers.
@xXZymosisXx
I will be testing further :) You do use CB #1337 right?
EDIT:
Are you 100% sure the plugin loaded right?
I just used a DEV version where i only introduced a new Function (Ans(wer) variable) and did not change anything else. It works fine using the latest Spout/SpoutCraft RBs Oo
@Lathanael
Spout: 510
SpoutCraft: 769