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
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Mon Feb 14, 2005 12:58 pm   

Super simple command question
 
Ok, this is probably the dumbest question I've ever had to ask about a MUD client :P but I cannot find the answer in the helps or by trial and error...

I have several thousand (yes that's right!) alias in my Zmud file. Many of them are similarly named (for similar uses). I'm looking for some command I can use to display all aliases matching a pattern to my Zmud window for quick reference.

For example, in TinTin++ (years and years ago) typing

#al ka-

would show all aliases that started with "ka-"

Thanks a lot in advance :)
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Mon Feb 14, 2005 2:19 pm   
 
I had something similar when i used TinyFugue.
Would love to have that in here as well.
_________________
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Feb 14, 2005 3:46 pm   
 
No doubt a better way to do this but heres the first thing I came up with.

Code:
#ALIAS matchalias {#loop %session.NumAliases {
#if %match(%session.AliasNum(%i).Name,%1) { #echo %session.AliasNum(%i).Name}
}}



This creates yet another alias Razz , but you could easily make it a function if you wished, however with this alias just type matchalias pattern
where pattern is the regular expression pattern you wish matched, this just echos the name of the aliases which is what i think you want but you
could easily modify it so it shows the body of the alias like the #ALIAS command does.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Mon Feb 14, 2005 6:37 pm   
 
Actually, this works perfectly. Gives one of those silly error msgs that seem to crop up out of perfectly done things but who cares Very Happy
Code:
#loop %session.NumAliases {#if %match(%session.AliasNum(%i).Name,%1) { #echo %session.AliasNum(%i).Name}}
                                                       ^ syntax error
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Feb 14, 2005 7:23 pm   
 
yeah the error in the script editor not the script itself :)
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Fri Jul 01, 2005 1:54 pm   
 
Was just thinking, this MatchAlias script rox so much....wouldn't it be great if there was a MatchTrigger one as well?
Well, tried it and failed at it (like that's a shock)

#ALIAS matchtrig {#loop %session.Numtrig {#if %match(%session.TrigNum(%i).Name,%1) { #echo %session.TrigNum(%i).Name}}}

#ALIAS matchtrigg {#loop %session.Numtrigger {#if %match(%session.TriggerNum(%i).Name,%1) { #echo %session.TriggerNum(%i).Name}}}

matchtrig You
matchtrigg You

I get an parse error msg window that says:

Error parsing command:
No method/property name: Numtrigger
matchtrigg You

or Numtrig depending on which is used.

Any ideas?
_________________
http://www.Aardwolf.com
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Fri Jul 01, 2005 11:40 pm   
 
You were so close ;)

#ALIAS matchtrigger {#loop %session.NumTriggers {#if %match(%session.TriggerNum(%i).Name,%1) { #echo %session.TriggerNum(%i).Name}}}
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Sat Jul 02, 2005 1:02 am   
 
SWEET!
Figures i'd be off by a character :-)
Now for the stupid question, how do i tell it NOT to fire the triggers when that is run? Twisted Evil

matchtrigger You <--just a simple test
crap load of output
CONGRATULATIONS: You have Aardwolf lottery winnings to collect!!
lottery collect <--result from above trigger. WHOOPS
craps more of output
_________________
http://www.Aardwolf.com
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Jul 02, 2005 12:46 pm   
 
Tested, Also slightly re-wrote to remove syntax error remeber {}'s are your friend :P

#ALIAS MatchTrigger {
#IGNORE
#PRIORITY {#LOOP %session.NumTriggers {#IF %match( {%session.TriggerNum(%i).Name}, "%-1") {#ECHO %session.TriggerNum(%i).Name}}}
#IGNORE
}
_________________
Zmud Support Library
Zmud Knowledge Base
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