Shoutbox

An "enter" in an automated sended message - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: An "enter" in an automated sended message (/showthread.php?tid=84120)

An "enter" in an automated sended message by hello123456 on 06-03-2008 at 09:37 PM

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


RE: An "enter" in an automated sended message by roflmao456 on 06-03-2008 at 10:56 PM

code:
\n

;)

Example:
code:
ChatWnd.SendMessage("Message \n example");

RE: RE: An "enter" in an automated sended message by deAd on 06-03-2008 at 11:02 PM

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.
RE: RE: RE: An "enter" in an automated sended message by hello123456 on 06-04-2008 at 08:21 PM

Ah, thank you both ;)
Tested and working :)


RE: An "enter" in an automated sended message by CookieRevised on 06-04-2008 at 11:49 PM

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


RE: An "enter" in an automated sended message by markee on 06-05-2008 at 03:02 AM

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.


RE: An "enter" in an automated sended message by dexluther on 06-06-2008 at 08:47 PM

I just write what I want how I want in Wordpad or something and then copy and paste it.


RE: An "enter" in an automated sended message by CookieRevised on 06-06-2008 at 08:52 PM

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
RE: RE: An "enter" in an automated sended message by dexluther on 06-07-2008 at 04:49 PM

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 :$