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


Joined: 16 Oct 2006
Posts: 62

PostPosted: Sat Feb 17, 2007 12:14 am   

Seeing broken mangled limbs in Achaea
 
Here is a sample trigger from ACP:

{To your horror\, your (left|right) (arm|leg) has been mutilated beyond repair by ordinary \nmeans\.$}

{#IF ((@Flags.attacked == 1 and "%1 %2" == @Flags.body_hit) or %null( @Auto.AntiIllusion)) {acp_afflicted mangled %1 %2;#DELKEY Afflictions {damaged %1 %2};#DELKEY Afflictions {broken %2}};

I've added the following script:

#CASE %ismember( "%1 %2", "right arm|left arm|right leg|left leg") {#CALL %btncol( RArm, red, red);@RArmCure = Restoration} {#CALL %btncol( LArm, red, red);@LArmCure = restoration} {#CALL %btncol( RLeg, red, red);@RLegCure = restoration} {#CALL %btncol( LLeg, red, red);@LeftLegCure = restoration}}

Essentially I have a little man shaped set of buttons that I can track body damage and push hie arm leg etc. buttons to parry certain area I suspect will be the next target. Also I can manually cure the areas by pushing another button where the hands, hat, belt, and feet would be. My question is simple. If ACP is keeping track of this information in "ACP_afflicted" can I somehow recover that information directly from the variable? This would make the code much simpler and streamline the process in my opinion. There are very many triggers like this and it is a tedious job indeed to set them up if I need to re-import ACP (which I have had to do twice now. This script does work but I am just looking for a better way.

Any help would be much appreciated.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Feb 17, 2007 5:08 am   
 
I think I have a newer version of ACP than you do - the acp_afflicted alias has been replaced with acp_afflict. What you need to do is take a look at the acp_afflicted alias and see what it's doing with the data that's passed to it. It MUST be doing something to store it, and the answer will be in there.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Rolly
Wanderer


Joined: 16 Oct 2006
Posts: 62

PostPosted: Sun Feb 18, 2007 2:37 pm   
 
Thanks for the tip. Like you thought, I found a variable called afflictions and triggered key words like arm, leg, head, torso to check the status of my body parts and return colors to the buttons as well as cure type like mending or restoration. I kept it a simple trigger in a class I can turn on and off so I just need it when fighting heavy body damage classes or denziens. For different body areas I used triggers like:

{#Trigger arm}

#CASE %ismember( @afflictions, broken arm|partially damaged arm|damaged right arm|damaged left arm|mangled right arm|mangled left arm) {#CALL %btncol( RArm,green,green)
#CALL %btncol( LArm,green,green)
@RArmCure = mending
@LArmCure = mending} {#CALL %btncol( RArm,green,green)
#CALL %btncol( LArm,green,green)
@RArmCure = mending
@LArmCure = mending} {#CALL %btncol( RArm, yellow, yellow)
@RArmCure = restoration} {#CALL %btncol( LArm, yellow, yellow)
@LArmCure = restoration} {#CALL %btncol( RArm, red, red)
@RArmCure = restoration} {#CALL %btncol( LArm, red, red)
@LArmCure = restoration} {#CALL %btncol( RArm, white, white)
#CALL %btncol( LArm, white, white)}

But now I wonder if this will work right. Once it finds a true case, will it stop checking? If so I probably need to break it out into two triggers for left and right arms.

On a sepparate note, I've done pretty much the same thing for the 30 odd defenses I put up but used a macro for most of it to check the variable @defenses in ACP to color buttons which I can push to put the defenses back up. Orriginally I had thiese defence checks triggered to my prompt but that definately slowed me down so I just put it in a macro that I can push at my choosing. My hope is to eventually gag all of the messages relating to defs up and down and damage and eventually rely on my button colors to track these matters which will free me to concentrate on the effects of my attacks and what my opponant is doing. It does seem that the more stuff I gag the slower my system goes although it may be more a matter that it just seems slower because I'm not trying to speed-read the screen and sort it all out. But I suspect it takes a while to do all the button colors. What are your thoughts?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Sun Feb 18, 2007 2:43 pm   
 
1. What version of the ACP are you using? XL? LE? Have you heard of Acropolis?
2. Use "var = value" without the @ in front.
3. The afflictions and defenses variables are data record variables, so %ismember won't work on them.
4. #CASE will select the one match based on the number resulting from your expression.
Reply with quote
Rolly
Wanderer


Joined: 16 Oct 2006
Posts: 62

PostPosted: Sun Feb 18, 2007 7:03 pm   
 
1. LE
2. Ok I will Thanks
3. You are right I had to use %db to do this in defenses for example:

#IF (%db( @Defenses, "mindseye")) {#CALL %btncol(MindsEye,white,black)} {#CALL %btncol(MindsEye,red,white)}

This seems to work well. Is there a reason why this should bog me down when I trigger a bunch of these to work with my prompt (other than the sheer frequency of the prompt)? It really seemed to so I put them into a macro I can choose to use. I am very happy to have these in a class sepparate to ACP so if I re-import ACP I don't erase them like I had to a while back. If there is a better way please let me know.

4. As I suspected I'll need to put each limb into a separate trigger in order to use #case but it would probably work as well to do it like the defenses script using the %db and use a series of if statements. I'm sure there are other more sophisticated ways of doing this but I am not that good yet. I'll keep trying and appreciate any help you can give me along the way.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Feb 18, 2007 7:14 pm   
 
You can probably use a more complicated trigger pattern and get away with simpler code. One I've often seen used is this:

({right|left}) ({arm|leg})
#additem Afflictions %concat("Mangled",%1,%2)

or somesuch.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Sun Feb 18, 2007 7:26 pm   
 
The %iskey will tell you if something exists in the data record variable (even if its value is 0 or null), and I use that for checking for values, personally.

Yes, it will bog you down because of the frequency of the prompt and the sheer number of evaluations you are doing each time it fires. You could use a timer that fires at regular intervals to update your defense buttons and experiment with time values that don't bog you down so much. You could even get fancy and have separate timers for each button and stagger the times on them.
Reply with quote
Rolly
Wanderer


Joined: 16 Oct 2006
Posts: 62

PostPosted: Sun Feb 18, 2007 8:59 pm   
 
Thanks for all the help!

I tried this then:

#IF (%iskey( @afflictions, "damaged right arm")) {#CALL %btncol(RArm,yellow,yellow)
RArmCure = restoration}

and other like scripts for different levels of damage. I will do the timer thing as well as putting the whole thing in an alias I can turn on and off depending on the situation because when I want it to work, I'll want it to trigger about every 15 seconds.

By the way I bought acropolis but could never get it to work due to documentation/support issues and my own ignorance. I'm sure it works quite well when properly configured but I found it difficult to get any help. This is possibly because people who paid for the support weren't willing to give that information away. At any rate, once I understand scripting a lot better I'll give it another try.

Thanks again for the help!
Reply with quote
Rolly
Wanderer


Joined: 16 Oct 2006
Posts: 62

PostPosted: Mon Feb 19, 2007 6:57 pm   
 
I ended up putting the triggers in a class called bones and when the class is on the trigger is :
{#trigger * arm*}

{#CALL %btncol(RArm,white,white)
#CALL %btncol(LArm,white,white)
RArmCure = mending
LArmCure = mending
#IF (%iskey( @afflictions, "broken arm")) {#CALL %btncol(RArm,green,green)
#CALL %btncol(LArm,green,green)}
#IF (%iskey( @afflictions, "partially damaged arm")) {#CALL %btncol(RArm,green,green)
#CALL %btncol(LArm,green,green)}
#IF (%iskey( @afflictions, "damaged right arm")) {#CALL %btncol(RArm,yellow,yellow)
RArmCure = restoration}
#IF (%iskey( @afflictions, "damaged left arm")) {#CALL %btncol(LArm,yellow,yellow)
LArmCure = restoration}
#IF (%iskey( @afflictions, "mangled right arm")) {#CALL %btncol(RArm,red,red)
RArmCure = restoration}
#IF (%iskey( @afflictions, "mangled left arm")) {#CALL %btncol(LArm,red,red)
LArmCure = restoration}}

and it works well in testing at least. I tried an alarm but it didn't seem to give me the up-to-date information I needed unless it was repeated very often which kind of defeats the purpose. At least it is sepparate from the ACP triggers and not subject to change every time I import.

Anyway Thanks for all of the help! Wink
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