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


Joined: 21 Jun 2005
Posts: 38

PostPosted: Wed Nov 28, 2007 10:51 pm   

Problem with a prompt trigger.
 
Hi, sorry to be a bother with something so basic...

This is my prompt. I'm trying to make a trigger through it, to have an autosipper. Eventually I'll want to tack balance and prone, sleep and stun etc through it but since they change within the prompt I'll stick to just health and mana for now. that extra space is meant to be there btw.

Code:
H:353 M:173 E:1667 W:1348 <eb p>


Anyway, this is the trigger I'm using to try and capture it.

Code:
^H~:{&myhp} M~:{&mymp} E~:{&myendp} W~:{&mywp}


It seems to catch an occassional prompt. but not every one.

Any ideas? Confused
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Wed Nov 28, 2007 11:18 pm   
 
Code:


#regex {H\:(\d+) M\:(\d+) E\:(\d+) W\:(\d+) \<} {myhp=%1;mymp=%2;myendp=%3;mywp=%4}



Here's where my wit ends though, I'm afraid. I know that the last part, the one between <>'s is supposed to capture what sort of afflictions or something you're having but as I'm not playing Achaea or something like that, I'm unsure how to write that part into the code.

Thats why I only wrote the 2/3 of the prompt capture with simple regex, hope that helps.


EDIT: I wrote the code with no spaces between ":" and number, I couldn't really read out from your example if there is a space or not.
Prog
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Nov 28, 2007 11:25 pm   
 
On off the cuff guess is that it's may be a spacing issues. If any where in your prompt can have more than one consecutive space (e.g. if HP less than 100) then you may have a problem.

Try this.
Code:
^H~:{&myhp}%sM~:{&mymp}%sE~:{&myendp}%sW~:{&mywp}


Another, but less likely, possible culprit is that your prompt may not always be the first thing on a line. Without more prompt examples it will be hard to know for sure.

It'll also help to use %d in your variables.. like so.

Code:
^H~:&%d{myhp}%sM~:&%d{mymp}%sE~:&%d{myendp}%sW~:&%d{mywp}


I hope that helps.
_________________
Asati di tempari!
Reply with quote
easal
Novice


Joined: 21 Jun 2005
Posts: 38

PostPosted: Wed Nov 28, 2007 11:37 pm   
 
It's always first thing on the line.
As far as I've noticed if health shifts from 3 to 2 figures, the prompt squeezes, so white space stays the same but total char count goes down.
I'm not going to worry about capturing what comes between the <>s. I've actually just been told on the Imperian forums to avoid, just use the various balance gained/lost etc messages instead. This'll literally be for the autosipper and warning when low on endurance/willpower since they can kill you too.
No spaces between ":" and the numbers.

Thanks both of you. I'll fiddle with your suggestions and see if they work for me. Smile
Reply with quote
easal
Novice


Joined: 21 Jun 2005
Posts: 38

PostPosted: Wed Nov 28, 2007 11:45 pm   
 
Code:
H:353 M:160 E:1667 W:1348 <eb>
H:353 M:153 E:1667 W:1348 <eb>
H:353 M:57 E:1667 W:1348 <eb>
H:353 M:3 E:1667 W:1348 <eb>


Both your examples actually work just as my one seems to. Ie sporadically.
That's some extra examples if it helps.



Code:
H:353 M:136 E:1667 W:1348 <eb> 129
136

A rat darts into the shadows and disappears.
H:353 M:136 E:1667 W:1348 <eb>
A young rat pokes into the room in search of scraps to eat.
H:353 M:143 E:1667 W:1348 <eb> 136
143

Extra numbers after prompt are my evals. Right after the prompt pops followed maybe 1 second after.
so I don't know, looks like the info is being sent alright, but maybe really slowly or something? Goes from one figure to another with no further output from the game.
Thing is, the game is pretty spammy, multiple prompts per second in combat so is there a way for me to fix this?

