Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ General
➜ Using variables and AppendtoNotepad
Using variables and AppendtoNotepad
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Chaosmstr
(21 posts) Bio
|
Date
| Mon 08 Sep 2014 11:28 PM (UTC) |
Message
| So, I have three notepad windows opening up when I go online so that I can send various chat type msgs to the respective window.
Tells, Says, and Gossips
I can't get the trigger to move to a new line after inserting the text into the appropriate window.
<triggers>
<trigger
enabled="y"
match="* tells you *"
send_to="12"
sequence="1"
>
<send>AppendToNotepad ("Tells", "%0\r\n")</send>
</trigger>
</triggers>
This gives me an error of
Error number: 0
Event: Compile error
Description: [string "Trigger: "]:1: unfinished string near '"John tells you Boo! '
Called by: Immediate execution
Just the %0 appends it to the notepad window fine, but puts it all on the same line.
What am I missing here?
CM | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 09 Sep 2014 12:30 AM (UTC) |
Message
| The "send to" box preprocesses \r and \n before it reaches Lua.
So what Lua saw was:
AppendToNotepad ("Tells", "%0
")
That gave an error. To fix this, double the number of backslashes:
<triggers>
<trigger
enabled="y"
match="* tells you *"
send_to="12"
sequence="1"
>
<send>AppendToNotepad ("Tells", "%0\\r\\n")</send>
</trigger>
</triggers>
|
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
9,119 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top