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
Dagnimaer
Wanderer


Joined: 05 Apr 2003
Posts: 60
Location: USA

PostPosted: Tue Sep 16, 2003 4:45 am   

Autohealing problem
 
Ok, again, Imperian/Achaean healing problem. The problem is simple to discribe but a complete PITA to solve.

Right now I have no problem having my system keep accurate count of what I got for afflictions. The problem I have is so I don't spam eating herbs. example.

My system will pick up that I have sensitivity, paralysis and say stupidity. It will pick herbs I need but since it checks the entire thing it just gets spammed. Thanks in advance.

I have triggers to try and prevent it, but its still spamming to eat and apply vials.

Thanks in advance.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Tue Sep 16, 2003 6:01 am   
 
_____________________________________________________________________

My system will pick up that I have sensitivity, paralysis and say stupidity. It will pick herbs I need but since it checks the entire thing it just gets spammed. Thanks in advance.

_____________________________________________________________________

What do you mean, 'checks the entire thing'?
I and others would love to help, but I think we might need a little bit more information if we're going to shed some light on this.

give examples, trigs, stuff we can work with Smile
Reply with quote
Dagnimaer
Wanderer


Joined: 05 Apr 2003
Posts: 60
Location: USA

PostPosted: Tue Sep 16, 2003 6:35 am   
 
ok, here is an example.

I'll get the afflicitons messages like:

Zeus slashes into you with a sabre,
The idea of eating or drinking is repulsive to you.
Zeus slashes into you with a sabre,
Your lungs tighten and it becomes hard to breathe

I attack, then

Zeus slashes into you with a sabre,
Pain is something only the weak feel!
Zeus slashes into you with a sabre,
A *****ly, stinging sensation spreads through your body


Here is the trigger and the action:
Trigger: The idea of eating or drinking is repulsive to you.
Action: #IF (("%1" <> "** Illusion **") and ("%2" <> "** Illusion **")) {
anorexia = 1
anorexicaffliction
}

Trigger: Your lungs tighten and it becomes hard to breathe
Action: #color 170
#IF (("%1" <> "** Illusion **") and ("%2" <> "** Illusion **")) {
asthma = 1
asthmaaffliction
}

Trigger: Pain is something only the weak feel!
Action: #IF (("%1" <> "** Illusion **") and ("%2" <> "** Illusion **")) {
recklessness = 1
#color 210
recklessaffliction
}

Trigger: A *****ly, stinging sensation spreads through your body
Action:#IF (("%1" <> "** Illusion **") and ("%2" <> "** Illusion **")) {
sensitive = 1
sensitiveaffliction
#cw 550
}

Now then, for aliases,

Sensitiveaffliction : #addi afflictions {Sensitive -EMH- Eat Maidenhair!}
emh

emh {#if @herbbalance {outr maidenhair;eat maidenhair}}

The same goes true with recklessaffliction, ashtmaaffliction and anorexicafflction.

now, On a 1 second timer I have the the a large priortized list to check to see if I am afflicted and then cure it in an order, here is the herb aspect of it.

#if (@herbbalance AND NOT @asleep AND NOT @aeon AND NOT @stunned) {
#if {@paralysis} {emh}
#if ( @sensitive) {emh}
#if ( @asthma) {kel}
#if ( @darkshade) {ens}
#if ( @recklessness) {ema}
#if { @maso} {eo}
#if { @agoraphobia} {eo}
#if ( @hypersomnia) {eww}
#if ( @haemophilia) {ens}
#if ( @clumsy) {kel}
#if { @peace} {eg}
#if { @claus} {eo}
#if ( @shyness) {ema}
#if ( @weakness) {kel}
#if ( @epilepsy) {sl}
#if ( @lovers) {eg}
#if ( @dizzy) {ema}
#if ( @confusion) {eww}
#if ( @halucinate) {eww}
#if ( @nausea) {ens}
#if { @blindness} {hys}
}

the problem is, it runs through this list and then will get out the required herbs and try to eat them all at once instead of checking for herbbalance each time.

thanks
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Tue Sep 16, 2003 8:11 am   
 
You could try something like this in your eat alias

emh {#if (@herbbalance and !@herbeating) {outr maidenhair;eat maidenhair;#VAR herbeating 1}}

Then add a trigger (actualy you probably have it already to set @herbbalance to 0)
#TRIGGER {You eat an herb} {#VAR herbeating 0}

This way once you eat an herb you wont eat another until you get @herbbalance=1 and @herbeating=0.
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Tue Sep 16, 2003 8:44 am   
 
I didn't think about it before, but you could just try

emh {#if (@herbbalance) {outr maidenhair;eat maidenhair;#VAR herbalance 0}}
Reply with quote
Dagnimaer
Wanderer


Joined: 05 Apr 2003
Posts: 60
Location: USA

PostPosted: Tue Sep 16, 2003 9:41 am   
 
ok, curius, does it have to be

#var herbbalance 0

or can it be

herbbalance = 0
?

Like, in this case does it have to be specific?
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Tue Sep 16, 2003 9:46 am   
 
No, it wouldn't have to specific. It's just they way I write my stuff. personal choice. I should have followed your style in the example, but didn't think about it.
Reply with quote
Dagnimaer
Wanderer


Joined: 05 Apr 2003
Posts: 60
Location: USA

PostPosted: Tue Sep 16, 2003 9:47 am   
 
don't worry about it =)

hopefully this will work
Reply with quote
MartokShiva
Beginner


Joined: 27 Aug 2003
Posts: 14
Location: United Kingdom

PostPosted: Tue Sep 16, 2003 5:05 pm   
 
Instead of having that many #if statements.. why not use queues? You can sort and prioritize queues, and easily add cures for new afflictions that way.

When you get for instance "Pain is something only the weak feel!" add lobelia to your plant queue.. and remove it from the queue when you get the cure message. That will also stop thinking you have cured an affliction when you have more than one which use the same cure :)

Aslo, the only afflictions you really need to keep track of with individual variables are ones that can cause a venom lock. There were a few good threads about this subject a while back. They are probably still there if you do a search on "Achaea healing" or such
Reply with quote
Dagnimaer
Wanderer


Joined: 05 Apr 2003
Posts: 60
Location: USA

PostPosted: Tue Sep 16, 2003 7:57 pm   
 
*nods* I know, but thing is, I am going for an automatic healing system, not just to keep track of venomlocks. As I said, the only thing now I am trying to do is not have my system eat 2+ herbs or apply 2+ salves at once, but rather wait for balance to return
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