What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [release] PlusRemote v2.0a

[release] PlusRemote v2.0a
Author: Message:
Plan-1130
Full Member
***

I keep askin' myself: why?

Posts: 142
73 / Male / –
Joined: Feb 2005
O.P. RE: [release] PlusRemote 1.1
After some time of inactivity concerning PlusRemote, I decided to rewrite it. It will use a new way to extract commands and arguments, and therefor many features will improve dramatically.
Using Regular Expressions it will extract agruments in a way most programmers, and hopefully everyone will understand.
code:
    1:  var args = new Array(Message);
    2:  var re = /["](?:\\"|[^"])*["]|\S+/g;
    3:  while((match = re.exec(Message)) != null){
    4:         item = match.toString().replace(/(^")|("$)/g,"").replace(/\\"/g, "\"");
    5:         args.push(item);
    6:  }

As you can see, i've learnt Regular Expressions very well, because -if i may say so myself- it's a very intelligent script that does the following:

On line 1 it will create a new array that will soon contain the decrypted commands and arguments, with args[0] being the full, unencrypted string that was used for input.

On line 2 you will find the brain behind it all. It will split the message by the spaces, but leave strings with spaces in "string with spaces"-format fully intact. And can leave, in such a string the escaped quotation marks intact also.
For example, if someone types:
code:
!command hello "my name is" "Harry \"freshman\" Johnson"
it will extract
code:
!command
hello
"my name is"
"Harry \"freshman\" Johnson"

On line 3 it will loop for every arguments found (end at line 6)

On line 4 it will clean up the arguments, removing the first and last quotation mark, and will replace every escaped quotation mark, with just a quotation mark.

On line 5 it will put every single cleaned-up argument found in the array args[]


This piece of code you may use in your script free of charge, but as a thanks I would like to be noted on the Aboutscreen of your script :)

PS: further updates coming... :)
My Scripts: UltimatFlooder, Advanced PSM Chat, PlusPrivacy, PlusRemote

[Image: Plan-1130.png]
01-18-2008 03:16 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[release] PlusRemote v2.0a - by Plan-1130 on 10-16-2006 at 09:18 PM
RE: [beta] PlusRemote - by prashker on 10-16-2006 at 09:27 PM
RE: [beta] PlusRemote - by Plan-1130 on 10-16-2006 at 09:36 PM
RE: [beta] PlusRemote - by prashker on 10-16-2006 at 10:11 PM
RE: [beta] PlusRemote - by Chris4 on 10-17-2006 at 10:09 PM
RE: [beta] PlusRemote - by Plan-1130 on 10-18-2006 at 10:47 AM
RE: [beta] PlusRemote - by mrmt32 on 10-20-2006 at 07:48 PM
RE: [beta] PlusRemote - by Plan-1130 on 10-20-2006 at 08:09 PM
RE: [beta] PlusRemote - by mrmt32 on 10-20-2006 at 08:40 PM
RE: [beta] PlusRemote - by Plan-1130 on 10-20-2006 at 08:41 PM
RE: [release] PlusRemote 1.1 - by Plan-1130 on 10-24-2006 at 09:17 PM
RE: [release] PlusRemote 1.1 - by beny333 on 01-13-2007 at 07:37 AM
RE: [release] PlusRemote 1.1 - by Felu on 01-13-2007 at 08:23 AM
RE: [release] PlusRemote 1.1 - by verytheyoung on 03-18-2007 at 04:07 AM
RE: RE: [release] PlusRemote 1.1 - by Plan-1130 on 04-14-2007 at 10:08 PM
RE: [release] PlusRemote 1.1 - by MeEtc on 04-17-2007 at 05:14 PM
RE: [release] PlusRemote 1.1 - by Plan-1130 on 04-18-2007 at 05:35 PM
RE: [release] PlusRemote 1.1 - by gawduranidiot on 06-18-2007 at 02:35 AM
RE: [release] PlusRemote 1.1 - by rapkyt on 11-06-2007 at 02:21 PM
RE: [release] PlusRemote 1.1 - by Plan-1130 on 01-18-2008 at 03:16 PM
RE: [release] PlusRemote v2.0a - by squomas08 on 04-16-2008 at 02:40 PM
RE: [release] PlusRemote v2.0a - by Toksick on 03-09-2009 at 07:47 PM
RE: [release] PlusRemote v2.0a - by pray2win on 03-10-2009 at 01:54 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