|
ryblake Beginner
Joined: 15 Jan 2014 Posts: 12 Location: Texas
|
Posted: Mon Apr 21, 2014 9:23 pm
Help with a trigger |
So, this mud that I'm playing has MXP support. Basically, when I turned it on CMUD popped my health and endurance point buttons up which was really nice. I've moved them and modded their size. Now I want it to shoot a trigger based on my hp. I would like it to spam "GO HEAL!!!" in a color three times when my hp gets to a certain point. I know the buttons can be set to change color based off a percent of health. Is there an easy way to set a trigger to fire the above for when my health bar changes color?
|
|
|
|
ryblake Beginner
Joined: 15 Jan 2014 Posts: 12 Location: Texas
|
Posted: Tue Apr 22, 2014 3:55 am |
Maybe it will help if I provide a bit more information. The mxp code for my HP is "%mud.hp". I think this is true, as when I type "#echo %mud.hp" then it echo's my current hp up on the screen. I was trying this trigger, but I could not get it to work.
#IF (%mud.hp < 90) {#echo HEAL NOW} {}
My pattern is set to %mud.hp
Language is set to zScript. I don't know why this is not wokring. |
|
|
|
ryblake Beginner
Joined: 15 Jan 2014 Posts: 12 Location: Texas
|
Posted: Tue Apr 22, 2014 4:58 am |
Okay, so I got my trigger to fire. Problem now is that it spams me until I'm back above that hp. I will have to find a way to only let it fire every five seconds or something like that. Here is my XML code.
<trigger priority="1590" enabled="false" id="159">
<pattern>{%mud.hp}</pattern>
<value>#IF @(%mud.hp <= 100) {#echo HEAL NOW};{#echo HEAL NOW};{#echo HEAL NOW} {}</value>
</trigger> |
|
|
|
ryblake Beginner
Joined: 15 Jan 2014 Posts: 12 Location: Texas
|
Posted: Tue Apr 22, 2014 5:31 am |
Well, scratch that. Thought I had it working. Now I can't get it working.
|
|
|
|
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Tue Apr 22, 2014 2:30 pm |
im not as good as some of the people here, and i cant pull code from nowhere, i need to see what im working with, if you PM me with mud info i can check it out and have something working in my free time :)
|
|
|
|
ryblake Beginner
Joined: 15 Jan 2014 Posts: 12 Location: Texas
|
Posted: Wed Apr 23, 2014 1:48 am |
Sent. For anyone else, it's t2tmud.org IP: 166.78.5.182 Port: 9999
Make sure and enable mxp. |
|
|
|
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Wed Apr 23, 2014 4:18 am |
ok i tried multiple things to get the pattern matching working, even MXP but as there is no real "HP" tag it would not work, this is what i came up with, im sure there is a better way if you got the pattern working correctly
Code: |
<class name="Annoying" id="7">
<trigger type="Alarm" priority="80" id="8">
<pattern>*1</pattern>
<value><![CDATA[#if (%mud.hp<=(%mud.maxhp*0.30)) {
#if (@annoyingfired==1) {
#echo <color cyan>"Yo Heal!!!"</color>
#echo <color red>"Yo Heal!!!"</color>
#echo <color blue>"Yo Heal!!!"</color>
} {}
annoyingfired=0
} {
annoyingfired=1
}
]]></value>
</trigger>
<var name="annoyingfired" id="9">0</var>
</class>
|
|
|
|
|
ryblake Beginner
Joined: 15 Jan 2014 Posts: 12 Location: Texas
|
Posted: Wed Apr 23, 2014 6:53 am |
I think I found a solution thanks to someone in game that helped me out a bit.
#ALARM warning -1 {#IF (%mud.hp<90) {#SHOW %ansi( red)Health is now at %mud.hp} } |
|
|
|
|
|