What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » An idea for a script

An idea for a script
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: An idea for a script
quote:
Originally posted by saralk
What about a command like "/math 2 + 3" which would send "2 + 3 = 5"
Dead easy actually, all you need to do is to grab the command line parameter and let JScript evaluate it:
   return CommandParameter + " => " + eval(CommandParameter)


Attached is a full blown script which does exactly that.
Usage:
   /calc <math expression>

Examples:
   /calc (5+5)*8/20+3                   output: (5+5)*8/20+3 => 7
   /calc (5+5)==11                       output: (5+5)==11 => false
   /calc    5  <new line>  +     5         output: 5 + 5 => 10
   /calc 5///////5                          output: standard Plus! "invalid parameter" message box
   /calc                                      output: standard Plus! "no parameter" message box


it also gives an example in:
- how to split the command and parameter from eachother in a very easy way using 1 regular expression in 1 IF...THEN...ELSE function.
- how to show a standard Plus! error message, using Plus!'s own translations

see source for more info




.plsc File Attachment: Calculator.plsc (2.92 KB)
This file has been downloaded 229 time(s).

This post was edited on 09-15-2006 at 02:59 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-15-2006 02:44 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
An idea for a script - by lu_benja on 09-14-2006 at 02:15 PM
RE: An idea for a script - by Matti on 09-14-2006 at 02:23 PM
RE: An idea for a script - by alexp2_ad on 09-14-2006 at 02:25 PM
RE: An idea for a script - by Jimbo on 09-14-2006 at 02:41 PM
RE: An idea for a script - by Shondoit on 09-14-2006 at 03:39 PM
RE: An idea for a script - by lu_benja on 09-14-2006 at 04:00 PM
RE: An idea for a script - by Jimbo on 09-14-2006 at 04:17 PM
RE: An idea for a script - by Matti on 09-14-2006 at 04:29 PM
RE: An idea for a script - by R4000 on 09-14-2006 at 05:07 PM
RE: An idea for a script - by saralk on 09-14-2006 at 06:19 PM
RE: An idea for a script - by Matti on 09-14-2006 at 06:48 PM
RE: An idea for a script - by ForestPlus! on 09-14-2006 at 07:32 PM
RE: An idea for a script - by Matti on 09-15-2006 at 07:34 AM
RE: An idea for a script - by CookieRevised on 09-15-2006 at 02:44 PM
RE: An idea for a script - by Spunky on 09-15-2006 at 03:17 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