|
hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Fri Dec 15, 2006 11:22 am
[1.24] commenting out lines |
Tried commenting out the line with #SPEAK since mudreader plugin is yet unsupported.
Code: |
#IF ((@hp<@hpmax-10) AND (@alerthp = 0)) {
#SPEAK "green alert"
#VAR alerthp 1
} |
Is cmud supposed to be so picky about comment placement?
Gives unmatched braces with both
// #SPEAK "green alert"
and
; #SPEAK "green alert"
Has to have two spaces and // to compile
Code: |
#IF ((@hp<@hpmax-10) AND (@alerthp = 0)) {
//#SPEAK "green alert"
#VAR alerthp 1
} |
On unrelated to comments note, could you please improve interface regarding which scripts have been successfully compiled? Currently it's pretty messy, I haven't found any obvious way to tell which ones are working, I have to click on the trigger and then press CTRL-K. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri Dec 15, 2006 3:25 pm |
You need to run the compatibility report. That will tell you if a script compiled or not. It runs through and lists if everything compiled or not. Also you can click on the compiled tab at the bottom of the trigger window.
Yes comments are still a little quirky with some things. But you also now have a much larger notes field than you had in Zmud.
And finally this is the general discussion board mainly meant for asking questions and posting comments. If you want to ask Zugg for something new or tell him about something being broken that is still meant for the cMud beta forum or failing that you can send a comment via cMud or an email to support. Zugg is currently taking a much deserved Vacation. He may pop in for the first few days but he most likely wont be doing any coding until after the new year. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Dec 15, 2006 3:48 pm |
You need to put a space after the // characters for it to work as a comment.
|
|
|
|
hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Fri Dec 15, 2006 7:24 pm |
Zugg wrote: |
You need to put a space after the // characters for it to work as a comment. |
That is not what I am getting with 1.24. I need spaces before // characters, not after, as many as there is indentation for the block.
For example, simple alias test.
this will work and output success on screen.
Code: |
#IF (1) {
//#SPEAK success
#ECHO success
} |
These will generate ERROR: Syntax error in Alias: test : unmatched braces
Code: |
#IF (1) {
// #SPEAK success
#ECHO success
} |
Code: |
#IF (1) {
; #SPEAK success
#ECHO success
} |
Code: |
#IF (1) {
// #SPEAK success
#ECHO success
} |
Also, I think I mentioned it in some other topic, but i'd really like to see an option for unrecognized #COMMANDS to be ignored. If I am using #COMMANDS from some plugin and that plugin isn't loaded, in zmud that's no problem but in cmud those scripts stop compiling and come to a screeching halt. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Dec 15, 2006 10:35 pm |
That is intentional, per the multiline rules. Anything within a codeblock needs to adhere to the proper indentation rules.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Sat Dec 16, 2006 3:58 am |
I hope it's not intentional, and if it is I ask to reconsider. Very counter-intuitive. I'd rather have looser syntax like zmud so I can write a script, hit compile and forget it rather than fiddle figuring where I need spaces for it to work.
|
|
|
|
Strakc Apprentice
Joined: 31 Jan 2006 Posts: 106 Location: Virginia Beach, Virginia
|
Posted: Sat Dec 16, 2006 5:54 am |
Well the thinking on it was to make it more like an acutal programming language. Making it more strict, and better looking all at once is just a bonus for everyone.
|
|
|
|
hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Sat Dec 16, 2006 6:57 am |
How many languages do you know that require comment sign to use indentation or it won't work? Maybe I've been using the wrong languages, the ones I've been using I can drop // or # or whatever at start of line and it will work
I don't think everyone will think of forcefully enforcing indentation as a bonus. |
|
|
|
Strakc Apprentice
Joined: 31 Jan 2006 Posts: 106 Location: Virginia Beach, Virginia
|
Posted: Sat Dec 16, 2006 7:34 am |
I rather be able to read it then, and know what its doing then not.
|
|
|
|
|
|