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


Joined: 22 Jun 2009
Posts: 38

PostPosted: Fri Jun 04, 2010 10:18 pm   

Autoheal trigger won't fire.....sometimes?
 
I have an autohealer that won't fire. That is, 1% of the time it doesn't fire. the trigger pattern is an expression, and it's simple:
Code:

@curhp<1400


I've checked the variable @curhp when this thing doesn't fire, and my curhp variable is less than 1400. I've checked my code and everything, and i cannot figure out why this isn't firing.

I can't force this to not work, just every once in a while it doesn't work. It's not an issue i can recreate, but i would say it happens every 24 hours of playing, less than once a day since i dont play for a full 24 hours.

The last time this trigger stopped firing, I check the @curhp variable, and it was under 1400. I then waited for the variable to change. My hp when from like 1380 to 1389, still under 1400, and it still didn't fire. Another minute goes by, and my curhp variable goes slightly higher, but not over 1400, and the trigger fires!

The problem I'm having is that nothing is changing when this trigger stops firing, and then starts firing again. Please help! I don't even know how to troubleshoot this. I strongly believe this is an issue with Cmud (but i'm very wrong sometimes)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sat Jun 05, 2010 3:12 am   
 
I don't believe thats a valid trigger pattern... but I've not really programmed on CMUD much so I could be wrong.

However, you obviously have some kinda trigger that scans your prompt to set the curhp variable, right?

So, in THAT trigger after the variable is set, just CHECK IT and make it call a heal alias or place all the heal code there. By check it, I mean put:
Code:

#IF (@currhp < 1400) {healalias}
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Jun 05, 2010 3:21 am   
 
It's a valid pattern. He's using an expression trigger, which looks a little like this:

#trigger "tHealHealth" (@curhp / 1400) {whatever it does here}

A pattern trigger, on the other hand, looks like this:

#trigger tHealHealth" {Dude, your leg just fell off and you're gushing blood!} {whatever it does here}
_________________
EDIT: I didn't like my old signature
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sat Jun 05, 2010 3:24 am   
 
Gotcha, something new in CMUD I take it? I really should get up to date on CMUD programming.

Still, my idea should work for him, instead of making a whole second trigger for it.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Jun 05, 2010 3:47 am   
 
Nope, it's at least as old as the current state model, which was originally installed I believe in the late 6.xx ZMud days. That was a good 6 or 7 years ago or so.

To get back on topic, though, if no classes are being enabled/disabled or some other form of scope change, it's probably an old bug that was long since fixed (either fixed-fixed, or "I got frustrated and rewrote the whole thing"-fixed) as part of the current beta cycle. CMud 2.37 is now approaching ZMud-like territory in how comparatively old it is, so it's getting rather hard to keep track of what's been fixed and what's still bugged in 2.37.
_________________
EDIT: I didn't like my old signature
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sat Jun 05, 2010 3:50 am   
 
Ok, I guess I just never used that functionality in zMUD, I've always done things the way I suggested he do them. LOL

Thanks Matt, always good to learn something new.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
grunthork
Novice


Joined: 22 Jun 2009
Posts: 38

PostPosted: Sun Jun 06, 2010 10:37 pm   Using Setprompt
 
I should have mentioned. I'm using #setprompt to capture my prompt. I tried using a trigger for about 6 weeks, and couldn't get it to work as well as #setprompt. Basically the same thing is happening with my expression trigger, though. Every time the variable (in this case, @curhp) changes, this expression is checked. it seems like it's not firing for a small period of time, though, so i just don't get it. What should i do? Should i just erase this one and rewrite it in the same way?

Edit: I also asked for cmud support because i feel like it's a bug, and they of course referred me to the forums.
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