|
Ralph1971 Wanderer
Joined: 01 Mar 2008 Posts: 64
|
Posted: Sat Apr 04, 2009 2:51 am
%window |
I multi on a mud, and I want to set up an alias log <char>...
usage would be log Ralph1971..
script would check to see if that window is already open, in which case, it would just :%1:#connect. if it's not already open, it will #ses %1...
I think you could use the %window command.. but the zmud 7.21 file is very lacking in usage example for that.
any suggestions? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Sat Apr 04, 2009 3:38 am |
%names contains a list/array of all currently open windows... you could do an %ismember on it and if its not there open your session as well.
#IF %ismember(%1, %names) {} {#SES %1} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Ralph1971 Wanderer
Joined: 01 Mar 2008 Posts: 64
|
Posted: Sat Apr 04, 2009 4:57 am |
I did that..
still opened up new windows when they already existed
added opening and closing () around the ismember statemtent
added win=%names, and changed the %names in the #if to @win..
all opened up new windows when they already existed |
|
_________________ Win7-home - Cmud 3.33a
WinXP-pro - Zmud 7.21 |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Sun Apr 05, 2009 2:32 pm |
Did you use correct capitalization in your input?
I end up doing things like this:
#IF %ismember(%1, %names) {#SH window param 1 equals %1 exists at %ismember(%1, %names) place } {#SH window param 1 equals %1 does not exist}}.
also
#sh %item(%names,%ismember(%1, %names)) <-- valid
Is %names actually returning the predicted strings? What about nulls, you can't test that by right clicking in settings. I think the command line differs. |
|
|
|
Ralph1971 Wanderer
Joined: 01 Mar 2008 Posts: 64
|
Posted: Sun Apr 05, 2009 5:10 pm |
figured it out.. your capitalization comment made me think of this.. in the chars settings, the character names (also in the %names) are capitalized.. the command I was sending to the mud wasn't (i.e. log Kendal worked, log kendal didn't.. but it opened up a new session instead).. just have to either remember to capitalize, or change the character files on the connection page.
thanks! |
|
_________________ Win7-home - Cmud 3.33a
WinXP-pro - Zmud 7.21 |
|
|
|
|
|