Def not pc, dualcore processor should be more than able I would have thought.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Nov 29, 2007 4:42 am   
 
Can't you post an example of a prompt trigger that doesn't match? Without that we won't be of much help.
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Thu Nov 29, 2007 5:18 am   
 
I'm guessing from your posting in the General Discussion forum that you're using 1.34? These triggers not matching sometimes is a result of a bug in CMUD when processing GA/EOR at the end of a packet versus in the middle of a packet. You'll notice that you get this bug when you've received a number of prompts in quick succession, because a number of prompts have been sent in a single packet, which CMUD 1.34 then has trouble matching. This was fixed in 2.00:
Changelog wrote:
Fixed problem with Prompt Triggers not firing on IAC EOR or IAC GA

Also, fyi, IRE has a bug with the way they use MCCP. You should turn it off until they fix it.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
easal
Novice


Joined: 21 Jun 2005
Posts: 38

PostPosted: Fri Nov 30, 2007 8:45 pm   
 
Code:
You slash viciously into a vile serpent with a jewel encrusted sabre.
You slash viciously into a vile serpent with a jewel encrusted sabre.
You have scored a staggering blow!
H:313 M:268 E:1664 W:1348 <e-> dsl serpent

A vile serpent coils around your legs, causing agonizing pain from its strong
grip as it trips you, causing you to fall into the watery muck.
H:280 M:268 E:1664 W:1348 <e- p>
You must regain balance first.
H:280 M:268 E:1664 W:1348 <e- p>
You have recovered balance.
H:280 M:268 E:1664 W:1348 <eb p>
Quietly a baby rat darts across the floor.
H:280 M:268 E:1664 W:1348 <eb p>
A vile serpent rears back, then swiftly darts forward, gashing you with its
razor-like teeth.
H:257 M:268 E:1664 W:1348 <eb p> dsl serpent

Your wounds cause you to bleed 2 health.
H:255 M:268 E:1665 W:1348 <eb p>
You must first raise yourself and stand up.
H:255 M:268 E:1665 W:1348 <eb p> dsl serpent
stand

You must first raise yourself and stand up.
H:255 M:268 E:1665 W:1348 <eb p>
You stand up and stretch your arms out wide.
H:255 M:268 E:1665 W:1348 <eb>
A vile serpent rears back, then swiftly darts forward, gashing you with its
razor-like teeth.
H:230 M:268 E:1665 W:1348 <eb> dsl serpent

You swing a jewel encrusted sabre at a vile serpent with a powerful strike.
You slash viciously into a vile serpent with a jewel encrusted sabre.
H:248 M:275 E:1664 W:1348 <e->
sip health
A vile serpent rears back, then swiftly darts forward, gashing you with its
razor-like teeth.
H:220 M:275 E:1664 W:1348 <e->
sip health
You take a drink from a white vial.
The elixir heals your body.
H:290 M:275 E:1664 W:1348 <e->
You take a drink from a white vial.
You drink the elixir without effect.

That's a couple examples of it not firing, then firing and double healing. Healing was set on an if within the trigger to heal when dropped below 300.

Gonna dl the beta 2.+ and see if it clears it up.

Thanks all, I'll see how that goes on.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Fri Nov 30, 2007 9:18 pm   
 
For the double healing you need to put some sort of stop into your if for when you have already sipped health and need to regain balance.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
easal
Novice


Joined: 21 Jun 2005
Posts: 38

PostPosted: Fri Nov 30, 2007 9:51 pm   
 
Yarr, I know that. It's more the issue that it's not firing then firing in quick succession then not firing. That was just a hasty thrown together test. My full auto sipper'll need @elixirbalance, @sleep, @stun, @bad_digestion and a rake of other things.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Nov 30, 2007 11:36 pm   
 
Yes, that is the bug that Fang was talking about. It is fixed in the latest beta version of CMUD.
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