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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Wed Jul 12, 2006 2:00 am   

How do I auto-map room names with square brackets [ ] in?
 
Space [00-00-00]
Space [01-00-00]
etc
rooms are like that... I really need to save the room names, since the descriptions are all the same

At the moment for some reason my automapper only records "Space" as the name and ignores everything after Space (it doesnt even have the space before the square brackets start for some reason (like "Space "))..

Any way to get around this? :( :( a quick reply would be very much appreciated


there's a LOT of rooms, so automap is really needed, it's impossible to change it all by hand
_________________
mhm..
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Jul 12, 2006 3:34 am   
 
Use #TAG.

#trigger {your room name pattern here} {#TAG name}

When using #TAG, you must also tag your prompt as well, otherwise the other parts you tag will usually never work.

Also, don't forget that [] are special characters, so you need to quote them in the trigger pattern:

Space ~[00-00-00~]
_________________
EDIT: I didn't like my old signature
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Wed Jul 12, 2006 3:38 am   
 
I dont understand what you mean, what do I put in "name"? how do I tag my prompt?
_________________
mhm..
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Wed Jul 12, 2006 8:25 am   
 
One of these should work.

#TRIGGER {^(%w) ~[(*)~]} {#VAR RoomName %concat(%1,~[,%2,~]);#TAG name {@RoomName}}
#TRIGGER {^(%w) ~[(*)~]} {#VAR RoomName %concat(%1,"[",%2,"]");#TAG name {@RoomName}}

Edit: Fixed! and sorry 'bout that. The small text entry box broke my line at just the right(wrong) point to make me think that it was separated properly. Plus I was sloppy, I guess.


Last edited by mr_kent on Fri Jul 14, 2006 6:35 am; edited 2 times in total
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Thu Jul 13, 2006 11:23 pm   
 
unfortunately both of those give "argument expected" errors and so have no effect on anything, I checked after I added them :/
_________________
mhm..
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Jul 14, 2006 3:19 am   
 
did you edit the triggers? He forgot to include a separator in the ones he posted.
_________________
EDIT: I didn't like my old signature
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Fri Jul 14, 2006 3:49 am   
 
didnt edit at all, what do you mean separator :/
_________________
mhm..
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Fri Jul 14, 2006 7:12 am   
 
I edited my previous post.

If you need help #TAGging your prompt, it would help to see what it looks like.
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Fri Jul 14, 2006 2:10 pm   
 
mr kent the one you posted above gives a "syntax error" :/

and ok here is an example:
Quote:
Interstellar Space [00-00-00]
The entire expanse of interstellar space is an endless vacuum: a cold,
unforgiving void lit only sparsely by the twinkling rays of billions upon
billions of uncounted gaseous stars.
[ Exits: N E S W U D ]
A large hovering chunk of asteroid with a large tower jutting out of it floats here.

status1420(1420)hp 88(110)mv 9mp next 2392 Tank: Target: >
e
Interstellar Space [01-00-00]
The entire expanse of interstellar space is an endless vacuum: a cold,
unforgiving void lit only sparsely by the twinkling rays of billions upon
billions of uncounted gaseous stars. Life and sound are irrelevant to this
eternal black sea. The near-utter darkness is augmented only by the deathly
silence...
[ Exits: N E S W U D ]

status1420(1420)hp 87(110)mv 9mp next 2392 Tank: Target: >
e
Interstellar Space [02-00-00]
The entire expanse of interstellar space is an endless vacuum: a cold,
unforgiving void lit only sparsely by the twinkling rays of billions upon
billions of uncounted gaseous stars. Life and sound are irrelevant to this
eternal black sea. The near-utter darkness is augmented only by the deathly
silence...
[ Exits: N E S W U D ]

status1420(1420)hp 86(110)mv 9mp next 2392 Tank: Target: >
e
Interstellar Space [03-00-00]
The entire expanse of interstellar space is an endless vacuum: a cold,
unforgiving void lit only sparsely by the twinkling rays of billions upon
billions of uncounted gaseous stars. Life and sound are irrelevant to this
eternal black sea. The near-utter darkness is augmented only by the deathly
silence...
[ Exits: N E S W U D ]

status1420(1420)hp 85(110)mv 9mp next 2392 Tank: Target: >
u
Interstellar Space [03-00-01]
The entire expanse of interstellar space is an endless vacuum: a cold,
unforgiving void lit only sparsely by the twinkling rays of billions upon
billions of uncounted gaseous stars. Life and sound are irrelevant to this
eternal black sea. The near-utter darkness is augmented only by the deathly
silence...
[ Exits: N E S W U D ]

status1420(1420)hp 85(110)mv 9mp next 2392 Tank: Target: >
u
Interstellar Space [03-00-02]
The entire expanse of interstellar space is an endless vacuum: a cold,
unforgiving void lit only sparsely by the twinkling rays of billions upon
billions of uncounted gaseous stars. Life and sound are irrelevant to this
eternal black sea. The near-utter darkness is augmented only by the deathly
silence...
[ Exits: N E S W U D ]

status1420(1420)hp 84(110)mv 9mp next 2392 Tank: Target: >
e
Interstellar Space [04-00-02]
The entire expanse of interstellar space is an endless vacuum: a cold,
unforgiving void lit only sparsely by the twinkling rays of billions upon
billions of uncounted gaseous stars. Life and sound are irrelevant to this
eternal black sea. The near-utter darkness is augmented only by the deathly
silence...
[ Exits: N E S W U D ]

status1420(1420)hp 85(110)mv 9mp next 2392 Tank: Target: >
n
Interstellar Space [04-01-02]
The entire expanse of interstellar space is an endless vacuum: a cold,
unforgiving void lit only sparsely by the twinkling rays of billions upon
billions of uncounted gaseous stars. Life and sound are irrelevant to this
eternal black sea. The near-utter darkness is augmented only by the deathly
silence...
[ Exits: N E S W U D ]

status1420(1420)hp 88(110)mv 9mp next 2392 Tank: Target: >


i have the prompt gagged (cos I have gauge buttons that show the same details) if that makes any difference
_________________
mhm..
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Fri Jul 14, 2006 3:17 pm   
 
Get rid of any trigger(s) I posted before and try this:

#TRIGGER {(%w) ~[(*)~]} {#VAR RoomName %concat(%1," ",~[,%2,~]);#TAG name {@RoomName}}
Tested with v7.21 & XP sp2


Somewhere you probably have a prompt trigger like one of the following. If you know where your prompt trigger is, great.

#TRIGGER {status&hp~(&maxhp~)hp......} {#GAG}
#TRIGGER {status(%n)~((%n))hp (%n)~((%n)~)mv (%n)mp next (%n) Tank:(*)Target:(*)>} {#VAR somename %1;......;#VAR somename %#;#GAG}


To tag your prompt, just add #TAG prompt before the #GAG command if it isn't already there.

#TRIGGER {status&hp~(&maxhp~)hp......} {#TAG prompt;#GAG}
#TRIGGER {status(%n)~((%n))hp (%n)~((%n)~)mv (%n)mp next (%n) Tank:(*)Target:(*)>} {#VAR somename %1;......;#VAR somename %#;#TAG prompt;#GAG}
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Fri Jul 14, 2006 9:17 pm   
 
err kinda works, but it's calling the rooms entirely different names now :o

Interstellar Space [00-00-00] gets named on the map as "Space 0"
Interstellar Space [19-19-09] gets named on the map as "Space -9"

Interstellar Space [19-05-00] gets named on the map as "Space 14"
Interstellar Space [18-05-00] gets named on the map as "Space 13"
Interstellar Space [17-05-00] gets named on the map as "Space 12"

its all really messed up basically :/ all I want it to do is capture the normal names
_________________
mhm..
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Sat Jul 15, 2006 5:54 am   
 
Rolling Eyes Okay, I guess you don't have the tilde enabled as the quote char.

If this trigger doesn't work, I give up. Mad

#TRIGGER {(%w) ~[(*)~]} {#VAR RoomName %concat(%1," ","[",%2,"]");#TAG name {@RoomName}}
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Sat Jul 15, 2006 6:47 am   
 
It doesn't make any difference, it's still just "Space -3" etc :(

and yes, tilde is the quote character I checked in the preferences

command: #
separator: &
variable: @
parameter: %
focus: : (disabled)
class: / (disabled)

movement: .
history: !
quote: ~
mapdir: >
database: &


oh, and yeah I figured out that the ; was a separator before and changed that so the script worked, before it only gave the syntax error

please don't give up :/
_________________
mhm..
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Jul 15, 2006 4:17 pm   
 
I figured it out. You have two problems, actually.

Problem 1 is that your pattern is not sufficient to capture what you want. It's only matching on Space, and not even caring about Interstellar. The use of the * is fine, but will allow this trigger to match on any other word [anything] patterns. Your new pattern should be more like this to better capture and limit the trigger match to the actual room name:

#trigger {^([%w%s]~[%d-%d-%d~])$} {stuff that was here before}

Problem two is found in the variable contents itself. Your %concat() might indeed be correctly placing Space [00-00-00] into the variable, but when you go to use that variable in the #TAG command ZMud is evaluating the 00-00-00 part mathematically (0 minus 0 minus 0 = 0). To fix this you can uncheck this option in Preferences, you can include a tilde in the %concat() where you add the [], or you can use %quote() on the @roomname variable wherever you use it.
_________________
EDIT: I didn't like my old signature
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Mon Jul 17, 2006 2:29 am   
 
#trigger {^([%w%s]~[%d-%d-%d~])$} {#VAR RoomName %concat(%1," ","[",%2,"]")&#TAG name {@RoomName}}

sorry, where do I put the tilde? do you mean before the %concat or before each [ and ]? I'm confused
_________________
mhm..
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jul 17, 2006 6:01 am   
 
Literally before each [ and ] within the %concat() function.

%concat(%1," ","~[",%2,"~]")

Now, I'm not sure if ZMud will eat those single tildes, so if one tilde doesn't work try two:

%concat(%1," ","~~[",%2,"~~]")

If that doesn't work, just uncheck the option in Script Parser Preferences dealing with [].
_________________
EDIT: I didn't like my old signature
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Tue Jul 18, 2006 11:01 am   
 
ok, this one, with one tilde before each:
#trigger {^([%w%s]~[%d-%d-%d~])$} {#VAR RoomName %concat(%1," ","~[",%2,"~]")&#TAG name {@RoomName}}
when reading room [color]Interstellar Space [00-00-00][/color] produces:
Interstellar Space 0 []

this one, with two tildes before each:
#trigger {^([%w%s]~[%d-%d-%d~])$} {#VAR RoomName %concat(%1," ","~~[",%2,"~~]")&#TAG name {@RoomName}}
when reading room [color]Interstellar Space [00-00-00][/color] produces:
Interstellar Space 0 ~~
(so never mind trying with 2 tildes that obviously doesnt work)

so we've got the first part of the name right but it's still doing the end bit wrong...

using the first version with 1 tilde on each, going to room Interstellar Space [04-04-02] gives Interstellar Space -2 [] so it looks like it's still doing maths stuff on them and ignoring the stuff in [ ]


it's amazing how complicated it is just to get zmud to map rooms with [ ] in them... ridiculous how easy it is to sabotage :/

in this game clans are putting [ ] around their base rooms on purpose lol, because they know it ruins zmud's automap

I hope cmud is more reliable :(
_________________
mhm..
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Jul 18, 2006 10:53 pm   
 
Question: are you doing ANYTHING in this trigger (or later, via the Roomname variable) where you need to have the coordinates separate from the rest of the room name? If not, there's really no point to the extra processing of the %concat() function. %1 will work just fine.

If so, then first example you posted is the correct version to use. The problem with it is simply that the pattern only sets %1 whereas you are using %2 in the code it executes. This is why the number appears to be outside the [] when in fact it wasn't--you just had two sets of [] in the variable. You need to change the pattern so that the two sets of parentheses you need are surrounding the [%w%s] part and the [%d-%d-%d] part.

Once that is done, the trigger should be working perfectly. If you are still getting evaluated numbers instead of 3-digit coordinate strings, uncheck the preference I mentioned earlier.
_________________
EDIT: I didn't like my old signature
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Wed Jul 19, 2006 7:31 am   
 
What is the addy of this MUD? Could I get to these interstellar space rooms fairly quickly after login?
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Thu Jul 20, 2006 11:18 am   
 
never mind i got it working, I turned off use square brackets for eval :)

pity it doesnt work without that tho
_________________
mhm..
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Fri Aug 11, 2006 10:37 am   
 
help
_________________
mhm..
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Fri Aug 11, 2006 10:40 am   
 
it stopped working i dont know whats wrong

can you go to avpmud.com port 4000 and see?

make an alien then from recall:

Code:
w
w
n
n
w
enter pod
get ebs
wear ebs
leave
e
s
s
w
w
enter tunnel
u
u
u
u
u
u
_________________
mhm..
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Mon Aug 14, 2006 10:45 am   
 
bump... can anyone help? :(
_________________
mhm..
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Wed Aug 16, 2006 2:27 pm   
 
anyone? :(
_________________
mhm..
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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