|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Thu May 05, 2005 7:28 pm
Clickable #status exits *SOLVED*..kinda |
Reviving a topic back from 2002. :-)
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=8295&highlight=mxp+status
that topic was based on triggers and not on the mapper.
When i was helping someone figure out something with the status bar I came across the help files suggestion of putting in the room name and exits based on the mappers info. I added the zone name as well, cause if I know the name of the room but not the area, then it's not much help :-)
so I got this:
Code: |
<color firebrick><b>Area:</b> %zonename()</color> <color orangered><b>Room:</b> %roomname()</color> <color mediumvioletred><b>Exits:</b> %expandlist(%roomexit(),", ")</color> |
Now, here's the thing, how would i make it so that the exits were clickable, but ONLY if they were the non-standard ones?
Exits: w, aard, e, d, s, u
Generally would be enter "foo"
Tried <send>%expandlist(%roomexit(),", ")</send> thinking it would make each one clickable, but it just sent the whole line in one shot.
Ain't totally commited to this project, but was more of a side thought.
Thanks |
|
_________________
Last edited by DeathDealer on Tue May 10, 2005 8:06 pm; edited 2 times in total |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Thu May 05, 2005 8:37 pm |
Just a comment... it might be easier to add this after the fact based off the example given in the help file.
#TRIGGER {north} {#SUB {~<send>north~</send>}}
Soo umm
#TRIGGER {Exits: (*)} {do processing and subs here?} |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Thu May 05, 2005 8:49 pm |
Didn't think it would work cause it's in the #st and the %expandlist(%roomexit(),", ")
but i'll give it a shot when i get home. if i don't collapse in bed |
|
_________________
|
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Thu May 05, 2005 8:56 pm |
Well if you go with the original I would do it by creating a blank exits variable and looping through the exits depending... maybe something like this:
#VAR exits {}
#FORALL %roomexit() {#IF (%len(%i)>1) {#VAR exits {%additem("<send>%i</send>",@exits)}}} {#VAR exits {%additem(%i,@exits)}}}
<color firebrick><b>Area:</b> %zonename()</color> <color orangered><b>Room:</b> %roomname()</color> <color mediumvioletred><b>Exits:</b> %expandlist(@exits,", ")</color>
Donno if it will expand correctly or not. Didnt test the above code was just off the top of my head but should be fairly close... |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri May 06, 2005 1:25 pm |
I'm going to imagine that the #forall isn't supposed to be placed in the command line....
A crap load of screens detailing everything in my .mud file just scrolled by.... |
|
_________________
|
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Fri May 06, 2005 4:17 pm |
Yeah you cant do that... but im testing this one and it seems to work good. Its *real* ugly because of the multiple expansions but =) it does work
Uses the alias ShowRoom:
Code: |
#VAR exits {} {}
#ALIAS ShowRoom {
#VARIABLE exits {}
#FORALL %roomexit() {#IF (%len(%i)>1) {#VARIABLE exits {%additem("~<<send~>~>%i~<</send~>~>",@exits)}} {#VARIABLE exits {%additem(%i,@exits)}}}
#MXP ~<color firebrick~>~<b~>Area:~</b~> %zonename()~</color~> ~<color orangered~>~<b~>Room:~</b~> %roomname()~</color~> ~<color mediumvioletred~>~<b~>Exits:~</b~> %expandlist(@exits,", ")~</color~>
}
|
Good luck reading it though...
|
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri May 06, 2005 8:56 pm |
heh, me thinks someone doth missed the part that i said "the status bar" :-)
Looking to have this in the status bar like the help file for #status shows.
But just want the odd-ball exits clickable in it. |
|
_________________
|
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Fri May 06, 2005 10:24 pm |
Oh yeah, I did miss that part... oh well, at least I have something to work with =)
|
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Sat May 07, 2005 2:40 pm |
Code: |
<color firebrick><b>Area:</b> %zonename()</color> <color orangered><b>Room:</b> %roomname()</color> <color mediumvioletred><b>Exits:</b> %subregex(%expandlist(%roomexit(),", "),"(\a\a+)",~<send~>%1~</send~>)</color>
|
Here you go DD... this was as close as I could get. Works off the assumption that any non-standard exit would be two letters or greater. |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Sun May 08, 2005 2:47 pm |
*breaks down in tears of joy*
I wuv you man!
err...but ya know, in a manly sorta way *cough* |
|
_________________
|
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: Mon May 09, 2005 2:27 pm |
is there anyway to make this script support multiple word exits? like not all room exits are 'enter' it won't do things like 'jump out window' or so forth.
|
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Mon May 09, 2005 4:27 pm |
Sure thing... (as long as I got my regex correct that is)
This one will match just about anything but a single character all by itself. So critera would be as follows:
> If single word match if two characters or more in length
> if multiple word take it as it is
Code: |
<color firebrick><b>Area:</b> %zonename()</color> <color orangered><b>Room:</b> %roomname()</color> <color mediumvioletred><b>Exits:</b> %subregex(%expandlist(%roomexit(),", "),"(\a+(?: \a+)+|\a\a+)",~<send~>%1~</send~>)</color>
|
|
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Mon May 09, 2005 5:12 pm |
Ah, thanks Mael.
I didnt even think to check it for multi word exits.
Just tried it in one room that had a single and thought it was all good :-)
The change works, but dunno if it's me or what, but it don't work the 1st time i click it.
Had to click it 2 or 3 times before it worked.
Might just need to restart zmud or the computer. have had both running over the weekend.
Chris, good catch and question. I woulda noticed it at some point in time or more likely knowing me, wouldn't have at all :-) |
|
_________________
|
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: Mon May 09, 2005 11:26 pm |
thanks a lot as well, and you should definately post this on the finished scripts section since it is extremely useful
|
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Tue May 10, 2005 8:09 pm |
hrmm
Well, tried it after a reboot.
It works, but it still works when it wants to. A few clicks are needed before it happens.
Not sure why tho.
Thought it was cause this computer at work sucks. i think it's a p2 333 with 300+ something of ram.
Tried it at home on my p4 1.5gig with 256 ram (so i cant afford better ram, shoot me) and it still did the same thing. A few clicks needed to get it to recognize.
Any ideas? |
|
_________________
|
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Tue May 10, 2005 8:20 pm |
Noop, the original script you posted for modifying did the same thing to me. I didnt think about it at the time but I dont think its a script issue... if I come up with a work around ill let you know but I dont think ill find one...
|
|
|
|
|
|