Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
hamibugan
Newbie


Joined: 27 Jun 2016
Posts: 3

PostPosted: Mon Jun 27, 2016 11:04 pm   

Rescue trigger help
 
Hello,

Hoping someone might be able to point me generally in the right direction here.

I'm running a rescue script in CMUD 3.34. Currently, its set to fire on any number of inputs: slashes, attacks, switches, etc. The problem is it will fire on every such input every round until I've successfully rescued, giving me multiple inputs per person being attacked.

Is there a way to either A) have it ignore the next X number of inputs, giving me a chance to rescue. B) have it ignore further inputs until some other criteria has been met. C) Fire only once per variable (player) per time window. The big trick here, I think, will be that whatever the fix it has to still be able to fire for another player while being "silenced" for the one already inputted.

Thanks!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 3805
Location: Pensacola, FL, USA

PostPosted: Tue Jun 28, 2016 12:12 am   
 
There are a number of ways you could go about this.

When you Identify a target, add their name to a list, which you check against before deciding to rescue in the first place.

$name=%1
#IF (%ismember($name, @rescuing)) {} {
rescue $name
#ADDITEM rescuing $name
}

One you have rescued them, #DELITEM them.
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
hamibugan
Newbie


Joined: 27 Jun 2016
Posts: 3

PostPosted: Tue Jun 28, 2016 12:40 am   
 
Thanks Shalimar, for the response. I'm pretty inept at this stuff so forgive me if I'm about to display some ignorance.

I'm not sure this would work as I would still get multiple inputs for the same person before the rescue occurred. Upon looking further, also, I get no name specific message for a successful rescue; just, Banzai, to the rescue!

Currently how the script goes is:

* {@hitt} (%w)

#if (%ismember( %lower( %1), @RescueList)) {resc %1 all;#var FailedRescue %1 {} AutoResc}

Where @hitt is a long list. This can produce multiple trigger requests in even a single round of combat, more over multiple rounds and even more if I fail and go into lag from the skill or am in lag from having just rescued or waiting for multiple responses back from the mud: "But noone is fighting them?" I'm not sure what the %lower(%1) is, lower casing the targets name and assigning it as target?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 3805
Location: Pensacola, FL, USA

PostPosted: Tue Jun 28, 2016 1:40 pm   
 
The trigger might fire several times, but it should only issue commands once per individual with what i provided, as it performs additional error checking.
Currently you seem to only be checking if the individual is a friend before rescuing them, not weather or not you are currently rescuing them.

%lower just forces that string in to full lowercase.

Are you frequently in the process of rescuing several people?
If not, have the success message just clear the @rescuing variable entirely.
Sure, you will occasionally get some multi fires when there are 2+ people needing rescuing at once, but it would be less than you currently see.

Why do you have a fail variable?
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
hamibugan
Newbie


Joined: 27 Jun 2016
Posts: 3

PostPosted: Tue Jun 28, 2016 3:04 pm   
 
Ok, I see what you mean now. Once the name is on the list it can't be added again until it's cleared. Clearing would have to be manual though? I don't think I can use my success message to know which name to clear.

I can often have multiple rescue requests firing, yes. If it fires for more than one person that's great.

I have a chance to fail so if I get the fail message it triggers another rescue, which is part of the problem. I'm stacking up multiple triggers to rescue and if I fail I get a lag from the skill, it's just backing things up terrible!

I'll give a go at playing with what you've given. Thanks again for the responses.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 3805
Location: Pensacola, FL, USA

PostPosted: Tue Jun 28, 2016 4:55 pm   
 
You could use %pop(rescuing) to remove the first item in the list, but that's a pretty big assumption.... which is why i suggest resetting it to a null value.
Or you could try contacting staff and getting the messaging changed to reflect which rescue attempt was pass/failed.
If the passfail message happens on the exact next line we could figure it out intuitively.
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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