What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Pow... err, triggering some function on certain convo events?

[?] Pow... err, triggering some function on certain convo events?
Author: Message:
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: [?] Pow... err, triggering some function on certain convo events?
Well, I haven't gone through all your code to know if I'm changing the right thing, but for functions, I think you can add .toLowerCase() to Token in some places so that the code reads:
code:
if (typeof(Math[Token.toLowerCase()])=="function" || eval("typeof("+Token+")=='function'")) {
   if (eval("typeof("+Token+")!='function'")) {
      Token = "Math." + Token.toLowerCase()
   }
   (...)
I'm not sure what to do for properties though, because I don't know where these are evaluated. :S

Also, it seems that sometimes the values are approximated before further functions are performed on them. For example, "sin(PI)" doesn't return "0", but "1.22460635382238E-16" (really close to 0). I guess this doesn't matter too much, but it would be good if it returned "0". :)

As for the degrees, I think this works for sin, cos and tan (not sure about asin, acos, atan and atan2 though):
code:
for (Index in Params) {
   Params[Index] = Params[Index].Calculate()
   if(Degrees & /\b(cos|sin|tan)\b/.test(Token)) Params[Index] *= Math.PI / 180
}
Degrees is a global boolean. (Y)

EDIT: Found where to change for properties. :)
code:
if (typeof(Math[Operands[Index].toUpperCase()]) != "undefined" && typeof(Math[Operands[Index]]) != "function") {
   Operands[Index] = Math[Operands[Index].toUpperCase()]
}
This time we use .toUpperCase because the properties are uppercase.

EDIT #2: I've also just noticed that the calculate function will parse "1 + 2 + 3" and "1+(2+3)" but not "1+ (2+3)". Any way to fix that? (It seems to not parse if there is a space before the open bracket.)

This post was edited on 09-18-2006 at 10:45 AM by phalanxii.
09-18-2006 08:02 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[?] Pow... err, triggering some function on certain convo events? - by Matti on 09-16-2006 at 11:41 AM
RE: [?] Powers - by markee on 09-16-2006 at 11:51 AM
RE: [?] Powers - by Matti on 09-16-2006 at 12:06 PM
RE: [?] Powers - by markee on 09-16-2006 at 12:23 PM
RE: [?] Powers - by CookieRevised on 09-16-2006 at 01:27 PM
RE: [?] Powers - by Matti on 09-16-2006 at 02:02 PM
RE: [?] Powers - by CookieRevised on 09-16-2006 at 02:11 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by Matti on 09-16-2006 at 02:25 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by deAd on 09-16-2006 at 08:00 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by Matti on 09-17-2006 at 09:19 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by phalanxii on 09-17-2006 at 10:18 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by Plik on 09-17-2006 at 12:30 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by Matti on 09-17-2006 at 12:38 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by markee on 09-17-2006 at 12:46 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by Matti on 09-17-2006 at 01:04 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by Shondoit on 09-17-2006 at 03:30 PM
RE: RE: [?] Pow... err, triggering some function on certain convo events? - by CookieRevised on 09-17-2006 at 11:03 PM
RE: RE: RE: [?] Pow... err, triggering some function on certain convo events? - by deAd on 09-17-2006 at 11:18 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by CookieRevised on 09-17-2006 at 11:42 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by phalanxii on 09-18-2006 at 03:54 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by Shondoit on 09-18-2006 at 05:57 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by phalanxii on 09-18-2006 at 08:02 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by Shondoit on 09-18-2006 at 11:09 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by Matti on 09-18-2006 at 06:35 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by Shondoit on 09-18-2006 at 08:07 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by phalanxii on 09-18-2006 at 11:15 PM
RE: RE: [?] Pow... err, triggering some function on certain convo events? - by CookieRevised on 09-19-2006 at 06:34 AM
RE: RE: RE: [?] Pow... err, triggering some function on certain convo events? - by phalanxii on 09-19-2006 at 06:48 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by Shondoit on 09-19-2006 at 05:20 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by CookieRevised on 09-19-2006 at 10:50 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by phalanxii on 09-19-2006 at 12:16 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by Matti on 09-19-2006 at 06:33 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by Shondoit on 09-19-2006 at 08:53 PM
RE: [?] Pow... err, triggering some function on certain convo events? - by phalanxii on 09-20-2006 at 12:31 AM
RE: [?] Pow... err, triggering some function on certain convo events? - by Shondoit on 09-20-2006 at 05:06 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On