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
Hemdall
Wanderer


Joined: 30 Nov 2006
Posts: 50

PostPosted: Tue Jan 25, 2011 5:17 am   

Cmud stops responding when trigger fires on.
 
With commented lines below added to script text sometimes trigger works and creates variables as expected but very often client just stop responding.
Code:

$t = 0
#forall @m_druzyna {
$t = $t + 1
temczasowa = %i
#lua {odmiana_narzednik(zs.var.temczasowa,"zmienna")}
#lua {odmiana_biernik(zs.var.temczasowa,"zmienna1")}
#additem n_druzyna @zmienna
#additem b_druzyna @zmienna1
;#Class druzyna/"team members"
;#var team_member_$t {%i}
;#Class druzyna
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jan 25, 2011 1:32 pm   
 
Can you show us the rest of that script? Preferably in XML format.
Reply with quote
Hemdall
Wanderer


Joined: 30 Nov 2006
Posts: 50

PostPosted: Tue Jan 25, 2011 2:16 pm   
 
Code:

<trigger priority="33333" case="true" stop="true" regex="true" id="1351">
  <pattern>^(?:> )?Druzyne prowadzi (.+) i oprocz ciebie (?:jest|sa) w niej jeszcze(?:\:)? (.+)\.$</pattern>
  <value>#Class druzyna
m_druzyna = {}
m_leader = {}
b_druzyna = {}
b_leader = {}
n_druzyna = {}
n_leader = {}
m_leader = {%1}
m_druzyna =%subregex(%2,"\s?!i|\si\s|, ","|")
#sort m_druzyna
#additem m_druzyna @m_leader
#lua {odmiana_narzednik(zs.var.m_leader,"n_leader")}
#lua {odmiana_biernik(zs.var.m_leader,"b_leader")}
$t = 0
#forall @m_druzyna {
$t = $t + 1
temczasowa = %i
#lua {odmiana_narzednik(zs.var.temczasowa,"zmienna")}
#lua {odmiana_biernik(zs.var.temczasowa,"zmienna1")}
#additem n_druzyna @zmienna
#additem b_druzyna @zmienna1
;#Class druzyna/"team members"
;#var team_member_$t {%i}
;#Class druzyna
}
#additem n_druzyna @n_leader
#additem b_druzyna @b_leader
temczasowa = {}
zmienna = {}
zmienna1 = {}
#Class 0
#sort b_druzyna
#sort n_druzyna
</value>
</trigger>
Reply with quote
Tech
GURU


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

PostPosted: Tue Jan 25, 2011 2:49 pm   
 
My first guess is that CMUD may be hiccuping on the class folder name with the space in it. I'm not sure though, it maybe technically allowed.

The second it maybe hiccuping on the implicit concatenations in defining the class name, or the variable. You should try an explicit concatenation instead.

I tried both of those in a blank session and a simple loop and they both worked fine though. Do use #WAIT in any of your other scripts? It's possible that because you are changing classes something isn't being executed properly. You can test this by putting the commented code in a #SECTION.
_________________
Asati di tempari!
Reply with quote
Hemdall
Wanderer


Joined: 30 Nov 2006
Posts: 50

PostPosted: Tue Jan 25, 2011 3:04 pm   
 
Tech wrote:

The second it maybe hiccuping on the implicit concatenations in defining the class name, or the variable. You should try an explicit concatenation instead.

I'm really sorry but I don't understand what this sentence mean - could you give me an example what is implicit concatenations and how should look explicit concatenation?

I'll try to change class name to something without space and I'll put commented code into section, I have not any #wait command in any of my scripts so that's not issue.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jan 25, 2011 4:25 pm   
 
Implicit concatenation means combining two strings without specifically using the concatenation function:
Code:
druzyna/"team members"

Explicit concatenation means using the concatenation function.
Code:
#concat("druzyna/","team members")

Of course, in this case, explicit concatenation is a bit silly, since both parts are simple strings. Much easier would be to simply put quotes around the entire thing:
Code:
"druzyna/team members"

In any case, it doesn't sound like this is the problem, but now you know what implicit concatenation means. Implicit concatenation can work in many cases, but it does break in some other cases. Explicit concatenation is more rugged, and usually preferable, though the code looks a bit more awkward.
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