Healing (the skill!) Triggers Help, please?

by Unknown

Back to Mechanic's Corner.

Unknown2008-08-19 04:37:57
Is there anyway to make it that when I succor myself, I have a prompt or something that picks up my afflictions and sets the variables related to them to true, opposed to it doing so when I succor another?


For example, when I SUCCOR SARRASRI I get...:

Sarrasri is:
Sarrasri currently has * out of * health.
an insomniac.


When I succor myself, SUCCOR ME, I get...:

You are:
You currently have 2914 out of 2914 health.
blind.
deaf.
an insomniac.


I'd like to try to figure out a way that I can succor myself and see that I'm reckless, making @reckless = 1, while succoring someone else who is reckless will not make my system think I am reckless, too.

I use zMUD.


---

Also, I have another healing(skill)-related coding question.

I have it set that when I hit equilibrium, if I'm on balance, I'll use the follow alias:

Name: cureaffs
Value:
#if (@aeon = 1) {cure me phlegmatic}
#if (@blind = 1) {cure me senses}
#if (@deaf = 1) {cure me senses}
#if (@ablaze = 1) {cure me temperature}
#if (@shivering = 1) {cure me temperature}
#if (@thinblood = 1) {cure me blood}
#if (@breaks = 1) {cure me breaks}
#if (@clumsy = 1) {cure me nervous}
#if (@stupid = 1) {cure me mania}
#if (@shyness = 1) {cure me neurosis}
#if (@worms = 1) {cure me choleric}

So on and so forth.

Is there a way to make this better? I know there probably is, but, help would be appreciated. Thanks ahead of time, if you can.
Esano2008-08-19 05:28:05
Add in triggers for
You are:
You currently have 2914 out of 2914 health.

So it'll switch a variable (e.g. diag) to 1. Turn it to 0 at prompt. Only count diagnose messages when diag == 1.

You might also want double protection by turning SUCCOR ME into an alias, so it goes
SUCCOR ME
succor = 1
(diag stuff)
If succor = 1 then diag = 1
prompt: succor = 0; diag = 0


You might also consider using an alarm rather than prompt triggers. Haven't used zmud in a while, not sure how much it slows it down.
Esano2008-08-19 05:34:09
And as for the second one, consider making an array as a stringlist for each cure, or a stringlist of afflictions with a second dimension for curetype and a third for yes/no? Not to mention, put everything else in an else statement for the aeon, or it'll all override it.

e.g. afflictions stringlist is (not sure if this is how zmud handles them)

@afflist = Aeon,Phlegmatic,0|Blindness,Senses,0|Deafness,Senses,0|Ablaze,Temperature,0|

If @afflist = 1 THEN cure me afflict

Run through a for or while, incrementing the first number each time.

I haven't coded in zmud for too long, so I can't actually tell if this is feasible.
Unknown2008-08-19 05:34:33
QUOTE(Esano @ Aug 19 2008, 01:28 AM) 547819
Add in triggers for
You are:
You currently have 2914 out of 2914 health.

So it'll switch a variable (e.g. diag) to 1. Turn it to 0 at prompt. Only count diagnose messages when diag == 1.

You might also want double protection by turning SUCCOR ME into an alias, so it goes
SUCCOR ME
succor = 1
(diag stuff)
If succor = 1 then diag = 1
prompt: succor = 0; diag = 0
You might also consider using an alarm rather than prompt triggers. Haven't used zmud in a while, not sure how much it slows it down.


I understood that until the "diag" part got involved. :: Blank stare. ::

So...

Name: succor
Value:
#if (%1 = me) {@succor = 1} {@succor = 0}
#if (@succor = 1) {?????}

I have an echo for succoring that tells me the cures for each affliction.
Esano2008-08-19 05:41:32
That's about right. Or simply

#alias {succor me} {succor = 1}

So it doesn't need to do that if.

And the diag would be, roughly,
#TRIGGER {^You are:$You currently have (%d) out of (%d) health.$} {#if (@succor) {diag = 1} {diag = 0}}

