What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Calculator to friends

Calculator to friends
Author: Message:
Pinecone
New Member
*

Avatar
Coffee Powered

Posts: 9
34 / Male / Flag
Joined: Dec 2008
RE: Calculator to friends
The following is untested. Should work with a few tweaks i think.

Ascii range 40 - 57 contains the following characters:
()*+,-./0123456789

code:
function OnEvent_ChatWndRecieveMessage(ChatWnd, Message) {
    if (Message.substring(0,6).toLowerCase() != '!calc ') return Message;
    var Msg = Message.substring(6, Message.length);
    var Valid = true, j;
    for (j=0; j<Msg.length; j++) if ((Msg.charCodeAt(j) < 40) || (Msg.charCodeAt(j) > 57))
        Valid = false;
    ChatWnd.SendMessage(Valid ? eval(Msg) : 'The calculation contained invalid characters.');
    return Message;
}


This post was edited on 12-21-2008 at 11:15 AM by Pinecone.
12-21-2008 11:14 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Calculator to friends - by mrfireman on 12-18-2008 at 12:37 AM
RE: Calculator to friends - by toddy on 12-18-2008 at 01:35 AM
RE: Calculator to friends - by mrfireman on 12-18-2008 at 01:44 PM
RE: Calculator to friends - by matty on 12-18-2008 at 04:04 PM
RE: Calculator to friends - by mrfireman on 12-18-2008 at 05:56 PM
RE: Calculator to friends - by matty on 12-18-2008 at 06:01 PM
RE: Calculator to friends - by mrfireman on 12-18-2008 at 06:49 PM
RE: Calculator to friends - by matty on 12-18-2008 at 07:51 PM
RE: Calculator to friends - by mrfireman on 12-18-2008 at 08:13 PM
RE: Calculator to friends - by matty on 12-18-2008 at 08:21 PM
RE: Calculator to friends - by mrfireman on 12-18-2008 at 09:03 PM
RE: Calculator to friends - by matty on 12-18-2008 at 09:05 PM
RE: Calculator to friends - by Chrono on 12-18-2008 at 09:12 PM
RE: Calculator to friends - by matty on 12-18-2008 at 09:15 PM
RE: Calculator to friends - by mrfireman on 12-18-2008 at 09:22 PM
RE: Calculator to friends - by WDZ on 12-19-2008 at 06:06 AM
RE: Calculator to friends - by Matti on 12-19-2008 at 08:31 AM
RE: RE: Calculator to friends - by segosa on 12-20-2008 at 05:11 AM
RE: Calculator to friends - by mrfireman on 12-19-2008 at 10:12 PM
RE: Calculator to friends - by TheBlasphemer on 12-20-2008 at 09:33 PM
RE: Calculator to friends - by Pinecone on 12-21-2008 at 11:14 AM
RE: Calculator to friends - by Spunky on 12-21-2008 at 11:56 PM
RE: Calculator to friends - by Matti on 12-22-2008 at 10:58 AM
RE: Calculator to friends - by mrfireman on 12-22-2008 at 12:35 PM
RE: Calculator to friends - by mrfireman on 12-23-2008 at 05:18 PM
RE: Calculator to friends - by Pinecone on 12-23-2008 at 05:26 PM


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