 |
talonnb Apprentice
Joined: 30 Oct 2004 Posts: 127
|
Posted: Sat Nov 08, 2008 5:06 am
//comment generating a prompt? |
any comment I leave in triggers or aliases are generating a prompt when it processes the code, is there any way around this cause some of my stuff is pretty heavily documented and it spams me to death with prompts pretty bad.
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Nov 08, 2008 6:44 am |
#NOOP.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Sat Nov 08, 2008 7:14 pm |
Or use the colon on the start of a newline which creates a comment as well.
Example:
Code: |
#ALIAS pp {
; Initiate power push with an automatic repetition til the object is pushed all the way <--- this is a comment :)
Power Push %1
#T+ PowerPushRepeat
} |
|
|
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Nov 08, 2008 8:13 pm |
#NOOP doesn't get messed with if the comment is within a non-setting level code block.
#if (this) {
; this is not a valid comment in ZMud
} {
#noop but this one is
}
Unfortunately, #NOOP still returns a screen-only carriage return so you will end up with whitespace equal to the number of #NOOP comments you are using. |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Nov 08, 2008 11:23 pm |
Umm, #NOOP doesn't "return" anything. At least it doesn't generate any CR here. All it does is expand it's arguments. #commands do not have return values.
Using ; for a comment should work fine though. I tried Ralgith's example and it seemed to work here.
The // comment can only be used at the end of an existing command line, and there MUST be a space after the // characters. So doing:
#SHOW "Hello world" // this is a comment
should work fine. |
|
|
 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sun Nov 09, 2008 12:24 am |
Urm... If you EVER plan to upgrade to CMUD and you have a lot of comments I don't suggest using ; at the beginning of a line for a comment.
;This IS a valid comment in ZMud
I had to go through hundreds of triggers and aliases to fix them.
Command
;comment
command
Got converted to
Command;comment;command that is commented out
Edit: Mind you that part of the problem was a lot of these scripts had compatibility errors anyway.
The comments at the beginning of the line using a ; just made things worse. |
|
_________________ 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: Sun Nov 09, 2008 3:32 am |
Bah, sorry, I didn't realize I was answering a post in the zMUD forum. zMUD has several bugs relating to comments and multiline scripts. They just won't work properly. The help I posted above was for CMUD, sorry.
The ; comments work fine in CMUD, but if you try to use them in zMUD and then convert your scripts to CMUD, the comments might not convert properly. It's basically a problem with the limited support for multiline scripts in zMUD. zMUD likes to convert everything to a single-line, especially if you export. |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Nov 09, 2008 3:43 am |
Quote: |
Umm, #NOOP doesn't "return" anything. At least it doesn't generate any CR here. All it does is expand it's arguments.
|
It was a semantic choice of words, Z. The carriage return seems to be the same one used to format code in the Settings Editor/process code to be executed. I think in CMud you ran into some issue regarding this and ended up creating #NOINPUT to handle it. A similar scenario spawned the creation of #gagspace.
If you had this in a ZMud trigger:
#noop this is a long comment's first line
#noop this is a long comment's second line
#echo this is what the trigger is supposed to do
you would end up seeing three lines printed to the game window, the first and second being a blank line and the third being the result of the #echo. |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
|
|