Addon Info.
Optional Files (0)
Comments (20)
  Category: Miscellaneous
Addon Information
Download Latest Version.
To add favorites please register for a free account. If you already have one you need to login. How do I install this? (FAQ)
moird's Portal Bug Reports Feature Requests
Author:
Version:
2.06
Date:
08-12-2008 10:40 PM
Size:
14.14 Kb
Downloads:
5,297
Favorites:
63
MD5:
Pictures
Click to enlarge
Xcalc V1 GUI interface
Click to enlarge
Xcalc Chatbox Expression
Xcalc   Popular!
Xcalc is a fairly basic calculator that allows mathmatical 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.

Installation
------------------
Extract the zip and put the xcalc folder into
\World of Warcraft\Interface\AddOns
**WARNING**
xcalc 2.0 files have changed and any previous version needs to be deleted before. ie. dont copy
this over 1.0 installation.


Usage
----------------
slash commands:
/xcalc
/calc
/=

there is a = minimap icon that will all open the GUI interface.
also of importance xcalc will rebind your all your numberpad keys to the gui interface when the Gui
is open so it is not necessary to bind those keys. the GUI will rebind the numberpad keys back to
their original bindings when the window closes. With the GUI open use shift+enter to open the chat
dialog, and you can shift+left click on the number window to output that to the chat dialog if it is
open.

Xcalc does support computing of expressions from the command line. This is accessed by using the
slash commands with the expression after the slash command.

Math operators:
+ - * / ^ ( )

Special Keyword:
ans -- Will return the last answer given from using the slash commands

Math Functions:
abs() acos() asin() atan() atan2(,) ceil() deg() floor() frexp() ldexp() exp() log() log10() min([,...])
max([,...]) mod(,) rad() random([[,] ]) randomseed() sqrt() cos() sin() tan()
Please see http://www.wowwiki.com/World_of_Warcraft_API#Math_Functions for more information on the math functions.

Money strings:
#.#g
#.#s
#c
#g#s#c
#g#s
#g#c
#s#c

example:
/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

===========================
Version History:
v2.06 (12AUG2008)
- Updated TOC version
- Changed default keybindings to be off, and can be turned on via the options window.
v2.05 (05DEC2007)
- Updated TOC Version
v2.04a (10JAN2007)
- Fixed archive (xcalc directory should just be xcalc)
v2.04 (09JAN2007)
- Updated TOC Version
v2.03 (02JAN2007)
- Fixed a bug with a variable
- Will run a clear When the window is closed
v2.02 (29DEC2006)
- Fixed a section with the gold conversion to be 2.0 compatible
- Minor Bug with Minimap button placement controls if the minimap button wasn't available
v2.01 (28DEC2006)
- TOC version change to be 2.0 compatible
v2.00 (15SEP2006)
- Complete GUI rewrite (there was a latent problem with the original way it was written)
- Added Controls to position/hide Minimap Icon
- Option to turn off Automatic Keybindings
- Escape Key will close the window
v1.00 (27AUG2006)
- Initial Release
  Optional Files - Xcalc
Sorry, there are currently no optional files available.
  Comments - Xcalc
Post A Reply
Author Comments Comment Options
Old 12-25-2008, 05:05 AM  
Filius
A Defias Bandit

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

Thanks alot.
Filius is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 12-24-2008, 05:59 PM  
ThePooBurner
A Kobold Labourer
 
ThePooBurner's Avatar
Interface Author - Click to view interfaces

Forum posts: 1
File comments: 17
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-2008 at 06:09 PM.
ThePooBurner is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 12-07-2008, 04:14 PM  
Filius
A Defias Bandit

Forum posts: 2
File comments: 8
Uploads: 0
There is a problem with keybindnings. When that feature is active, all bindings on the numerical keyboard are resetted.
Filius is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 12-02-2008, 11: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 ...! =)
WaSu is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 08-13-2008, 04:09 PM  
moird
A Kobold Labourer
 
moird's Avatar
Interface Author - Click to view interfaces

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

Quote:
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)
moird is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 08-13-2008, 03:12 PM  
lycanther
A Kobold Labourer

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

Quote:
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   Edit/Delete Message Reply With Quote
Old 08-12-2008, 10:37 PM  
moird
A Kobold Labourer
 
moird's Avatar
Interface Author - Click to view interfaces

Forum posts: 1
File comments: 6
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.

Quote:
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   Edit/Delete Message Reply With Quote
Old 05-26-2008, 05:55 PM  
TripleEYE
A Kobold Labourer

Forum posts: 0
File comments: 10
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   Edit/Delete Message Reply With Quote
Old 12-10-2007, 06:29 PM  
moird
A Kobold Labourer
 
moird's Avatar
Interface Author - Click to view interfaces

Forum posts: 1
File comments: 6
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...

Quote:
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   Edit/Delete Message Reply With Quote
Old 12-06-2007, 07:44 PM  
coldsun
A Kobold Labourer

Forum posts: 0
File comments: 9
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-2007 at 07:47 PM.
coldsun is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 01-03-2007, 05:37 AM  
Zidomo
A Fallenroot Satyr
 
Zidomo's Avatar

Forum posts: 22
File comments: 389
Uploads: 0
Quote:
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.

Quote:
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.

Quote:
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   Edit/Delete Message Reply With Quote
Old 01-02-2007, 08:58 PM  
Dridzt
A Cobalt Mageweaver
Interface Author - Click to view interfaces

Forum posts: 227
File comments: 327
Uploads: 31
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-2007 at 11:00 PM.
Dridzt is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 01-01-2007, 05:14 AM  
Zidomo
A Fallenroot Satyr
 
Zidomo's Avatar

Forum posts: 22
File comments: 389
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-2007 at 05:15 AM.
Zidomo is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 12-29-2006, 03:27 PM  
moird
A Kobold Labourer
 
moird's Avatar
Interface Author - Click to view interfaces

Forum posts: 1
File comments: 6
Uploads: 1
Thanks, I will look into that, Thank you Dridzt
moird is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 12-28-2006, 10:40 PM  
Dridzt
A Cobalt Mageweaver
Interface Author - Click to view interfaces

Forum posts: 227
File comments: 327
Uploads: 31
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-2007 at 09:01 PM.
Dridzt is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Post A Reply



Category Jump:



The Network:
EQInterface | EQ2Interface | LoTROInterface | MMOUI | War.MMOUI | WoWInterface | VGInterface | Allakhazam | Thottbot | Wowhead | Zam


MMOInterface.com Copyright ©2008
World of Warcraft is a registered Trademark of Blizzard Entertainment.
vBulletin - Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.