Download
(25Kb)
Download
Updated: 09-11-13 03:24 AM
Pictures
File Info
Updated:09-11-13 03:24 AM
Created:unknown
Downloads:16,190
Favorites:92
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)


Post A Reply Comment Options
Unread 05-24-13, 10:23 AM  
xXxDSMer
A Kobold Labourer

Forum posts: 1
File comments: 8
Uploads: 0
yay updated for 5.3.

goin to give this another try because having to type /dump every time in the chat window gets a bit annoying lol.

And i don't know how feasible it would be but perhaps a idea for an improvement (if it could be done without adding much weight to the addon): something like windows calc where you can see the history of things figured, even if it isn't clickable... could just be a simple text list of what the game returns, with some kinda clear or reset function. Would definitely be alot better than having to try to pick results out from all the /2 chatter
Last edited by xXxDSMer : 05-24-13 at 10:25 AM.
Report comment to moderator  
Reply With Quote
Unread 11-10-10, 03:29 PM  
Invertigo
A Defias Bandit
 
Invertigo's Avatar

Forum posts: 2
File comments: 61
Uploads: 0
Originally posted by Apraxia
I was lucky enough to find by accident that this addon was updated on Curse. I hate using curse sooo much though. Any chance you will update it on this site too? pretty please?
Hey, thanks for this post. I hadn't even thought of checking Curse for this, and was bemoaning fate that I'd never find an acceptable alternative.

__________________
Once you go gnome, you never go home...
Report comment to moderator  
Reply With Quote
Unread 11-01-10, 09:05 AM  
Apraxia
Clippy Crit Chicken
 
Apraxia's Avatar
Premium Member

Forum posts: 46
File comments: 31
Uploads: 0
I was lucky enough to find by accident that this addon was updated on Curse. I hate using curse sooo much though. Any chance you will update it on this site too? pretty please?
__________________


Report comment to moderator  
Reply With Quote
Unread 08-07-09, 09:54 AM  
wsuhoey
A Kobold Labourer

Forum posts: 0
File comments: 6
Uploads: 0
Please update for WoW patch 3.2.x
Report comment to moderator  
Reply With Quote
Unread 06-19-09, 10:29 AM  
moird
A Kobold Labourer
 
moird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 8
Uploads: 1
Originally posted by antisocialink
Very convenient.

Insane request: Can the minimap button be made detachable from the minimap. I have FAR too many minimap buttons as it is. Currently I'm using the extra space below my right side action bars as "minimap" button overflow space and would rather have it down there.

Thanks.
Thanks, I don't know if that would be a good modification at this time compared to what would have to be done. I think there is another mod out there that can do that and it should work with mine, if not then creating a macro with /= or /xcalc or such should bring up the gui and the minimap button can be turned off.
But I was considering adding the ability to have an icon on fubar if it is present but that is still a ways out
Report comment to moderator  
Reply With Quote
Unread 06-19-09, 05:51 AM  
antisocialink
A Kobold Labourer

Forum posts: 0
File comments: 39
Uploads: 0
Very convenient.

Insane request: Can the minimap button be made detachable from the minimap. I have FAR too many minimap buttons as it is. Currently I'm using the extra space below my right side action bars as "minimap" button overflow space and would rather have it down there.

Thanks.
Report comment to moderator  
Reply With Quote
Unread 06-08-09, 12:34 PM  
T3HPWnEr3R
A Murloc Raider
 
T3HPWnEr3R's Avatar

Forum posts: 4
File comments: 19
Uploads: 0
great addon.
thanks,very useful!
__________________
I'm allergic to noobs
Report comment to moderator  
Reply With Quote
Unread 03-21-09, 03:43 PM  
moird
A Kobold Labourer
 
moird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 8
Uploads: 1
So it has come to my attention that there is still an issue with the automatic bindings. It specifically has to do with some other mods hooking into the save bindings whenever a keybinding changes. The problem is that the automatic bindings rely on that *not* happening. To make xcalc more compatible with other mods though it will take a significant rewrite to the whole keybindng system in place which will likely take a bit.
*Edit*
this has been fixed in 2.1.17
Last edited by moird : 03-26-09 at 07:09 PM.
Report comment to moderator  
Reply With Quote
Unread 03-19-09, 02:29 PM  
Filius
A Defias Bandit

