|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Thu Oct 21, 2010 2:56 pm
[3.31] Small Bug when entering code from Command Line |
When the following code is pasted to the command line it creates the trigger with a syntax error in the second trigger state.
Code: |
#TRIGGER {^(~[Simyarin~])%s%x} {
#CAP chat
#GAG
}
#COND {^(%s)%x} {
#IF (%len( %1)>1)
{ #CAP chat;
#STATE 1;
#gag
}} |
The code that's generated is
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger priority="10" copy="yes">
<pattern>^(~[Simyarin~])%s%x</pattern>
<value>#CAP chat
#GAG</value>
<trigger name="">
<pattern>^(%s)%x</pattern>
<value>#IF (%len( %1)>1){ #CAP chat;
#STATE 1;
#gag
}</value>
</trigger>
</trigger>
</cmud> |
The key line is
Quote: |
#IF (%len( %1)>1){ #CAP chat; |
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger priority="10" copy="yes">
<pattern>^(~[Simyarin~])%s%x</pattern>
<value>#CAP chat
#GAG</value>
<trigger>
<pattern>^(%s)%x</pattern>
<value>#IF (%len( %1)>1) { #CAP chat;
#STATE 1;
#gag
}</value>
</trigger>
</trigger>
</cmud> |
In the working version The key line is
Quote: |
#IF (%len( %1)>1) { #CAP chat; |
Note the space. |
|
_________________ Asati di tempari! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Oct 21, 2010 5:50 pm |
Your original code has the wrong multiline syntax. When using multiline syntax, either the { needs to be the last thing on the line, or the only thing on the line. So both of these are valid:
Code: |
#IF (%len( %1)>1) {
#CAP chat
#STATE 1
#gag
} |
or
Code: |
#IF (%len( %1)>1)
{
#CAP chat
#STATE 1
#gag
}
|
Also, you shouldn't have the ; characters at the end of the line. The ; character is only for separating multiple commands on the same line. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Thu Oct 21, 2010 6:48 pm |
Actually, you're right I see it now.
By the by, it wasn't my code, it was something I came across when helping debug another forum post. So many hiccups could be avoid with good coding habits. |
|
_________________ Asati di tempari! |
|
|
|
|
|