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
sepe
Novice


Joined: 09 Feb 2002
Posts: 39
Location: USA

PostPosted: Sat Feb 09, 2002 5:00 pm   

Help with macro/varibale combo
 
OK I use F1 key for basic heal. But there are two ways to heal, potion or an herb. of course it's a waste of herbs and money to use the herb when the potion will resore to full health. So what I'd like to see, when I hit f1, and I have lost less than 500 health, then I just sip potion. If I have lost more than 500 health then eat herb and sip potion.

health is shown as such at the start of EVRY line

920h, 920m e-

the e means east, there obviously could be more. The 920h is health the 920m is mana. The Max health I can have is not stated except in a status window is a line like such.

Health: 920 out of 920 Mana: 920 out of 920

thanks for the help






Dazed glazed and having fun
Reply with quote
sepe
Novice


Joined: 09 Feb 2002
Posts: 39
Location: USA

PostPosted: Sat Feb 09, 2002 6:19 pm   
 
this is what I tried to set the base variable

Pattern
Health: (%d) out of (%d) Mana: (%d) out of (%d)

value
#va myhealth %1
#va basehealth %2
#va mymana %3
#va basemana %4

but I can't even get it to trigger at all

Dazed glazed and having fun
Reply with quote
sepe
Novice


Joined: 09 Feb 2002
Posts: 39
Location: USA

PostPosted: Sat Feb 09, 2002 6:37 pm   
 
Hrmm tried in in real mud, it does work, just can't get it to work off line?? why?




Dazed glazed and having fun
Reply with quote
Berion
Newbie


Joined: 10 Nov 2001
Posts: 8
Location: Norway

PostPosted: Sat Feb 09, 2002 7:16 pm   
 
I'm a bit confused.. If you already have this in a status window, haven't you already captured the values to variables?

I assume you mean some sort of status command on the mud. In that case your trigger should really work. It worked fine for me. Are you sure you have't turned off triggers, or that this trigger isn't in some disabled class? I suggest you do it again, because it SHOULD work.

ok, then the if..
This is the value of your F1 Macro:
#if (@myhealth<=420) {eat herb;sip potion} {sip potion}

Now, this isn't very practical. Your variables only get updated when you look at the status screen.
You should have some sort of trigger to capture the prompt. If you have 6.16 or above, and there is a command to change your prompt on your mud (to get it to start with a specific character), use the #setprompt command in zmud to capture it.

If that isn't an option maybe a trigger like below would work:
^&{myhealth}h, &{mymana}m
That format will store it directly into @myhealth and @mymana.

Ok, I assume your basehealth is growing.
To cover that too, here's the whole thing:

#TR {^&{myhealth}h, &{mymana}m}
#TR {Health: &myhealth out of &basehealth Mana: &mymana out of &basemana}
#KE F1 {#IF (@myhealth<=@basehealth-500) {eat herb;sip potion} {sip potion}


This will update the @basehealth variable when you check the status screen, but also update @myhealth on every prompt. Then automatically decide whether to eat the herb when @myhealth is 500 lower than @basehealth



-Berion. Sure hope this works now.
Reply with quote
sepe
Novice


Joined: 09 Feb 2002
Posts: 39
Location: USA

PostPosted: Sun Feb 10, 2002 12:09 am   
 
What I meant by the status window, if I type SCORE, I get alot of player info, inculded in that is the

Health: 920 out of 920 Mana: 920 out of 920

So the only way I can get the max (or @basehealth) is from the score command, thats not a big prob since the mas health rarely changes and almost NEVER during a fight (after maybe)

Now my current health (@myhealth) is given at the start of every prompt like thus

920h, 920m

What I figured I was asking for here was a complicated drawn out way to do a simple task. I didn't realize I had the answer already I just had to put em together.

1- I made an alias base health #va basehealth %1 .... to change the base health when I need

2- Since I have a prompt capture (that you reminded me of) that keeps my current health up to date, I just can just place an #IF statement in that same trigger like such

#if @myhealth > @basehealth {basehealth = @myhealth}

yes that is written wrong, but is a simple look up

sometimes asking the question 2x makes you realize you had rthe answer all along, thanks

Dazed glazed and having fun
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