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
NiTok
Newbie


Joined: 05 Jan 2007
Posts: 3

PostPosted: Fri Jan 05, 2007 8:02 pm   

[1.24] Mapper Problem using #TAG
 
After some work I finally got the mapper to work in zMUD by recognizing mostly unique color patterns. I'm trying to make the switch to CMUD [v1.24] but having an odd time...

Here's the crux of the mapper: the name Tag trigger
[Note the little box that precedes the right brackets in the ANSI pattern doesn't show up here, but it is there in the code]

Pattern:
(*)~.
Script:
#TAG name %1
@nameCheckVariable = %1
Options:
TriggerOnTrigger, TriggerOnNewLine, ANSITriger

The #TAG code works fine in zMUD, but in CMUD it names every room "%1" ! Strangely @nameCheckVariable does carry the proper value (whatever the name was that was supposed to be captured). So the problem doesn't appear to be the pattern, and %1 does seem to carry the proper value in this context...

I can kludge the code together to work with the following:
Pattern:
(*)~.
Script:
@nameCheckVariable = %1
#TAG name @nameCheckVariable
Options:
TriggerOnTrigger, TriggerOnNewLine, ANSITriger

The above does properly label/recognize locations as I'm mapping, but I'm sure I shouldn't have to code it that way. The inelegance kills me, not to mention that I seem to be misunderstanding something important about how CMUD is interpreting my code.

I've tried a few things. Early expansion with <%1>, but that just names everything "<%1>". Tried using a local variable def in the Pattern, but that didn't work (that may have been me, but in any case I'd prefer not to do it that way... hard to read for me). Perhaps I need to do a delayed expansion of the variable? It is my understanding that CMUD now delays expansion of regular @variable variables until execution... maybe that's why the later works, but the former doesn't...

Any help would be appreciated.




[Note I also have an issue getting making the pattern for my prompt Tagger, (%w)(*)[ caueses the last parenthes to not grey out and coincide with the previous one... but I'll wait till i figure out the first problem before posting about the second (though I'll throw that out there in case its a simple mistake]
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Jan 06, 2007 2:28 pm   
 
About the note: just because it's grey doesn't mean it's not working. Try and see.

Try changing the (*) wildcard to ($roomname:*) and using the $roomname variable instead of %1, firstly. Also, since it's colours you're using for your ANSI trigger you could just use the line colour option instead.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
NiTok
Newbie


Joined: 05 Jan 2007
Posts: 3

PostPosted: Wed Jan 10, 2007 3:12 am   
 
Responding in reverse order:

The mapper works with the following code
Pattern:
[1;33m(%1)[0m~.
Script:
#TAG name
Options:
as above

Don't know why... and more importantly I still want to know why the previous code didn't work so I don't make similar mistakes. (thanks for the code offer though)

Regarding greyed out text: I'm aware that with syntax highlighting greyed out text in the pattern doesn't mean, but that's not the problem. The problem is that one parenthese is greyed out and the other isn't, where they are enclosing the same item...
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