|
sleezybax Newbie
Joined: 22 Jan 2013 Posts: 2
|
Posted: Tue Jan 22, 2013 9:06 pm
need help with triggers and status window |
Hi i've recently taken up mudding again, and would like some help, used zmud before where i had the triggers working but can't seem to get it working in cmud.
been browsing through the forum for days without getting wiser.
what i would like is to capture my prompt into a status window that updates everytime i get hit or lose hps.
prompt looks like this:
Hp:291(291) Con:228(228) Mp:318(318) (+ some more info the i don't wanna capture.
i tried making a trigger looking like this
[/code]<trigger priority="1560" id="156">
<pattern>Hp:(%1)(%2) Con:(%3)(%4)</pattern>
<value>var=value : @hp = %1
var=value : @maxhp = %2
var=value : @con = %3
var=value : @maxcon = %4</value>
</trigger>
without luck.. hope i can be pointed in the right direction.. as to the status window im completely blank on how to make that work
[/code] |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Tue Jan 22, 2013 9:47 pm |
First of all, you don't use %1, %2 etc in the pattern. You use wildcards in the pattern, and then reference them with %1, %2 in the code. You can see a list of wildcards here. The wildcard for digits is %d, so you'll want to replace your %1, %2, etc in the pattern with %d.
Secondly, you didn't include the literal parentheses in your pattern. Since parentheses are special characters, you need to quote them with the quote character - tilde.
Finally, I'm not sure what the "var=value" stuff is doing in your code. To set a variable, you use "variablename = what-you-want-in-the-variable" - for example, "hp = %1".
So the final trigger would look like this:
Code: |
<trigger priority="1560" id="156">
<pattern>Hp:(%d)~((%d)~) Con:(%d)~((%d)~)</pattern>
<value>hp = %1
maxhp = %2
con = %3
maxcon = %4</value>
</trigger> |
|
|
|
|
sleezybax Newbie
Joined: 22 Jan 2013 Posts: 2
|
Posted: Wed Jan 23, 2013 11:08 am |
i'll try that, thx for the quick reply..
as to the var = value it was was the compatability report from my old zmud triggers said i should change to instead of just var = value |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Jan 23, 2013 1:52 pm |
What the compatibility report was trying to say was that you needed to change "@var = value" into "var = value". Specifically in your case, to change "@maxhp = %2" into "maxhp = %2". When setting a variable with the "var = value" format, you do not precede the variable name with @. Zmud accepted this, but it was incorrect even then. Cmud is more strict about enforcing this rule.
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|