Forum posts: 2
File comments: 10
Uploads: 0
I'm sure the community appreciates your work; I certainly do.
Thanks, holding on to the update
Last edited by Filius : 03-19-09 at 02:30 PM.
Report comment to moderator  
Reply With Quote
Unread 03-02-09, 05:48 PM  
ThePooBurner
A Kobold Labourer
 
ThePooBurner's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 25
Uploads: 3
Originally posted by Filius
Could you also comment on the problem, where anything that is binded to the numerical keyboard gets resetted.

Thanks alot.
That problem stems from that it uses the per character key binds when it does the auto switching (rather annoying when i like to have all the keys the same on every character and it switches them on me), and due to the fact that if you are engaged in combat the key bind functions of the WoW API are locked out and can't work again until you leave combat, but the bind function of the mod still fire and so you end up with keys that aren't bound anymore and everything gets all screwed up. The fix for this isn't a simple copy and paste job. I've actually been tweaking the mod this morning to get it to work more the way i want it to. Added a binding for backspace to the backspace key, made it so that the escape key will clear the calculator when it's open and close the mod if pressed a second time, made the display toggle button like i mentioned in my last post, and made it so that it will auto close when entering combat and reopen exactly how you left it when combat ends. However the ways i do this aren't very clean at the moment. If i get more time in the near future i may polish things up a bit and post a fan update of the mod with all my changes.
Report comment to moderator  
Reply With Quote
Unread 12-25-08, 04:05 AM  
Filius
A Defias Bandit

Forum posts: 2
File comments: 10
Uploads: 0
Could you also comment on the problem, where anything that is binded to the numerical keyboard gets resetted.

Thanks alot.
Report comment to moderator  
Reply With Quote
Unread 12-24-08, 04:59 PM  
ThePooBurner
A Kobold Labourer
 
ThePooBurner's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 25
Uploads: 3
i have the latest version and i was getting hit with an error if i would try to do multiple calculations in a row. EG: 2+2+3=7 2+ERROR.

Changing lines 377-378 to the following fixed this problem and made the mod act like a normal calculator or like the calc program that comes with windows. This fix should be incorperated into the actual mod. If there is a better fix, feel free to do it. However, without this the mod is only good for 1 calc at a time unless you hit the clear button in between every calculation that you do.

Code:
function xcalc_numkey(key)
	if XCALC_PREVIOUSOP == "=" then
		xcalc_clear()
	end
	local currText = XCALC_NUMBERDISPLAY;
I would also suggest changing the binding to close the Xcalc window with one that toggles it. eg replace the XC_CLOSE binding with this one
Code:
     <Binding name="XC_DISPLAY" description="Toggle Xcalc">
          xcalc_windowdisplay();
     </Binding>
Last edited by ThePooBurner : 12-24-08 at 05:09 PM.
Report comment to moderator  
Reply With Quote
Unread 12-07-08, 03:14 PM  
Filius
A Defias Bandit

Forum posts: 2
File comments: 10
Uploads: 0
There is a problem with keybindnings. When that feature is active, all bindings on the numerical keyboard are resetted.
Report comment to moderator  
Reply With Quote
Unread 12-02-08, 10:31 AM  
WaSu
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
<3

This is the most usefull AddOn I ever had.

Thank you so much ...! =)
Report comment to moderator  
Reply With Quote
Unread 08-13-08, 02:09 PM  
moird
A Kobold Labourer
 
moird's Avatar
AddOn Author - Click to view AddOns

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

Originally posted by lycanther
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?"
I like that "User error! WTF were you thinking?"
I should set it up to make the check and not allow multiplication or division with money and money... Just this hasn't been one of my bigger priority programs of late. (inadvertently the reason why I haven't been updating it very much)
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: