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
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Tue Jun 10, 2008 6:07 pm   

#psub question, not coming out rite...
 
Code:
<trigger priority="10100" ansi="true" id="1010">
  <pattern>%e[1;31m(*) lands %e[0;37m~[%e[1;37m (%d) of (%d) %e[0;37m~]%e[1;31m attacks on you~: %e[1;37m(*) ~((%d)~)%e[1;31m damage(*)%e[0m$</pattern>
  <value>#psub {~[ %eval(%2 * %5) ~]} %x1</value>
</trigger>


From the MUD:
A wolfen warrior lands ( 1 of 6 ) attacks on you: tickling damage (2) damage.

Trigger fires, and does the psub, but it looks like this....
A wolfe[ 2 ]( 1 of 6 ) attacks on you: tickling damage (2) damage.

I'm trying to get it to look like this (will add in the %ansi coloring later....)
[ 2 ] A wolfen warrior lands ( 1 of 6 ) attacks on you: tickling damage (2) damage.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jun 11, 2008 1:08 pm   
 
You have %x1 as the start point for replacing, so I would expect it to replace "a wolfen" with "[2]", which is not what you want. I think you want:
Code:
#psub {~[ %eval(%2 * %5) ~]} 0 %x1


As a side note, you have more parentheses than you need, unless you are doing other stuff that you haven't included in this code snippet. You aren't using %3 or %4.
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Wed Jun 11, 2008 3:35 pm   
 
This is an ANSI trigger btw... (not sure what/how to make it have that flag, but you get the jist)
Code:
#trig {%e[1;31m(*) lands %e[0;37m~[%e[1;37m (%d) of (%d) %e[0;37m~]%e[1;31m attacks on (*)~: %e[1;37m(*) ~((%d)~)%e[1;31m damage(*)%e[0m$} {#psub {~[ %eval(%2 * %6) ~]} 0 %x1}


This is what its looking like tho....
[ 27 ] dark lion lands [ 3 of 9 ] attacks on you: grazing (9) damage.

As far as the sidenote... I think thats what I had in there when I was playing with it trying to get it to work. Heh....
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jun 11, 2008 6:48 pm   
 
Sorry, but #SUB and #PSUB are not supported in ANSI triggers right now. It's on the to-do list for the future.
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Wed Jun 11, 2008 8:09 pm   
 
gar! nooooo!!! i'm LOVING ANSI triggers, sooo much more powerful imho. they coming out in the new release, or in v3?
Reply with quote
Tech
GURU


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

PostPosted: Wed Jun 11, 2008 9:02 pm   
 
For such a low-level change, I'm guessing v3 or later.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jun 11, 2008 9:29 pm   
 
Yeah, it will be a while. The problem is that with ANSI triggers, the ANSI codes are included in the pattern string, which messes up the "counting" of screen position used in #PSUB (since the ansi codes are invisible on the screen).

Also, I should remind people that ANSI triggers are slower than normal triggers since it requires CMUD to reconstruct the ANSI codes for each line of text from the screen display.
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Thu Jun 12, 2008 3:21 am   
 
every trigger is checked, right? so alot of ANSI triggers would noticeably slow it down? i'm thinking that for ALL battle text might be a bad idea to use the ANSI triggers. my only issue, is that using normal triggers, ill end up with a BAGILLION different triggers for all the different types of attacks an whatnot that are available. and using ANSI, id be able to single out if a certain line is combat, or communication. however, if it slows down my run and messes up my rates... heh, need I say more? LoL
anywho... food for thought for later... thanks everyone!
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Jun 12, 2008 6:02 am   
 
Every "enabled" trigger is checked, yes. So only use ANSI triggers when absolutely necessary. And group other triggers into class folders and then enable/disable the class folders as needed.

For example, all of my combat triggers are in a "combat" class folder, and I have a single trigger that can detect when I enter combat mode (start killing a mob) and when I exit (the mob dies, or I die) that can enable/disable the combat class.

You might want to create a new post with more specifics about your exact situation and exact triggers and I'm sure some of the Gurus can help you with optimization of your trigger patterns.
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