What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » An "enter" in an automated sended message

An "enter" in an automated sended message
Author: Message:
hello123456
New Member
*


Posts: 6
Joined: May 2008
O.P. An "enter" in an automated sended message
Usually if I want to typ on more lines to keep everything readable, I press ctrl+enter for al layer break.
But how do I do something like that in a script?
What I mean is: ChatWnd.SendMessage("Message "enter" example")
So the message will be:
Message
example

And not: Message example.


Thanks in advantage, hello123456

This post was edited on 06-03-2008 at 09:42 PM by hello123456.
06-03-2008 09:37 PM
Profile E-Mail PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
RE: An "enter" in an automated sended message
code:
\n

;)

Example:
code:
ChatWnd.SendMessage("Message \n example");
[quote]
Ultimatess6
: What a noob mod
06-03-2008 10:56 PM
Profile PM Web Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: RE: An "enter" in an automated sended message
quote:
Originally posted by roflmao456
code:
ChatWnd.SendMessage("Message \n example");

This is getting a bit picky, but if you do that the message will be formatted with extra spaces. If you wanted it to look like how somebody would actually type it, the code would look like this:
code:
ChatWnd.SendMessage("Message\nexample");
The "\n" will still be replaced.

This post was edited on 06-03-2008 at 11:02 PM by deAd.
06-03-2008 11:02 PM
Profile PM Find Quote Report
hello123456
New Member
*


Posts: 6
Joined: May 2008
O.P. RE: RE: RE: An "enter" in an automated sended message
Ah, thank you both ;)
Tested and working :)

This post was edited on 06-04-2008 at 08:26 PM by hello123456.
06-04-2008 08:21 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: An "enter" in an automated sended message
note:

\n is a character escape code. Such codes are used to enter special non-printable characters which you otherwise can't type. They are used in many programming languages. eg:

\0 (ascii code 0x00) Null character
\a (ascii code 0x07) Bell
\b (ascii code 0x08) Backspace
\t (ascii code 0x09) Horizontal Tab
\n (ascii code 0x0A) Line feed
\v (ascii code 0x0B) Vertical Tab
\f (ascii code 0x0C) Form feed
\r (ascii code 0x0D) Carriage return

\\ (ascii code 0x52) Backslash.
Since the backslash on its own is used to enter a special code (the escape codes) or to tell the interpreter it must take the next character literally (except for the ones listed above), you can't use just 1 backslash if you want to enter a backslash. You need to double it up.

\" (ascii code 0x22) Double quote
Used for when you need to enter a double quote while the string itself is also between double quotes. eg:
"Hello "World"..." will not be a valid string since the program interpreter will struggle to know where the exact string begins and ends since you used more than two double quotes. Solution is to use single quotes to encapsulate the string: 'Hello "World"...'. Or escape the literal double quote character so the interpreter knows it must take the double quote literally as a character and not as the beginning or ending of a string: "Hello \"World\"..."


\' (ascii code 0x27) Single quote
similar to \" but for single quotes.

Then there is also the use for entering any character code you like by using the hexadecimal value of the character:

\x?? (hexadecimal ascii code ??) For example: /x41 will produce the ascii code 0x41 or 65 in decimal, which is the capital A.

\u???? (hexadecimal unicode code ????) For example /u1234 will produce the unicode code 0x1234, or 4660 in decimal.

\??? (octal ascii code ??? (between 000 and 377)) For example /101 will produce the decimal ascii code 65, which is the capital A.

Not all escape codes are supported in all programming languages and/or in all situations. And some escape codes have different syntaxes in other languages (eg: /u{????} in Perl)

-----------------------

For stuff like this, see the Official Help and Documentation for JScript, which can be downloaded from the official Messenger Plus! site:
http://www.msgpluslive.net/scripts/view/152-Windo...ipt-Documentation/ > JScript User's Guide > Advanced JScript > Special Characters
Which can also be consulted online in the MSDN library

This post was edited on 06-04-2008 at 11:59 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
06-04-2008 11:49 PM
Profile PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: An "enter" in an automated sended message
Also it should be noted that different operating systems use different conventions when creating new lines.  What has been recommended is not fully correct.

\n    - Linux/Unix
\r\n - Windows

This is something which also leads to problems when people try to use edit controls in Plus! windows as well.
[Image: markee.png]
06-05-2008 03:02 AM
Profile PM Find Quote Report
dexluther
Junior Member
**


Posts: 23
Joined: Jun 2007
RE: An "enter" in an automated sended message
I just write what I want how I want in Wordpad or something and then copy and paste it.
06-06-2008 08:47 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: An "enter" in an automated sended message
quote:
Originally posted by dexluther
I just write what I want how I want in Wordpad or something and then copy and paste it.
which will never work in cases like this
.-= A 'frrrrrrrituurrr' for Wacky =-.
06-06-2008 08:52 PM
Profile PM Find Quote Report
dexluther
Junior Member
**


Posts: 23
Joined: Jun 2007
RE: RE: An "enter" in an automated sended message
quote:
Originally posted by CookieRevised
quote:
Originally posted by dexluther
I just write what I want how I want in Wordpad or something and then copy and paste it.
which will never work in cases like this

Oh sorry lol I misread the question :$
06-07-2008 04:49 PM
Profile E-Mail PM Find Quote Report
« 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