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
msew
Newbie


Joined: 11 Jun 2002
Posts: 9

PostPosted: Mon Oct 11, 2004 2:55 pm   

trigger to choose whom to heal based off group report
 
group command output:

+Rnk-Lvl-Rmt+ --Name-- +Hps%-Mvs%+ --=- Gjob -=-- =-Exp2Lvl-=
4.[5- 55-5 ] foo 65 99 '.......None.......' (3)
[5- 55-5 ] bar 95 97 '.......None.......' (3)
[5- 55-5 ] baz 34 100 '.......None.......' (3)

Group PK-Index : [4]
Group Members : [3]



The idea is too look at the group report (c.f. above) and then choose who to heal based off a healList.

this #trig works for the case of using a variable:

#trig { (%*)@healVar (%*) (%d)(%*)(%d) } { %IF( %2 < 95, castHealSpell, launchHealCheckThread) }


IF TURE: castHealSpell will cast what ever the heal spell is on the @healVar (e.g. #alias {castHealSpell} {cast 'heal' @healVar}

IF FALSE: launchHealCheckThread will be called and check the group command again in some amount of time. (it really isn't a thread but it is nice to think about it that way and wish it really were a thread :-) )



So the question is how to convert the above to use a healList ( a #var that is a string list ).


I am having issues with getting zmud to set #VARs and such in order and not all at once for the entire call chain. (really annoying :-) )


My thoughts were to use:

+Rnk-Lvl-Rmt+ --Name-- +Hps%-Mvs%+ --=- Gjob -=-- =-Exp2Lvl-=
4.[5- 55-5 ] foo 65 99 '.......None.......' (3)
[5- 55-5 ] bar 95 97 '.......None.......' (3)
[5- 55-5 ] baz 34 100 '.......None.......' (3)


to figure out who should be healed. It needs to have the ability to have a priority of who to heal that is orthogonal to the order of the group output. (e.g. bar will always get healed WHEN his hp are below 50, but otherwise keep everyone above 70 based on some priority, and if someone is below 55 then get them back up before keeping everyone above 70, etc).

So it processes and figures out that:

baz should be the one to be healed and sets the #var toBeHealed baz

Then use:

Group Members : [3]


to trigger the call to: castHealSpell .



That seems like a decently architected design. The issues I am having is creating the #trig that will use a #var string list (the heal list) and then having it set the toBeHealed variable.

It seems that you can't nested #IFs or %ifs and have the variables set in the order they get executed. (or I am just doing something wrong).



Any help would be greatly appreciated.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Oct 11, 2004 4:33 pm   
 
Quote:
It seems that you can't nested #IFs or %ifs and have the variables set in the order they get executed. (or I am just doing something wrong).
You are probably doing something wrong. Most likely is that you have an incorrect understanding of the order statements are executed in or the effects of that order.

Not a script I would recommend using, but I think this follows the plan you outlined.
Code:
#TR {+Rnk} {#VAR toBeHealed {}}
#TR {({@HealList}) %s (%d)} {#ADDK Hurt {%1} {%2}}
#TR {Group Members} {
#IF (%db( @Hurt, %item( @HealList, 1) < 50)) {#VAR toBeHealed {%item( @HealList, 1)}} {#LOOPDB @Hurt {#IF (%val < 55) {#VAR toBeHealed {%key}}}}
#IF %null( @toBeHealed) {#LOOPDB @Hurt {#IF (%val < 70) {#VAR toBeHealed {%key}}}}
#IF (@toBeHealed) {castHealSpell}
}
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
msew
Newbie


Joined: 11 Jun 2002
Posts: 9

PostPosted: Mon Oct 11, 2004 4:44 pm   
 
How would you do it? :-) I would rather do it the "approved" way or the way that experience has shown to be best!
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Oct 12, 2004 1:40 am   
 
I would probably just set up some function keys and decide for myself which ones to push when. I've always trusted my own judgment far more than any automated system.

Loops tend to be slow, and the trigger I wrote has not just one but two loops. However, I don't see any other way of doing the complex decision-making you want to leave to a script. Good luck!
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
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