Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Tue Mar 01, 2005 12:00 am   

Trigger for HP low warning
 
Hello,

This is my first post here. I read as a guest for a few days and never found the question I have answered anywhere. I am sure it is, but I could not find it. I am attempting to have the MUD notice when I am low on HPs, and automatically group-say something, so my cleric can auto heal my tank.

If you need to know output from the mud, my prompt looks like this:

434(434)Hps 690(690)Mana 70(83)Mvs ()Tank Hps 6186Gold 1000Align 603015Xp

That is all one line. I am trying to figure out how to have this character alert the group with a gs (group-say) when the hps get under 50% of maximum.

Can anyone help me with this problem? Thanks in advance.

Davarna
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Tue Mar 01, 2005 1:56 am   
 
Assuming the max HPs is in pareths...

#TRIGGER {^(%d)~((%d)~)Hps %d~(%d~)Mana} {#IF %1<%EVAL(%2/2) {gs heal me}} {case}
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Tue Mar 01, 2005 2:15 am   
 
Oh, I think I must not have been clear enough. The output I showed was from a Cleric. The Tank HPS are the ones that I need to have gs heal when under 50%.

Davarna
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Tue Mar 01, 2005 4:27 am   
 
Are the Tank Hps the current HPs or max and how do you know the value that isn't shown in that line?

In order to determine 50%, two values are needed. Max and Current.
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Tue Mar 01, 2005 4:31 am   
 
Both are shown. It is just like personal HPs. It shows Hps/(Max HPs) Tank HPs

example: 436(541)Tank Hps

Thanks again.

Davarna
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Tue Mar 01, 2005 12:53 pm   
 
Ooookie =)

#TRIGGER {^(%d)~((%d)~)Tank Hps} {#IF %1<%EVAL(%2/2) {gs heal me}} {case}
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Tue Mar 01, 2005 3:22 pm   
 
So, I copy that line and paste it into the MUD? Or do I put it in a trigger? Does putting the line into a mud do anything? I have not figured it out. I am sorry if this is a complete newbie question, but no place in the trigger section of the help files does it tell you where to input the line.

Davarna
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Tue Mar 01, 2005 3:41 pm   
 
That is the trigger Wink. Just copy and paste it right into the command line and hit enter and it will be created for you.

Some extended information:
From zMud if you go to "Help >> Command Wizard" the wizard will pop up. Press 't' on the keyboard and left pane will jump to the t's section. Scroll down some and find "trigger" and left click. Click on the button lower left called "More Help". Near the top of the help file find the line for "pattern matching symbols" and click there. This is the complete list of matching patterns you can use in your triggers.

So for the above tigger: ^(%d)~((%d)~)Tank Hps
^ = match at beginning of line
(%d) = match a number and capture to %1 variable
~( = match open parenths
(%d) = match number and capture to %2 variable
~) = match closing parenths
Tank Hps = match acsii letters as is

In the main body of the trigger I test %1 against half of %2 and if true "gs heal me" will be sent. This is just to show how to build triggers up from the text given. An example is always nice for learning purposes. Any other questions just let us know...
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Tue Mar 01, 2005 11:42 pm   Thanks for the help and more questions...
 
OK, I understand what you are saying here, and the help files are great, but my question is about the trigger you gave me. When I go into triggers, it put the one I just made in a subfolder (subsdirectory for those of us who remember DOS) called case. Does this matter? Does it slow down reaction time?

Thanks yet again .

Davarna
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Tue Mar 01, 2005 11:47 pm   
 
Oh, look, also, I do not have the Command Wizard. Under help, there is no command wizard available. Am I missing files?

Davarna
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Tue Mar 01, 2005 11:49 pm   
 
Ouch, nevermind. Sorry, I was looking at the triggers, when I searched for help. After closing triggers, the command wizard was in the help files
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Wed Mar 02, 2005 2:05 am   
 
> Does this matter? Does it slow down reaction time?

For one it help seperates out the different triggers so you can find what you want more easily. Like I have folders for gags, the mapper, party, etc.
Another good use is (through triggers or otherwise) whole folders can be enabled and/or disabled as a whole. But to the main question, not that you will ever notice unless you have thousands of them...
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Wed Mar 02, 2005 5:45 am   
 
Excellent, I think I have it working. Now, I just have to figure out how to put a delay, so when my hps get low, it does not tell me 12 times in a row that I need a heal, and I get spammed to death.
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Wed Mar 02, 2005 5:46 am   
 
Then, my next thing, I think deserves a new subject/topic, but since I started here, I will say, I want to make it so if a group member says So-and-so group-says, "heal", my cleric will heal THAT person.
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
Odoth
Wanderer


Joined: 13 Nov 2004
Posts: 54
Location: Visalia, CA

PostPosted: Wed Mar 02, 2005 7:30 am   
 
#trigger {(%w) group-says, "heal"$} {cast heal %1}
_________________
*ribbit*
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Wed Mar 02, 2005 3:24 pm   
 
Thanks a ton. That is what I needed most. I have been able to modify that to get most any trigger I needed :)
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
BaABnG
Beginner


Joined: 28 Feb 2005
Posts: 26

PostPosted: Thu Mar 03, 2005 1:53 am   What about triggers per character?
 
First, I gotta say thanks, the help I have gotten, i.e., the help files, and the triggers written for me have been great.

Second, I was wondering, how do I get it so only my cleric gets some triggers, and my tanks get other triggers? I can multi-char.

Each of my characters use all the triggers, and the spam is horrific when using my prep alias/trigger.
_________________
Davarna and Ceriana of Aaezure Odyssey
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net