When I create a trigger and try to have it do a multi-line /world.DoAfter I get the following error:
Error number: -2146827255
Event: Execution of line 1 column 27
Description: Unterminated string constant
Line in error:
world.DoAfter 1, "command1
Called by: Immediate execution
I am putting the following into the "Send:" area:
/world.DoAfter 1, "command1
command 2"
VBscript doesn't let you have linefeeds inside strings. You could do something like:
/world.DoAfter 1, "command1"
world.DoAfter 1, "command 2"
However the sequence won't necessarily be what you expect. A better way might be:
/world.DoAfter 1, "command 1" & vbCrLf & "command 2"
That puts a linefeed into the string itself.
Thanks! It works, and very well I might add.
I do have a follow-up question though. Do any of the other scripting languages allow for the linefeeds inside strings?
I think JScript might, C allows them, I don't know about Java/JScript... Just try it :P
That sounds pretty interesting.
Well, that's it for me on this topic.
Thanks again, everyone!
You can do it a bit more neatly in Jscript, like this:
DoAfter (1, "laugh\\nsigh");
Normally it would be \n but MUSHclient expands out \n internally (if it is in the "Send" box) so you need two \\ before the "n".
However in a script file it would be:
DoAfter (1, "laugh\nsigh");
By the way, the expanding sequences is a security "hole", since if you have a trigger that matches on "* says '*'" and you send "laugh %1", they could do something like
Poromenos\npassword 123 123\nhe says 'test' and it would cause you to send
laugh Poromenos
password 123 123
he
Its things like that which make getting to know regexps and making triggers as specific as possible worth while.
The \n is expanded in the trigger send box, not the wildcard expansions. So, if you try what you suggested you would actually see:
laugh Poromenos \n password 123 123