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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Lokke11
Beginner


Joined: 27 Apr 2007
Posts: 16

PostPosted: Wed Sep 04, 2013 4:37 pm   

Need help with a Trigger
 
This is just a math to calculate who is more injuried and setting it to a key for easy use. If someone can help me out with making this old Zmud version work for my Cmud that would be great.

This is what we get from the Mud:
( Head) 848/848 hit, 129/130 move Karl
(Front) 300/1205 hit, 158/180 move Nick
(Front) 300/637 hit, 157/158 move Debby

Below is what I was using on Zmud.

Pattern:
{(Front)|(Back )|( Head)}%s(%d)/(%d)*hit,*{move|mana} (%w)
Command:
#mat hurtLevel ((%1 * 1000)/%2);
#mat maxHps %2;
#mat curHps %1;
#if (@hurtLevel < 750) {#col 10;
#if (@mostHurtLevel > @hurtLevel) {#var mostHurt %3;
#mat mostHurtLevel @hurtLevel};
#if (@hurtLevel < 500){#col 12};
#if (@hurtLevel < 250) {#col 524}}

Variables names I had set up:
hurtLevel
maxHps
mostHurt
mostHurt2
mostHurtHps
mostHurtLevel

Macro Key commands:
F1:
#if (@mostHurt != nothing) {st;full @mostHurt} {#echo NO TARGET}

Key0:
#var mostHurt nothing;#var mostHurtLevel 1000;group

Thanks for any help ya can provide.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Wed Sep 04, 2013 10:47 pm   
 
Hmmm... given that you are looking to compare results for several people, more info might be needed.

Values for hurt percentiles and even who all is being looked after need to be reset with each iteration, so...

Does it always start with ( Head)?
If not, is there a message that signals a new report?
Do you have to send a command to get the report?
How many people can be listed in the report?
Is there a message for when the report is done?
_________________
Discord: Shalimarwildcat
Reply with quote
Lokke11
Beginner


Joined: 27 Apr 2007
Posts: 16

PostPosted: Thu Sep 05, 2013 5:27 am   
 
Here is a cut/paste from the mud:

< 918h/918H 122v/124V Pos: standing >
Your group consists of ( 5/30):
( Head) 918/918 hit, 122/124 move Debby
(Front) 1262/1262 hit, 244/295 move John
(Front) 821/869 hit, 121/161 move Dork
(Front) 743/743 hit, 170/172 move Karn
(Front) 952/1224 hit, 246/248 move Gro

< 918h/918H 122v/124V Pos: standing >

Each time you enter the command "group" you get that information.
It does always start with ( Head).
Group size can be up to 99, but in this example its 5/30 which means they may have made a change so that it is just 30 now.
There is no end line, just the blank space.

Thanks for the timely response. I hope you can solve this for me.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sat Sep 07, 2013 6:31 am   
 
i would use two trigger then, and work off a a variable DB

#TR {Your group consists of} {#VAR groupHealth {}}

That resets the variable

#TR {~([%s%w]~) (%d)/(%d) hit, * {move|mana} (%w)} {
$health=((%float(%1)/%2)*100)
#ADDKEY groupHealth %3 $health
}

that defines each members current health percentile

Code:
#ALIAS mostHurt {
  #LOCAL $wounded
  $baseline=75
  #FORALL %dbkeys(@grouphealth) {
    $value=@groupHealth.%i
    #IF ($baseline>$value) {
      $baseline=$value
      $wounded=%i
    }
  }
  #IF ($wounded) {
    st
    full $wounded
  } {#PRINT {No Target}}
}


That will find out who is most hurt, and attempt the full command on them

#KEY F1 {mostHurt}
#KEY key0 {group}

That -should- do what you want, but i didnt test anything.
_________________
Discord: Shalimarwildcat
Reply with quote
Lokke11
Beginner


Joined: 27 Apr 2007
Posts: 16

PostPosted: Sat Sep 07, 2013 6:39 am   
 
Thanks!
Will it just make F1 the hotkey to full the wounded person, or is it going to automatically stand and start casting on its own? Would rather be in control of when i cast my spells but have it set it to the most wounded.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sat Sep 07, 2013 7:00 am   
 
the last if has the stand and full, you can pull it out if need be, but i was going by what you HAD f1 already set to
I have it determining who is most hurt in local variables only so as not to clutter settings
_________________
Discord: Shalimarwildcat
Reply with quote
Lokke11
Beginner


Joined: 27 Apr 2007
Posts: 16

PostPosted: Sat Sep 07, 2013 2:30 pm   
 
OK, trying to understand this. By typing group it triggers off Your group consists of, clearing the previous health levels and setting new levels for health. By pressing F1 it determines who is most wounded and stands to heal that person? Correct? Is it done as a percentage of their total life or just the higher number of damaged points?

The previous trigger I had I believe would only set the heal target if they were <30% or something like that. Is that true here also?

Thanks for your continued help.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Sep 08, 2013 1:16 am   
 
you are correct

the baseline of 75 means it only looks for people with less than 75% health
_________________
Discord: Shalimarwildcat
Reply with quote
Lokke11
Beginner


Joined: 27 Apr 2007
Posts: 16

PostPosted: Sun Sep 08, 2013 2:50 am   
 
Cool, ill test it out and let ya know. Probably on Monday. Thanks a bunch.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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