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

Pages: (3): « First [ 1 ] 2 3 » Last »
Calculator to friends
Author: Message:
mrfireman
Junior Member
**


Posts: 25
Joined: Oct 2008
O.P. Calculator to friends
Dear guys!

You helped me a lot before, and now I have a new question, for whose know the anwer. I want to make a script, which helps to calculate (and I found a lot of script which can calculate) BUT (!) Is there anyway to make one, which gets the information from another partner (in chat window) and gives the solution at the same chat window?

For example: Peter says: - 5+5*2=?
     (My script)  I say: The solution is 20.

Thanks for the answers before!
12-18-2008 12:37 AM
Profile E-Mail PM Find Quote Report
toddy
Veteran Member
*****

Avatar
kcus uoy

Posts: 2573
Reputation: 49
– / Male / Flag
Joined: Jun 2004
RE: Calculator to friends
can i just ask you to clarify whether you want the script to give the correct answer? or whether you'd like the wrong answer given ala your example

plus i see little use for such things, the user can just use windows built in calculator
12-18-2008 01:35 AM
Profile PM Find Quote Report
mrfireman
Junior Member
**


Posts: 25
Joined: Oct 2008
O.P. RE: Calculator to friends
Ohh i misswrote :D I would like to give the script the correct answer :D
If anyone have idea about how to script this plz share with us :) Ty ;)
12-18-2008 01:44 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Calculator to friends
Welcome to JScript. There is a function called eval(). Carry on my wayward son!
12-18-2008 04:04 PM
Profile E-Mail PM Find Quote Report
mrfireman
Junior Member
**


Posts: 25
Joined: Oct 2008
O.P. RE: Calculator to friends
If anyone can script me this, just write here! :) Thanks
12-18-2008 05:56 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Calculator to friends
Why dont you try?

All you need to do is code something that would say look for a remote command like !calc then process the equation after using eval(). Simple
12-18-2008 06:01 PM
Profile E-Mail PM Find Quote Report
mrfireman
Junior Member
**


Posts: 25
Joined: Oct 2008
O.P. RE: Calculator to friends
My only problem is, I cant programming well in msn scripting. I have read the handbook of this scripting, but it just say, which function what does. But how can I write a simple calculator, it doesn't say... so i am stupid about it.
12-18-2008 06:49 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Calculator to friends
I already told you. You don't have to reinvent the wheel you can use the eval() function which will evaluate a mathematical expression.
12-18-2008 07:51 PM
Profile E-Mail PM Find Quote Report
mrfireman
Junior Member
**


Posts: 25
Joined: Oct 2008
O.P. RE: Calculator to friends
Here is a good sample, this calculator can give solution for everything.

http://www.msgpluslive.net/scripts/view/100-Huhu-Calc/

Can anybody write into the script, to work it, how i would like? (My contact have to gives the question, and not me. For example: Peter says: 1+1?, and my chat window gives the answer for him.)

This post was edited on 12-18-2008 at 08:14 PM by mrfireman.
12-18-2008 08:13 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Calculator to friends
Seriously it isn't hard to do if you take the time to learn.

You have the following:

Javascript code:
function OnEvent_ChatWndReceiveMessage(pChatWnd, sOrigin, nMessage, nMessageKind) {
 
}


You can check if the command is !calc by doing something like this:
Javascript code:
if (nMessage.indexOf('!calc') === 0) {
    /* the above if statement checks if the beginning of the message
        is !calc.
    */

}


To get the equation you can do something like this:
Javascript code:
nMessage.substr(6);


Then research how to use eval() or figure out how the script does it.

This post was edited on 12-22-2008 at 03:18 PM by matty.
12-18-2008 08:21 PM
Profile E-Mail PM Find Quote Report
Pages: (3): « First [ 1 ] 2 3 » Last »
« Next Oldest Return to Top Next Newest »


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