Download
(7 Kb)
Download
Updated: 02/28/20 12:26 AM
Pictures
File Info
Compatibility:
Harrowstorm (5.3.5)
Updated:02/28/20 12:26 AM
Created:08/13/14 02:42 PM
Monthly downloads:69
Total downloads:11,062
Favorites:17
MD5:
Categories:Chat Mods, Auction House & Vendors, TradeSkill Mods, Miscellaneous, Utility Mods
Calculator  Popular! (More than 5000 hits)
Version: 3.3.7
by: zeroIndex [More]
--------- Calculator -----------


The text used in the Chat section of the calculator can handle non standard and standard symbols to achieve your goal: Addition: 'a' or '+', Subtraction: 's' or '-', Multiplication: 'm', 'x', or '*', and Division: 'd' or '/'. I added the extra symbols because its much easier to type m or a than search for the proper symbol.

This calculator uses the chat box with the command /calc.
An example: /calc 1+10-4/2*6
You can also use parenthesis for deeper calculations: /calc (12-3)(4/2)
An example of easy symbol input: /calc 1a2m3d2s1

You can calculate using your answer instead of having to type in your answer manually.
You can use the keywords " Answer, answer, Ans or ans " in the chat input.

Like so:
/calc answer + 2
/calc ans + 2

This works with the use of the easy input symbols as well.
/calc ans m 2 a 3
/calc answer m 2 a 3

You don't have to worry about spaces, just the order of operations.

There is also a UI for those of you who would prefer to click for your results

You can set a keybind to allow for a quick open/close of the calculator UI or you can use:
/calc open
/calc close
/calc

There are some options to customize the colors of the calculator to better fit your taste.
There is an option to add the answer from the UI to the chat box. In case you want to look back over your previous numbers or turn it off if its too intrusive.

Please see the attached pictures as they show examples of how the calculator works and what it looks like.


I was tired of tabbing out or looking for my phone when I had to use a calculator so I put this addon together. If you are a seller or if you like to crunch numbers for builds this addon will save you some grief and time. Check it out and feel free to ask if you have any questions, any feed back will be appreciated.


This addon depends on LibAddonMenu if you dont have that library you can find it here https://www.esoui.com/downloads/info7-LibAddonMenu.html add it to your addon folder just like any other addon.
--Version 3.3.7--
Updated the API number 100030
Fixed an error that was occurring due to changes in the chat system.
Removed the option to send the answer to all chat tabs. That option is now always on due to the changes in the chat system.
Removed LibAddonMenu-2.0 from Calculator as it's now a standalone library.


--Version 3.3.6--
Updated the API info
Fixed a bug if you just type /calc. Now typing /calc opens and closes the UI (thanks Phuein!)
Fixed a bug if you were to just hit the '=' button in the UI without an input.
Updated LibAddonMenu2.0 to the newest version to fix a menu error.
Added the ability to reuse your answer in the chat input instead of manually typing it back in.

--Version 3.3.5--
Updated the API info

--Version 3.3.4--
Updated the API info
Removed an extra space in the name causing the addon to appear out of order in the list of addons

--Version 3.3.3 --
Updated the API info


--Version 3.3.2--
Updated the API info


--Version 3.3.1--
Updated the API info


--Version 3.3--
Removed functions from global land
Limited the number of decimals to two, no more .33333333333


--Version 3.2--
The lazy options for the chat box input are back.
You can now type 'a' instead of '+'
and 'm' or 'x' instead of '*'
and 'd' instead of '/'
and 's' instead of '-'

Options were added to be able to send the answer from the UI input into the chat tab in case you want to look back over previous numbers.
Optional Files (0)


Post A Reply Comment Options
Unread 01/20/16, 10:49 AM  
coolmodi
AddOn Author - Click to view AddOns

Forum posts: 47
File comments: 55
Uploads: 3
Why don't you just make the UI behave like a real calculator by adding brackets and just showing whatever you enter, pressing = will then solve it, as long as the syntax was correct. Would be much more useful that way if you could just enter stuff like (x+y)*(z-w).

Edit: You also haven't defined LAM2 used on line 146, that throws an error. You need:
Lua Code:
  1. local LAM2 = LibStub("LibAddonMenu-2.0")

Another thing:

Lua Code:
  1. function CalcHandleMultipleEntryOperator(value, valueTwo, operator)
  2.    
  3.    [snip]
  4.  
  5.     --I feel like since this stuff is all in the same file i dont
  6.     -- need to pass anything in or return anything
  7.     --so this is prob pointless, but it works.. so okay
  8.    return value
  9. end

If your function is used to fill a value, like you do here

Lua Code:
  1. value =  CalcHandleMultipleEntryOperator(value, valueTwo, operator)

you need to return something, whatever you return is what "value" is set to. So it's not pointless

Edit: Oh wait, value is defined localy for the whole file, but then you can just call the funtion and really don't need the return.

Lua Code:
  1. CalcHandleMultipleEntryOperator(value, valueTwo, operator)
instead of
Lua Code:
  1. value =  CalcHandleMultipleEntryOperator(value, valueTwo, operator)

Edit: And the last thing for now
Why not remove the "Button" from all buttons and only leave the number or symbol? If you don't want them to be at the top of the button you can center them by adding
verticalAlignment="CENTER"
and then make it bigger by using a bigger font, you can use any size you want by changing the number, e.g.
Code:
font="$(BOLD_FONT)|30|soft-shadow-thin"
Last edited by coolmodi : 01/20/16 at 11:26 AM.
Report comment to moderator  
Reply With Quote
Unread 08/14/14, 02:21 PM  
zeroIndex
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 18
Uploads: 2
Originally Posted by DeanGrey
Could you expand the description to mention what its limits are a bit more? Is it addition or is there multiplication, subtraction and division as well? Is there support for decimals?
Thank you for the input. I have updated the description in hopes to help clarify things up a bit. I also posted a picture of how it works. I updated the addon because the input of decimals was not working however the output was fine. I missed that :/
Report comment to moderator  
Reply With Quote
Unread 08/14/14, 07:26 AM  
DeanGrey
 
DeanGrey's Avatar
AddOn Author - Click to view AddOns

Forum posts: 22
File comments: 90
Uploads: 3
Could you expand the description to mention what its limits are a bit more? Is it addition or is there multiplication, subtraction and division as well? Is there support for decimals?
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: