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
benjunmun
Beginner


Joined: 23 Feb 2002
Posts: 23

PostPosted: Sat Jul 19, 2008 2:33 am   

[2.32] Recursive prompt trigger (SOLVED)
 
I think the issue has something to do with #echop, possibly in connection with ATCP
I am having a similar issue with a prompt trigger that has just cropped up in 2.32.

If I set up a trigger like this:
Code:

<class name="testclass" id="1403">
  <trigger priority="14070" newline="false" prompt="true" enabled="false" id="1407">
    <pattern>^%dh, %dm</pattern>
    <value>#echo gotprompt</value>
  </trigger>
</class>

I get in the script debugger:

0.7640 | a   Achaea2 |
0.0064 | i   Achaea2 ><CR><LF>
0.1062 | i   Achaea2 <<IAC><SB><200>Char.Vitals<LF>
0.0000 | H:966/966 M:1240/1240 E:3730/3730 W:4540/4540 NL:26/100 <IAC><SE><ESC>[32m966h, <ESC>[37m<ESC>[32m1240m <ESC>[37mex-<IAC><EOR>
0.0025 | a   Achaea2 #Telnet 200: Char.Vitals<LF>H:966/966 M:1240/1240 E:3730/3730 W:4540/4540 NL:26/100
0.0028 | a   Achaea2 |
0.0030 | a   Achaea2 ]966h, 1240m ex-
0.0024 | f   Achaea2 |  Pattern: ^%dh, %dm
0.0031 | c   Achaea2 |  exec : Pattern "^%dh, %dm" : #echo gotprompt
0.0026 | n   Achaea2 |  Exec Trigger "^%dh, %dm"
0.0032 | a   Achaea2 |966h, 1240m ex-gotprompt


If I change the #echo to #echoprompt, I get:
Code:

39.395 | k   Achaea2 |  Trigger "^%dh, %dm" changed from "#echo gotprompt" to "#echop gotprompt"
2.1463 | a   Achaea2 |
0.0070 | i   Achaea2 ><CR><LF>
0.1376 | i   Achaea2 <<IAC><SB><200>Char.Vitals<LF>
0.0000 | H:966/966 M:1240/1240 E:3730/3730 W:4540/4540 NL:26/100 <IAC><SE><ESC>[32m966h, <ESC>[37m<ESC>[32m1240m <ESC>[37mex-<IAC><EOR>
0.0070 | a   Achaea2 #Telnet 200: Char.Vitals<LF>H:966/966 M:1240/1240 E:3730/3730 W:4540/4540 NL:26/100
0.0034 | a   Achaea2 |
0.0034 | a   Achaea2 ]966h, 1240m ex-
0.0029 | f   Achaea2 |  Pattern: ^%dh, %dm
0.0033 | l   Achaea2 |  Trigger "^%dh, %dm" compiled (Normal) : #echop gotprompt
0.0024 | c   Achaea2 |  exec : Pattern "^%dh, %dm" : #echop gotprompt
0.0030 | n   Achaea2 |  Exec Trigger "^%dh, %dm"
0.0027 | a   Achaea2 ]966h, 1240m ex-gotprompt
0.0034 | f   Achaea2 |  Pattern: ^%dh, %dm
0.0056 | c   Achaea2 |  exec : Pattern "^%dh, %dm" : #echop gotprompt
0.0028 | n   Achaea2 |  Exec Trigger "^%dh, %dm"
0.0026 | a   Achaea2 ]966h, 1240m ex-gotpromptgotprompt
0.0027 | f   Achaea2 |  Pattern: ^%dh, %dm
0.0026 | c   Achaea2 |  exec : Pattern "^%dh, %dm" : #echop gotprompt
0.0025 | n   Achaea2 |  Exec Trigger "^%dh, %dm"
0.0027 | a   Achaea2 ]966h, 1240m ex-gotpromptgotpromptgotprompt


This continues until cmud detects a loop.
It looks like the trigger is triggering off of itself? If I turn off 'Trigger on Trigger' then the issue goes away.


Last edited by benjunmun on Mon Jul 21, 2008 7:21 pm; edited 1 time in total
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Jul 21, 2008 5:16 pm   
 
Well yes, this is as designed. When you use #ECHOPROMPT, CMUD will fire any Prompt triggers on the resulting line. If Trigger on Trigger is turned ON, then you are allowing other triggers to run on your output, including your current trigger.

So, the solution is to turn off the Trigger on Trigger option for your prompt trigger.
Reply with quote
benjunmun
Beginner


Joined: 23 Feb 2002
Posts: 23

PostPosted: Mon Jul 21, 2008 7:22 pm   
 
Okay, thanks. It makes sense to work this way, I was just confused since the behavior had been changed.

-Ben
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