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
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Wed Dec 31, 2008 6:25 am   

[2.37] #Gag change causing an issue with an prompt event.
 
Since the rework of how #gag works I've had two issues.

1) I have a prompt event that will not fire if the line before it is gagged before the event is enabled. It only works correctly if I enable the prompt before gagging the line before the prompt.

(Edited: See below for a better example)

2) When I #gag a line sometimes it reappears a few lines later as text is scrolling up the screen. So the sequence is the following:

a) The line is #gagged and I print something out in place of the gagged line.
b) A few lines go by and then the #gagged line reappears.
c) Another line is received and the newly reappeared (but previously gagged) line disappears again.

I have no idea what causes it. It doesn't happen all the time, but it does happen from time to time with a certain regularity.


Last edited by ReedN on Thu Jan 01, 2009 8:11 pm; edited 1 time in total
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Wed Dec 31, 2008 11:16 pm   Further Investigation and an Example
 
I've mocked up a small example of the issue. In this example I have a regex that detects the prompt and fires a Prompt_test event. There are two receivers of this event, one that is enabled every line which prints out "(control)" to show that a Prompt_test event fired. The other one prints out "(enabled)" when it is enabled and receives the event. I execute a command that returns "There is no such person, I'm afraid." which executes some code which does a #show/#gag/#delitem and enables the "(enabled)" prompt printout. It should be printing out "(enabled)" on the very next line, but it doesn't. Only if I switch the order of the #show statement does it enable correctly.

Code for incorrect operation:

Code:

(Edited:  Use the revised example below)


Ordering that gives incorrect operation:
#show Triggered.
#gag
#delitem sl1 @testname
#T+ prompt1

The enable line doesn't occur on the following prompt as it should, thus it is not enabling correctly or in time to catch the next prompt. It executes on the next one incorrectly instead.

8651h, 8753m, 38725e, 35575w cexdb-(control)honors fdjskl

Triggered.
8651h, 8753m, 38725e, 35575w cexdb-(control)
8651h, 8751m, 38725e, 35574w cexdb-(enabled)(control)
8651h, 8751m, 38725e, 35575w cexdb-(control)

Ordering that gives correct operation:
#gag
#delitem sl1 @testname
#T+ prompt1
#show Triggered.

With this order it is enabled for the very next prompt.

8651h, 8753m, 38695e, 35542w cexdb-(control)
8651h, 8753m, 38695e, 35542w cexdb-(control)honors fdjskl

Triggered.
8651h, 8753m, 38695e, 35542w cexdb-(enabled)(control)
8651h, 8753m, 38725e, 35542w cexdb-(control)
8651h, 8753m, 38725e, 35542w cexdb-(control)


Last edited by ReedN on Thu Jan 01, 2009 8:12 pm; edited 1 time in total
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Wed Dec 31, 2008 11:40 pm   
 
I whittled it down a bit more to the essentials. Looks like this is an issue with #show. When I change it to #say the issue goes away.

Code:
<class name="ztemp" id="3339">
  <trigger priority="53270" regex="true" id="5327">
    <pattern>^There is no such person, I'm afraid\.$</pattern>
    <value>#show Triggered.
#T+ prompt1

</value>
  </trigger>
  <event event="Prompt_test" priority="53320" name="prompt1" enabled="false" id="5332">
    <value>#sayp ~(enabled~)
#T- prompt1</value>
  </event>
  <event event="Prompt_test" priority="53430" name="Prompt2" id="5343">
    <value>#sayp ~(control~)</value>
  </event>
  <trigger name="prompt_test" priority="6" case="true" trigontrig="false" regex="true" newline="false" prompt="true" id="5344">
    <pattern>^\d+h, \d+m, \d+e, \d+w ([cexkdb]*)\-</pattern>
    <value>#RAISEEVENT Prompt_test</value>
  </trigger>
</class>
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Thu Jan 01, 2009 1:25 am   
 
This might also be interfering with the #DELITEM which sometimes doesn't delete the item from the array depending on the ordering of the section. I tried for hours to get something reproducible where #DELITEM wouldn't erase the item from the array depending on the ordering of the statements, but it was very elusive. Even when I had the ordering correct it would only sometimes work in my actual code and never in my mocked up example. But just in case something occurs to you regarding #DELITEM and the #SHOW bug shown here, I'll add this as another possible related issue.
Reply with quote
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: Thu Jan 01, 2009 1:54 pm   
 
Wow, I'll take a look at this after I have some coffee. Long night last night. ;)
_________________
Citrus: The Juicy Alternative
Reply with quote
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: Thu Jan 01, 2009 2:18 pm   
 
Okay, from my own experiences with #SHOW, it displays text as though it was sent from the mud, so it's vulnerable to #GAG commands. I never really played with #SAY.

My own experiences with #GAGging trigger text has been successful and I've built an entire suite based off of that style of operation.

An acceptable alternative, perhaps, is #SUB your triggered message in place of the original trigger line. Or, place the #SHOW just after the #GAG command.

Code:

  <trigger priority="53270" regex="true" id="5327">
    <pattern>^There is no such person, I'm afraid\.$</pattern>
    <value>#SUB "Triggered."
#T+ prompt1
</value>
  </trigger>
_________________
Citrus: The Juicy Alternative
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Thu Jan 01, 2009 8:11 pm   
 
I've already coded around it. I'm posting it here so it can be fixed.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Tue Jan 06, 2009 6:11 pm   
 
Has anyone been able to replicate this behavior? You'll need your own trigger that raises the 'Prompt' event and to edit the trigger "There is no such person, I'm afraid." to something similar on your Mud, but otherwise this should be able to be replicated.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Wed Jan 21, 2009 7:32 am   
 
Delete this topic. I've extracted the essentials and reposted it in the beta section with instructions.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Jan 21, 2009 8:48 am   
 
We don't like to delete things, never going to know when they might be useful. Just let it die :)
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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