#TRIGGER {^an insomniac.$} {#if (@diag = 1) {addaff insomnia}}

I wouldn't suggest having an else statement for the insomnia one, as otherwise they can trick your system into taking it off when you still have it. So, DON'T do
#TRIGGER {^an insomniac.$} {#if (@diag = 1) {addaff insomnia} {remaff insomnia}}
for example.

And have your prompt trigger do
#TRIGGER {prompt stuff} {diag = 0;succor = 0}

Or set it on a small alarm, e.g.

#alias {succor me} {succor = 1;#ALARM {+0.1} {diag = 0;succor = 0}}

Which means that after .1 of a second it will reset those to 0.
Unknown2008-08-19 05:51:00
So, ideally, I could make it that all the trigger lines I already have have under them...

Well, let me show instead.

Name: ^ablaze.
Value:
#EC -- TEMPERATURE -- FROST --

Instead of just that, I could do something like...

Name: ^ablaze.
Value:
#EC -- TEMPERATURE -- FROST --
#If (succor = 1) {@ablaze = 1}

That way, when @equi = 1 and @balance = 1, cureaffs can trigger and I'll cure it?

Or, alternatively, I can use cureaffs and it'll cure it?
Esano2008-08-19 05:54:08
Change it to
#If (@diag = 1) {@ablaze = 1}

and it should. If you're still having trouble, I can log in my moondancer healer kinda-alt from ages ago (older than Esano, to be exact) so I can fiddle to give you something concrete.

EDIT: Oh, use @diag if you have the diag trigger, use @succor if you don't and just have the succor me alias.

DOUBLE EDIT: You can just use (@diag) and it'll go through if it's non-zero.
Unknown2008-08-19 06:04:12
Made the alias "suc" instead.

Gotta go look for something to miff me up without throwing me off balance. Maybe a nice crab to test this out on.

Okay, maybe not a crab.
Esano2008-08-19 06:12:49
Sip poisons?
Unknown2008-08-19 06:35:20
QUOTE(Esano @ Aug 19 2008, 02:12 AM) 547832
Sip poisons?


Got Lekius to give me egovice. It works.

Name: ^cursed by egovice.
Value:
#if (@succor = 1) {@egovice = 1}
#EC -- CURSES -- HOREHOUND --


^~~ The pattern above works perfectly. I leave the echo behind so that if I succor someone else I know how to heal them.

Thank you so much for helping me. Now I might be able to actually use healing for something!!

I highly suggest other ZMUD Healers do the same as I have.

---

**VARIABLE**

Name: succor

**ALIAS**

Name: suc
Value:
succor %1
#if (%1 = me) {@succor = 1} {@succor = 0}

Name: cureaffs
Value:
#if (@(affliction) = 1) {cure me (appropriate cure)}
#if (@(affliction) = 1) {cure me (appropriate cure)}
#if (@(affliction) = 1) {cure me (appropriate cure)}
#if (@(affliction) = 1) {cure me (appropriate cure)}
(so on and so forth)


Remember, also, to have a variable for each affliction and to have the proper succor line for it. That way...

Name: ^(succor affliction line)
Value:
#if (@succor = 1) {@(affliction) = 1}
#EC -- (healing cure) -- (herb cure) -- (potion cure) --


A big thanks to Esano for helping me out with coding and Lekius for afflicting me and Arimi. Thanks again, you guys!
Esano2008-08-19 06:39:25
Disclaimer: remember my aeon warning. And you might want to watch your mana in there too. And it'll go kaput in choke.
Unknown2008-08-19 06:52:33
QUOTE(Esano @ Aug 19 2008, 02:39 AM) 547847
Disclaimer: remember my aeon warning. And you might want to watch your mana in there too. And it'll go kaput in choke.


Well, if you're a Faeling or an Elfen mana won't be too much trouble.

Also, I'm going to suggest that people who plan on using this code set a trigger so that right after you gain equilibrium (if you have balance) and right after you gain balance (if you have equilibrium) you use the alias cureaffs.

