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


Joined: 08 Nov 2000
Posts: 44
Location: Australia

PostPosted: Sat Dec 01, 2001 2:15 pm   

Prompt trigger problem
 
Hiya's ive seen similar threads, but this is a bit different i think.

heres how my prompt can look different
# 1320 42 night bleeding freely
# 1298 46 amulet day N/A
# 1300 45 day N/A
1st is during a fight, 2nd is when a item is on auction and 3rd is how it looks normally.

What im trying to do is capture hp and bp from the prompt and make my character quaff heals if its below 1000hp, and feed if its below 6bp, and do its main attack if both these are ok. the problem i have is ive used a if statement for each, but if hp drops below 1000 it just keeps quaffing without stopping till all are used. i cant work out why, im guess its because its running off a prompt trigger maybe? like if my character get below 1000 hp and it gets disarmed, it will be below 1000hp for three rounds until the quaff heal potion trigger will fire and if other events happen too, it may end up quaffing way too many heals. atm thou it seems to just loop quaffing heals without stopping once its above 1000 hp. priority should be quaffing heals, then feeding, then attacking, so prehaps its a nested if statement, but i cant work out how to make it stop firing.

I'd appreciate some help understanding whats happening, tnx for your time
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Sat Dec 01, 2001 4:58 pm   
 
A solution would be to put your prompt trigger in a seperate class and turn it off when you send the command to quaff a potion, and have a second trigger turn it back on when you have quaffed the potion.

Something like:
#CLASS {PromptTrigger}
#TRIGGER {~# (%d) (%d)} {#IF (%1 < 1000) {Quaff Heal;#T- PromptTrigger} {#IF (%2 < 6) {Feed;#T- PromptTrigger}}} "" {nocr|prompt}
#CLASS 0

#TRIGGER {Put the message you get when you have quaffed a potion here} {#T+ PromptTrigger}
#TRIGGER {Put the message you get when you have fed here} {#T+ PromptTrigger}

Acaila
Reply with quote
decantor
Apprentice


Joined: 14 Nov 2001
Posts: 100

PostPosted: Sun Dec 02, 2001 5:58 pm   
 
The problem could be in triggering your prompt, as this could be a hard pattern to trigger off.

Disable the auto-quaff/autofeed triggers and use #show @hp or @blood or whatever you name the hp/blood variables to.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Dec 03, 2001 8:48 pm   
 
All you really need is some method to disable the quaff/feed commands while you wait for the action to take place.

#TR {^~# (%d) (%d)} {#VAR hp %1;#VAR bp %2;#IF (%1 < 1000) {#IF (@quaffing = 0) {#VAR quaffing 1;quaff heal}} {#IF (%2 < 6) {#IF (@feeding = 0) {#VAR feeding 1;feed}}}} {} {nocr|prompt}

#TR {You quaff a healing potion} {#VAR quaffing 0}

#TR {You feed on your enemy} {#VAR feeding 0}

LightBulb
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