Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Sep 09, 2010 11:27 pm   

[3.25]Bug: #WAIT increments Thread number from scripts, not just command line
 
It's a simple reproduction, I think. Copy the following code and paste into Package Editor.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger priority="10" copy="yes">
    <pattern>Fire thread</pattern>
    <value>#WAIT;#SAY {Thread fired!};#THREAD</value>
  </trigger>
</cmud>


On the command line, type #SAY {Fire thread}.

You'll see each time you fire the script, the thread number increases by one. As was stated in another post, this is probably a bug as the thread count should not increase unless you call #WAIT from the command line. #THREAD "name" does not increase the count.

Charneus
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Sep 10, 2010 4:08 pm   
 
No, that is actually correct. Sorry if I wasn't more clear in the previous thread. Notice that the thread you see incrementing does *not* have the [u] in front of it. That indicates the thread is a background script thread. CMUD will create a new background thread each time the trigger fires.

If you type #THREAD on the command line, you should see that the command line thread with the [u] in front of it remains with ID = 1 no matter how many times the trigger fires.

The problem from your other post was that the ID of the [u] command line thread had increased. The ID of the [u] thread will only increase if you use #WAIT on the command line (or alias from the command line). That has nothing to do with the ID count of a background trigger thread that doesn't have the [u] tag.

Basically, using #WAIT will create a new thread within the context of where it is running. If #WAIT is within a trigger, then it increments the ID of the trigger thread. If #WAIT is on the command line, then it increments the ID of the [u] thread.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Sep 10, 2010 6:39 pm   
 
Ah, missed the fact there was no [u] in front of it.

Regardless, it's still happening on my Aardwolf session, where nothing but triggers are used, and it's continually increasing the [u] thread, even though no #WAITs are used from the command line, alias or otherwise.

I have found that calling it from a macro does increase it for the [u] thread. Is that the same as calling it from the command line? I'm also going to investigate more into this, because I don't think I should have a reading of 103 [u] thread...

Charneus
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Sep 10, 2010 7:02 pm   
 
Yep, a macro will be the same as running an alias from the command line.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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