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
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Wed Jan 16, 2008 12:20 pm   

Loops reversing when triggered from events
 
I have an alias, qf, that does a mapquery and then outputs the results in a numbered list.
Problem is, if i call this alias from an event, the order of the list is reversed...

using a #loop 1,3 {#mxp %i} as a simplified example
_________________
The Drake Forestseer
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Wed Jan 16, 2008 12:25 pm   
 
a fix for it was to do #alarm {+0.001} {qf}, but still, it's starting to defeat the purpose when you have to make events write alarms for their actions to perform correctly
_________________
The Drake Forestseer
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Jan 16, 2008 12:43 pm   
 
Interestingly, this isn't universal. I did this test:

Code:
#event test {#loop 1,3 {#say lol %i}
#loop 1,3 {#mxp lol %i}
#loop 1,3 {#mxp %i}}
#raise test

which output
Quote:
lol 1
lol 2
lol 3



lol 3
lol 2
lol 1

Using an alias instead gave the expected result
Quote:
lol 1
lol 2
lol 3
lol 1
lol 2
lol 3




Definitely some sort of bug here. However, read the help file for #MXP alluran - the command takes two parameters, the first one of which is optional and a number. In the third test case in the alias, CMUD (correctly) thinks that there is no text parameter. Make sure that's what you want to happen.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Wed Jan 16, 2008 12:46 pm   
 
The #mxp %i was just an example, i didn't actually test that, the mxp string is rather more complex, it was more just pointing out the method i was using to show data was #mxp incase that was somehow interfering with the loops too.
_________________
The Drake Forestseer
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jan 16, 2008 6:22 pm   
 
The #MXP command is more for internal testing purposes. Try using the #SHOW command instead. The #SHOW command forces the line to be processed immediately rather than just adding it to the text queue like #SAY does. And yes, the first argument of #MXP is the mode. So you should be using:

#MXP {lol %i}

and

#MXP {%i}

as the proper syntax.
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Wed Jan 16, 2008 11:03 pm   
 
When i get up to re-writing that package (i decided my initial structure decisions weren't optimum) i'll copy past the entire line. I was using mxp to output a piece of clickable text... and it worked fine as a pure alias.
_________________
The Drake Forestseer
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