|
Edogg Beginner
Joined: 27 Feb 2011 Posts: 17
|
Posted: Sat Oct 22, 2011 11:47 pm
Compass |
Im trying to make a zmud compass and this is what the mud has to trigger off of:
Room Description - - NE
(-------------------------------------------------) # <-U-(M)-D-> E
- - SE
Actually here is a better look: http://pastie.org/2742812
I really dont want the room descr or the dotted line on the middle line. There is no in or out and the # is a closed door.
All I really have so far is this:
#TRIGGER {{-|#|Nw} (*) {-|#|Ne}$} {#cap 4 compass}
Is there anyway to remove the room descr and the middle dotted line while still retaining the original compass look and colors.
I currently use a buttoned version but I cant figure out how to catch a color labeled room or the '#' for closed door.
The trigger for this is based off of: Visible Exits: (W) U D Ne Se where (W) is a closed door
#VAR compassdirections {}
#TRIGGER {Visible Exits: *$} {#gag}
#REGEX {Visible Exits: (.*)} {
compassdirections = ""
#fo {N|Ne|E|Se|S|Sw|W|Nw|U|D} {#if %regex( "%concat(%1,%2)", "\b%i\b") {#additem compassdirections %i}}
#IF %ismember( D, @compassdirections) {#VAR compassdown 1} {#VAR compassdown 0}
#IF %ismember( E, @compassdirections) {#VAR compasseast 1} {#VAR compasseast 0}
#IF %ismember( W, @compassdirections) {#VAR compasswest 1} {#VAR compasswest 0}
#IF %ismember( N, @compassdirections) {#VAR compassnorth 1} {#VAR compassnorth 0}
#IF %ismember( S, @compassdirections) {#VAR compasssouth 1} {#VAR compasssouth 0}
#IF %ismember( Se, @compassdirections) {#VAR compasssoutheast 1} {#VAR compasssoutheast 0}
#IF %ismember( Sw, @compassdirections) {#VAR compasssouthwest 1} {#VAR compasssouthwest 0}
#IF %ismember( Ne, @compassdirections) {#VAR compassnortheast 1} {#VAR compassnortheast 0}
#IF %ismember( Nw, @compassdirections) {#VAR compassnorthwest 1} {#VAR compassnorthwest 0}
#IF %ismember( U, @compassdirections) {#VAR compassup 1} {#VAR compassup 0}
}
#BUTTON 4 {---} {} {NE} {} {} {compassnortheast} {} {Size} {27} {24} {Pos} {106} {99} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 5 {---} {} {S} {} {} {compasssouth} {} {Size} {27} {24} {Pos} {154} {50} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 6 {---} {} {NW} {} {} {compassnorthwest} {} {Size} {27} {24} {Pos} {106} {1} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 8 {---} {} {SE} {} {} {compasssoutheast} {} {Size} {27} {24} {Pos} {154} {99} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 9 {---} {} {SW} {} {} {compasssouthwest} {} {Size} {27} {24} {Pos} {154} {1} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 10 {---} {} {E} {} {} {compasseast} {} {Size} {27} {24} {Pos} {130} {99} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 11 {|---} {} {U} {} {} {compassup} {} {Size} {22} {24} {Pos} {130} {28} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 12 {---|} {} {D} {} {} {compassdown} {} {Size} {22} {24} {Pos} {130} {77} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 13 {---} {} {N} {} {} {compassnorth} {} {Size} {27} {24} {Pos} {106} {50} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 14 {---} {} {W} {} {} {compasswest} {} {Size} {27} {24} {Pos} {130} {1} {9} {14} {} {} "" {} {} {} {3}
#BUTTON 256 {M} {} {M} {} {} {1} {} {Size} {27} {24} {Pos} {130} {50} {13} {15} {} {} "" {} {} {} {3}
#BUTTON 257 {---} {} {} {} {} {} {} {Size} {22} {24} {Pos} {106} {27} {} {} {Gauge||0|||0} {5} "" {Explore|Inset} {} {} {3}
#BUTTON 258 {---} {} {} {} {} {} {} {Size} {22} {22} {Pos} {154} {27} {} {} {Gauge||0|||0} {10} "" {Explore|Inset} {} {} {3}
#BUTTON 259 {---} {} {D} {} {} {1} {} {Size} {21} {24} {Pos} {106} {77} {} {14} {Gauge||0|||0} {5} "" {Explore|Inset} {} {} {3}
#BUTTON 260 {---} {} {D} {} {} {1} {} {Size} {21} {22} {Pos} {154} {77} {} {14} {Gauge||0|||0} {10} "" {Explore|Inset} {} {} {3}
#BUTTON 261 {} {} {D} {} {} {1} {} {Size} {126} {15} {Pos} {176} {0} {} {14} {Gauge||0|||0} {} "" {Explore|Inset} {} {} {3}
#BUTTON 262 {} {} {D} {} {} {1} {} {Size} {126} {15} {Pos} {91} {0} {} {14} {Gauge||0|||0} {} "" {Explore|Inset} {} {} {3}
#CLASS 0
Any help on either would be greatly appreciated! |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Oct 23, 2011 1:11 am |
You know what column the compass starts, so it's probably simplest to use a multistate trigger with 3 states.
#trigger {^(&#([-NWE#%s])$} {#psub "" %x1}
#condition {^~([-]~)([-NWE#%s])$} {#psub "" %x1}
#condition {&#([-NWE#%s])} {#psub "" %x1}
The bolded # is where you put in an actual number to cover the beginning of the line. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Edogg Beginner
Joined: 27 Feb 2011 Posts: 17
|
Posted: Tue Oct 25, 2011 1:38 am |
There is a syntax error and I cant figure it out. This is for zmud right?
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Oct 25, 2011 2:32 am |
whoops, forgot to put the entire set of parentheses around the &# parts. Same for the middle line. All the stuff that represents what you want to take out needs a set of parentheses so that that portion of the line goes into %1/%x1.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Edogg Beginner
Joined: 27 Feb 2011 Posts: 17
|
Posted: Wed Oct 26, 2011 2:52 am |
That worked! Can I get a lesson on how to capture please?
|
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Wed Oct 26, 2011 3:02 am |
Check out the #CAPTURE command.
|
|
|
|
Edogg Beginner
Joined: 27 Feb 2011 Posts: 17
|
Posted: Wed Oct 26, 2011 4:40 pm |
I guess I should have been a little more specific. It captures it into a window I made but it also captures everything after (from the main window) and everthing from all other windows (tells, clan talk etc.).
Plus the actual number I used to cover the beginning of the line is 55; so everything captured after the actual compass is minus that number on all the windows, not just the compass window. Its a real mess. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Oct 26, 2011 9:10 pm |
Try changing the trigger type of the two conditions I gave you to Within Lines, with the number set to 1. You more than likely have this trigger stuck on one of those conditions, and since pattern states ALWAYS stay active until the pattern matches it's likely to match on most any line. An alternative, once you know the trigger is written well enough that it only matches on those 3 lines the compass appears on, is to just give it a name and use #STATE name 0 to reset the trigger back to the starting pattern.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|