 |
Josiah.Bruns Apprentice
Joined: 04 Mar 2007 Posts: 103
|
Posted: Sat Sep 05, 2009 2:49 pm
Is there a way to comment my code? |
for example
.charger
#waitfor {A Druegar charger.} 3000
{ //open if waitfor condition is met
kill charger
emote points at charger
sigil charger
punch charger
#waitfor {You receive (%d) experience points.}
..charger
.macs
sell all;sell all from bag;sell all from bag 2
..macs
}//close waitfor condition met
{
..charger
} |
|
|
 |
Josiah.Bruns Apprentice
Joined: 04 Mar 2007 Posts: 103
|
Posted: Sat Sep 05, 2009 2:52 pm Also any idea why the kill charger command wont fire my kill (%w) trig? |
<trigger type="Command Input" priority="660" id="66">
<pattern>kill (%w)</pattern>
<value>emote points at %1
sigil %1
kill %1
punch</value>
</trigger> |
|
|
 |
Troublemag Wanderer
Joined: 14 Jul 2004 Posts: 83
|
Posted: Sat Sep 05, 2009 4:35 pm |
The // code is precisely the way to comment your code. You should note that your comments will become italicized to make it easier to read as well.
As for your 2nd problem, change the %1 in your value to (*). CMUD is less forgiving about such things than ZMUD was. |
|
_________________ CMUDPro 3.22 |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Sep 05, 2009 9:34 pm |
To answer your questions, Josiah:
Using // to comment a code is correct, however, it must START the line (zscript isn't like some languages where you can comment it out in the middle of the script). Therefore, you could do
{
//open if waitfor condition is met
blah blah blah
}
//close waitfor condition met
As for the second issue, Troublemag, the %1 is correct. The 'CMUD is less forgiving about such things' is referring to using %1 in the trigger pattern, never the value. The reason why it's not working is because you're using 'kill' which is now a command input. You have two options here. If you're able to, abbreviate it to something like 'kil' or even 'k'. Failing that, change the line to #SEND {kill %1} instead.
Charneus |
|
|
 |
Moo Apprentice
Joined: 10 Apr 2009 Posts: 145
|
Posted: Sun Sep 06, 2009 1:57 am |
Is the comments thing mentioned in the docs anywhere? If so, I couldn't find it..
|
|
|
 |
|
|