Or, alternatively, succor and then cureaffs.

Name: ^You have recovered equilibrium.
Value:
@equi = 1
#if (@balance = 1) {suc me;cureaffs}

Name: ^You have recovered balance on all limbs.
Value:
@balance = 1
#if (@equi = 1) {suc me;cureaffs}


Of course, you may want to put these in a separate class so that you don't use them while influencing, transversing planes, or what have you. I keep mine on at all times, just to be safe, and no, I do not suffer lag due to it.
Unknown2008-08-19 11:27:48
1. Don't use @var = blah when assigning things. Drop the @.
2. Resetting the succor variable on the prompt will be problematic for you when you get a prompt from something else, such as an attack or ambiance message, before you get the diagnose lines.
3. I believe you run the risk of burning out your ego if you heal too many things too quickly, so you might want to add in checks for how much ego you have remaining before curing all afflictions you have in your cureaffs alias.
Gartinua2008-08-28 22:55:02
I had the same problem, I'd succor someone else and then my healing system would merrily go and cure/heal me of everything they had.
I got around it by making succor an alias which sets a flag. All my "you have blah" trigger functions first check for that flag and if it is there they ignore it.
The flag is then reset by a timer.

I haven't yet got my opportunistic healing thing worked out yet. The idea being that I could cast a healing spell (I got eq etc) AND I got some problem AND that problem is not already being cured then I will.
Unknown2008-08-29 01:09:48
The general idea is that you keep all your affliction triggers from the diagnose lines in a class/group that is turned off by default. When you get the "^You are:$" line, you enable the group, turning it off again at the next prompt. To heal others, you would use a different group of triggers (unless you decided to code your single set with logic to distinguish targets) and capture the name of the person from a trigger such as "^(\\w+) is\\:$" (regex).
Malarious2008-08-29 18:40:08
I would rather use a data record, as they can be SEVERELY helpful for the sake of simplicity.

Key is the affliction, value is the cure type

For example:
#addkey healcures {ablaze=temperature}

Make your diag trigs add your afflictions to a stringlist. On prompt you can have your system run over all of them (if your ego is high enough I suppose) using a simple cure method. The data record would allow you to 'cure me %val' based on the affliction key.

Instead of @affliction and having to track all the affs, just make one variable to track it all, then track a variable of what you have (stringlists yay).

Hope that helps, I am still waking up.
Unknown2008-08-29 19:04:25
QUOTE(Malarious @ Aug 29 2008, 02:40 PM) 551641
I would rather use a data record, as they can be SEVERELY helpful for the sake of simplicity.

Key is the affliction, value is the cure type

For example:
#addkey healcures {ablaze=temperature}

Make your diag trigs add your afflictions to a stringlist. On prompt you can have your system run over all of them (if your ego is high enough I suppose) using a simple cure method. The data record would allow you to 'cure me %val' based on the affliction key.

Instead of @affliction and having to track all the affs, just make one variable to track it all, then track a variable of what you have (stringlists yay).

Hope that helps, I am still waking up.


Unless I'm mistaken, that way is also slower.

And yeah, doing @var=something will do a check on that variable, not actually set it. You can do #va variableName value. I'm not sure why I do it that way, I think someone just told me once it was better.

Another thing, if your system makes a mistake and thinks you have an affliction that you don't (like with the succor problem you were having), it should only mess up ONCE before it realizes you don't have that affliction. You should track if you take a drink of something or eat something or smoke something (other than cures that have a delay, like reishi ones) that you actually get a cure message. You can do that using a second trigger state in zmud. If you use a curative, and you don't get a cure message, (again, except for ones that have a delay) you should immediately be setting every affliction curable by that cure to 0. This is also great against people using illusions, at least they'll only fool you once.
Unknown2008-08-29 23:50:05
Using @var=something is not recommended, but it usually works. If you do that as part of an #IF, of course, it will only test for equality without setting the variable's value.