Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(25 Kb)
Download
Updated: 09-11-13 03:24 AM
Pictures
File Info
Compatibility:
Siege of Orgrimmar (5.4)
Escalation (5.3)
Updated:09-11-13 03:24 AM
Created:unknown
Downloads:13,022
Favorites:93
MD5:

Xcalc  Popular! (More than 5000 hits)

Version: 2.73
by: moird, Dridzt

Xcalc is a fairly basic calculator that allows mathematical equations to be entered via the console
or by using the GUI calculator interface.

Xcalc is based off of QuickCalc by Mark Ribau. A good portion of the code has been rewritten, and
the GUI has been completely rewritten.

Usage
slash commands

  • /xcalc
  • /calc
  • /=
Clicking the minimap icon or typing the command without parameters opens the xcalc GUI.
Numpad keys can be remapped to the calculator keys when the GUI is visible if that option is selected.
Shift-Enter with the GUI visible opens chat and Shift-Click on result inserts it to chat editbox.

Xcalc supports computing expressions from the command line.
This is accessed by typing out one of the slash commands with the expression following the slash command.

Math operators
+ - * / ^ ( ) (addition, subtraction, multiplication, division, power, grouping)
Special Keyword:
ans - Will return the last answer given from using the slash commands

Math Functions
Reference at Wowpedia.

Money strings
  • #.#g
  • #.#s
  • #c
  • #g#s#c
  • #g#s
  • #g#c
  • #s#c

Examples
  • /calc 2 + 2
    xcalc Result: 2 + 2 = 4
  • /calc 3.5g
    xcalc Result: 3.5g = 3g50s
  • /calc (3.5g + 50s) * 2
    xcalc Result: (3.5g + 50s) * 2 = 8g
  • /calc 4g / 5
    xcalc Result: 4g / 5 = 80s

v2.73
.toc update, compatible with WoW 5.4 "Siege of Orgrimmar"

v2.72
Hide an auto-keybind that shouldn't be visible in Blizzard keybind options.
.toc update, compatible with WoW 5.3 "Escalation"

v2.71
Fix error when exiting combat with auto-keybind option enabled and not used xcalc GUI for the session.

v2.7
General maintenance: remove unintended globals, reduce string garbage generation, replace deprecated getglobal/setglobal API.
Bugfixes: Chat printing, Shift-linking result from calculator to chat now works.
Bugfixes: Properly implement automatic keybindings, they will no longer hijack keys when the calculator is not visible or fail to set/clear in combat.
Enhancement: Xcalc automatic keybinds won't clutter up Blizzard keybind interface.
Enhancement: Mac specific keybinds should also be functioning.
GUI: Tooltip hint for result linking,
GUI: ElvUI theme for ElvUI users.
.toc update, compatible with WoW 5.2 "Thunder Isle".

v2.3
Updated toc

v2.2
Minor Fixes
moved global variables out of localization and added them to xcalc namespace
two functions missed being in the main namespace fixed now
Created xcalc namespace to reduce global namespace pollution
Added proper check with addons_loaded
Comments and cleanup
Minor issue with right clicking minimap menu
Changed Vairables_loaded to addon_loaded and moved it into xcalc.lua
Right click minimap button to open options window
General code cleanup
Changed email address in files
general code cleanup
Changed how all the buttons are done. Some cleanup left to do
changing how the main buttons get created
Changed more string.find into a reasonable layout.
More work on the one method to deal with key inputs
forgot xcalc_ in front of a function call, that is fixed. Started redoing string.find calls to be a bit cleaner
Made some changes to the key handling system, setting up a more generic key handler

2.1.18
*updated Toc

2.1.17
*Isolated Automatic keybindings, so other mods shouldn't interfere with the mod anymore
*Removed a couple not needed functions.
*More code cleanup

2.1.13
*Updated version and toc (wotlk compatible)
*Fixed automatic keybinding issues, automatic keybindings are now on by default
*Fixed bug where if a player was to enter something like: 2+2=100+ it would toss an error this has been resolved
*Added an automatic keybinding for Backspace
*Added a keybinding to open/close xcalc
*general code cleanup
Optional Files (0)


Archived Files (9)
File Name
Version
Size
Author
Date
2.72
25kB
moird
05-22-13 07:16 PM
2.71
25kB
moird
04-08-13 07:23 PM
2.7
25kB
moird
04-03-13 08:25 AM
2.3
23kB
moird
11-24-09 10:06 AM
2.2
24kB
moird
06-18-09 11:00 PM
2.1.18
25kB
moird
06-05-09 05:34 PM
2.1.17
13kB
moird
03-23-09 01:19 PM
2.1.13
13kB
moird
03-20-09 09:47 PM
2.06
14kB
moird
08-12-08 08:40 PM


Post A Reply Comment Options
Unread 08-13-08, 01:12 PM  
lycanther
A Murloc Raider

