PDA

View Full Version : Neph's Macro of the Week #4: Mathaginator!


Nephyrin
03-20-2006, 12:46 AM
Seeing as I'm a nutjob, I always keep a ti-89 near my desk so I can calculate DPS and... a lot of other pointless things.

SO, I figured I needed an eazier way to access the math functions built into WoW! And here it is!

For math displaying as a fading green message of awesome:
/script SlashCmdList["MATHAGINATOR"] = function(msg) msg = "mathmacro =" .. msg; mathmacro = "Invalid Syntax"; RunScript(msg); UIErrorsFrame:AddMessage(mathmacro,0,1,.5,1,2); end; SLASH_MATHAGINATOR1 = "/math";

Or, if you just want the output to goto the chat area like a lamer:
/script SlashCmdList["MATHAGINATOR"] = function(msg) msg = "mathmacro =" .. msg; mathmacro = "Invalid Syntax"; RunScript(msg); ChatFrame1:AddMessage(mathmacro,0,1,.5); end; SLASH_MATHAGINATOR1 = "/math";

Now you can do things like:

/math 2 + 2
or
/math sqrt(27 + (19 / 2.7)) / 90^2 + abs(-1337)
If you've ever used a graphing calculator the syntax is nearly the same. Some basic functions:

sqrt(#) - Returns the squareroot of #
abs(#) - Returns the aboslute value of #
sin(#) - duh (All values in degrees!)
cos(#) - duh
math.pi = PI!

/math 22/7 - math.pi
WEE

Enjoy.

Yes I know it's 'macro of the WEEK' not MONTH, but, uhh.... /cast Vanish

morbid_o
03-20-2006, 01:42 PM
I use sky's /print command ;) :P

/print 2+2

Nephyrin
03-20-2006, 02:50 PM
I use sky's /print command Wink Razz

/print 2+2So did I, but then I put this together! I like the middle-of-screen-ness better since it doesn't clog up my chat with 900 messages and you can't overlook that it is GREEN!

babydaddy
03-20-2006, 06:51 PM
You could always call them "featured macros" instead of setting expectations that they'll be periodic and regular.

ncf
03-21-2006, 10:40 PM
Perhaps even simpler:

mathmacro = "Invalid Syntax";
RunScript("mathmacro =" .. msg);

BlackZam
03-22-2006, 02:41 PM
Can you add this to cosmos? :)

ncf
03-22-2006, 07:47 PM
Converting this to a standard UI (However Non-Cosmos specific).

Will edit this post once finished!

Szereck
05-27-2006, 05:36 AM
Ok.... This is pretty cool but now how do I get the fading green message of awesome to actually fade and disappear?

Miravlix
05-27-2006, 08:19 AM
Spam 3 attacks with no target. o.O

Well it does clear the 3 line UI Error window. :)

Nephyrin
05-27-2006, 10:13 PM
I updated it to have a 2 second display time. You can adjust this time by changing the last number in the UIErrorsFrame:AddMessage(....) thing.