Forum posts: 4
File comments: 26
Uploads: 0
Re: Re: aha

Originally posted by moird
it is like that, because 100 copper = 1 silver and 100 silver = 1 gold
so technically speaking the calculator is performing the calculation properly.
because 400*20 = 8000
and in reality, I could program a check into the calculator to prevent such calculations from being performed in the first place, but haven't gotten around to it yet...
There are lots of programs that can correctly handle complicated unit calculations (for example, type 2 ft * 3 m into google and it will return 1.8288 m^2). The dimensionally correct result would be
4g*20s = 400s*20s = 8000s^2 = 0.8g^2
and it should be reasonably easy to implement this in a domain where there's only 1 dimension...but why bother? I can't imagine any reason why anyone would ever multiply two amounts of money. Probably 4g*20s should just return "User error! WTF were you thinking?"
lycanther is offline Report comment to moderator  
Reply With Quote
Unread 08-12-08, 08:37 PM  
moird
A Kobold Labourer
 
moird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 8
Uploads: 1
Re: Keybind problem

That is how it is suppose to function and how it has functioned... if I have some more time I will look into it.

Originally posted by TripleEYE
Well - I love it that I can use the Num Lock numbers to oparate the calc.. but it takes away my regular functions for that button. For example (and therea re many of those): Num5 is used to Follow a target in my WoW. When I oparate the addon - that function is erased.
Isn't there any way to make the keybinds be used for the calc when it's open, and for my normal functions when it's closed?
moird is offline Report comment to moderator  
Reply With Quote
Unread 05-26-08, 03:55 PM  
TripleEYE
A Kobold Labourer

Forum posts: 1
File comments: 21
Uploads: 0
Exclamation Keybind problem

Well - I love it that I can use the Num Lock numbers to oparate the calc.. but it takes away my regular functions for that button. For example (and therea re many of those): Num5 is used to Follow a target in my WoW. When I oparate the addon - that function is erased.
Isn't there any way to make the keybinds be used for the calc when it's open, and for my normal functions when it's closed?
TripleEYE is offline Report comment to moderator  
Reply With Quote
Unread 12-10-07, 05:29 PM  
moird
A Kobold Labourer
 
moird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 8
Uploads: 1
Re: aha

it is like that, because 100 copper = 1 silver and 100 silver = 1 gold
so technically speaking the calculator is performing the calculation properly.
because 400*20 = 8000
and in reality, I could program a check into the calculator to prevent such calculations from being performed in the first place, but haven't gotten around to it yet...

Originally posted by coldsun
http://www.wowinterface.com/downloads/full3664.jpg ->

"xcalc Result: 4g*20s = 8000g" .....

i rather doubt that ... (and ull learned at school that units on each side of an equation must be the same ..)
(and i dont want to trade with ppl ingame that rely on such stuff:P)
moird is offline Report comment to moderator  
Reply With Quote
Unread 12-06-07, 06:44 PM  
coldsun
A Kobold Labourer

Forum posts: 1
File comments: 37
Uploads: 0
aha

http://www.wowinterface.com/downloads/full3664.jpg ->

"xcalc Result: 4g*20s = 8000g" .....

i rather doubt that ... (and ull learned at school that units on each side of an equation must be the same ..)
(and i dont want to trade with ppl ingame that rely on such stuff:P)
Last edited by coldsun : 12-06-07 at 06:47 PM.
coldsun is offline Report comment to moderator  
Reply With Quote
Unread 01-03-07, 04:37 AM  
Zidomo
A Cliff Giant
 
Zidomo's Avatar

Forum posts: 76
File comments: 1047
Uploads: 0
Originally posted by Dridzt
Zidomo, that error line is totally irrelevant so you obviously searched / replaced other things in 2.01 as well.
(If the mod was working just fine in your Addons folder there was no reason to mess with it)
Wrong. "...I triple-checked the edits.". If other things were modified, I would have mentioned them. Mentioning errors without mentioning all changes made to the mod is unprofessional, thus it was not done. And others enjoy testing mods in a rigorous fashion, irregardless if they actually need to or not.

Originally posted by Dridzt
Lua 5.1 incompatibilities to previous versions
Direct your attention to the 5th bullet of 7.2
math.mod needs to be replaced with math.fmod and it is not a matter of author coding preference.
Never said it was "author coding preference". The point of the post was to provide testing feedback on specific coding suggestions made by someone else. Irregardless of whether said changes are (in either theory or common practice) the right thing to do or not.

Originally posted by Dridzt
I merely pointed out parts of the code where I could see a problem and posted changes I did to my local copy to illustrate it.
I did not suggest them for verbatim inclusion.
And I merely pointed out--after thorough testing I had done after making the exact changes suggested--that there was a problem with the mod after those changes were implemented on my local copy. A problem which prevented the mod from being accessed. And I provided full details. So I don't really see what the issue is here .

The updated Xcalc 2.03 works without problems/errors so far here as well.
Zidomo is offline Report comment to moderator  
Reply With Quote
Unread 01-02-07, 07:58 PM  
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1192
File comments: 780
Uploads: 82
Zidomo, that error line is totally irrelevant so you obviously searched / replaced other things in 2.01 as well.
(If the mod was working just fine in your Addons folder there was no reason to mess with it)

Lua 5.1 incompatibilities to previous versions
Direct your attention to the 5th bullet of 7.2
math.mod needs to be replaced with math.fmod and it is not a matter of author coding preference.

That the mod author will make the changes HE finds beneficial to his mod is kinda self-evident.
I merely pointed out parts of the code where I could see a problem and posted changes I did to my local copy to illustrate it.
I did not suggest them for verbatim inclusion.

(I find it preferable to the usual all inclusive comment which is "this mod doesn't work"
even when further investigation reveals that it was suffering a minor issue)

2.03 works error-free "out ot the box" for me, thanks for the update
Last edited by Dridzt : 01-02-07 at 10:00 PM.
Dridzt is offline Report comment to moderator  
Reply With Quote
Unread 01-01-07, 04:14 AM  
Zidomo
A Cliff Giant
 
Zidomo's Avatar

Forum posts: 76
File comments: 1047
Uploads: 0
Dridzt's suggested changes to v2.01 don't work and create errors at logon, causing the mod to die. Recommend doing your own coding, moird, to make sure things work well before updating this great mod .

Did the suggested change at line 141, which is replace: xcalc_minimapbutton_updateposition();

with:

if (xcalc_minimap_button) then
xcalc_minimapbutton_updateposition();
else
xcalc_minimap_init();
end


And also replaced instances of math.mod with math.fmod on the following lines: 511, 515, 521, 525, 530 & 533.

Doing the above creates the following errors at logon and the mod doesn't load:

"xcalc\\xcalc.lua:281: '=' expected near '?'"

"<string>:\"xcalc_core:OnEvent\":1: attempt to call global 'xcalc_initialize' (a nil value)"

Of course, I triple-checked the edits. And did it with WoW exited as opposed to doing it in-game then reloading the UI. Without these changes (using the original v2.01 files), no errors and no large problems here so far.
Last edited by Zidomo : 01-01-07 at 04:15 AM.
Zidomo is offline Report comment to moderator  
Reply With Quote
Unread 12-29-06, 02:27 PM  
moird
A Kobold Labourer
 
moird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 8
Uploads: 1
Thanks, I will look into that, Thank you Dridzt
moird is offline Report comment to moderator  
Reply With Quote
Unread 12-28-06, 09:40 PM  
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1192
File comments: 780
Uploads: 82
Removed references to an older version (2.01) code to avoid confusion with the current version for other users.
Last edited by Dridzt : 01-02-07 at 08:01 PM.
Dridzt is offline Report comment to moderator  
Reply With Quote
Unread 12-25-06, 02:08 PM  
moird
A Kobold Labourer
 
moird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 8
Uploads: 1
My account has been down for a while now, but I just got it back up so I will be releasing an updated version within the week I am sure.

Originally posted by Talash
Awesome addon. Wish it would be updated for the new patch. I miss it almost every time I use the AH or compare stats.
moird is offline Report comment to moderator  
Reply With Quote
Unread 12-18-06, 01:11 PM  
Talash
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Awesome addon. Wish it would be updated for the new patch. I miss it almost every time I use the AH or compare stats.
Talash is offline Report comment to moderator  
Reply With Quote
Unread 08-28-06, 08:24 AM  
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1192
File comments: 780
Uploads: 82
thanks

I'll edit out my post below, since you have it planned (and in a much more thorough way)
No hurry

Thanks for the fast reply, and sharing this nice mod.
Dridzt is offline Report comment to moderator  
Reply With Quote
Unread 08-28-06, 08:16 AM  
moird
A Kobold Labourer
 
moird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 8
Uploads: 1
Re: small request

There are already plans for something similiar, I was going to put in an options page with the ability to not auto set the keybindings, have a slider for the minimap icon position, as well as a check box to hide the minimap icon all together... But as this is my first ever mod and I am still learning the lua and xml it might be a little while before I get all that completed, but it is forth coming.
moird is offline Report comment to moderator  
Reply With Quote
Unread 08-28-06, 07:36 AM  
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1192
File comments: 780
Uploads: 82
small request

Excellent mod, went straight to my "must have" list.

I do have a small feature request.
My minimap area is congested.
You have placed your icon off-setted from the minimap which will probably be out of the way
for most users... however it's not so in my case (I do have a lot of minimap icons and monkey buddy is at the exact spot)

Any chance to make the minimap button movable or configurable?

[edit]: edited out some portions of my post containing proposed code changes. (cosmetic)
Last edited by Dridzt : 08-28-06 at 08:25 AM.
Dridzt is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: