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
rassiel
Beginner


Joined: 11 Dec 2007
Posts: 14

PostPosted: Wed Dec 12, 2007 11:17 pm   

getting all aliases into tab list
 
is there a way to add all aliases to the tablist?
how can I disable the expansion of an alias usign the tab key?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Dec 12, 2007 11:40 pm   
 
Sure we can do all aliases.
Code:
#CLASS UpdateTABs
#VAR ComVar {} {}
#VAR TempCounter {} {}
#ALIAS DoTABUpdate {#DELCLASS FullAliasTabList;TempCounter=%session.NumAliases;#WHILE (@TempCounter) {#ADD TempCounter -1;ComVar=%session.AliasNum(@TempCounter);#TAB {@ComVar.Name} FullAliasTabList};ComVar=""}
#CLASS 0
#CLASS FullAliasTabList
#CLASS 0


I think what you are looking for with your question about disabling an alias is to use either quotes or a tilde on the command line or in your alias.
"aliasName"
~aliasName
#ALIAS aliasName {#SHOW Display this line;~aliasName}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
rassiel
Beginner


Joined: 11 Dec 2007
Posts: 14

PostPosted: Thu Dec 13, 2007 2:51 pm   
 
oh thanks for the script Shocked where can I learn doing that types of scripts? Very Happy
about the second question. Suppose I have this 2 aliases:

#alias1 do n,w,s,e
#alias2 do tell john hi, wave john

and also suppose I have this aliases names on my tablist (done with your script Wink )
now I type ali on the command line and when I press tab, it expands it to alias1 , when I press tab again expands again to do n,w,s,e
then when I press tab again zmud keeps the do word and then expands all to do alias2, tab again, and it cyles to do alias1, tab again and now
do do n,w,e ... you see? every times it changes to alias1 expands alias1 again and adds do, and do, and more does
and thats what I don't want.. I only want to cycle throug alias1 and alias2. any solution to this?
thanks for your help.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Dec 13, 2007 3:09 pm   
 
Ah, now I see what your asking for. I might be able to make it happen, but it would be a very convoluted script. I am not even sure it is possible to make what I am imagining because there is no function or predefined variable to retrieve what is currently sitting in the command line. I can try to come up with something though.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
rassiel
Beginner


Joined: 11 Dec 2007
Posts: 14

PostPosted: Thu Dec 13, 2007 3:13 pm   
 
thanks again a lot for your answers.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Dec 13, 2007 5:56 pm   
 
Ok I got something. You should just delete the old stuff from the original post, and probably all the tab completion settings you have. Then past this script into the command line. It uses some macros to simulate doing stuff like the tab does. It includes a forward, back, block, and reload macros. I tested it some so it shouldn't have any errors.
Code:
#CLASS {VijilanteTAB}
#VAR InputTABchars {} {}
#VAR TABbedAliases {recall}
#VAR BlockedAliases {onroomenter|onroomcreate|onwalkend|atdisconnect|atexit|atconnect}
#VAR BlockedClasses {}
#VAR CurrentTABbing {}
#VAR TABbingPos {0} {}
#ONINPUT {^(.*)VijilanteSays(Check|Block|Back)Alias$} {#GAG;#IF ((%null(%1)=0)&(%numwords(%1)=1)) {#IF (%ismember(%2,"Check|Back")) {#IF (%begins(@InputTABchars,%1)=0) {InputTABchars=%1;#IF (%regex(@TABbedAliases,%concat("\b((?:",%1,"[^|]+(?:(?:\||\z)",%1,"[^|]+)*)+)"),CurrentTABbing)=0) {CurrentTABbing=""};TABbingPos=0};#IF (@CurrentTABbing) {#IF (%2="Check") {#ADD TABbingPos 1;#IF (@TABbingPos>%numitems(@CurrentTABbing)) {TABbingPos=1}} {#ADD TABbingPos -1;#IF (@TABbingPos=0) {TABbingPos=%numitems(@CurrentTABbing)}}}} {#IF (%2="Block") {#IF (%item(@CurrentTABbing,@TABbingPos)=%1) {#DELITEM CurrentTABbing {%1};#ADD TABbingPos -1;#IF (@TABbingPos=0) {#IF (@CurrentTABbing) {TABbingPos=1}}};#ADDITEM BlockedAliases {%1};#DELITEM TABbedAliases {%1}}}}} "" {case|notrig|regex}
#COND {} {#IF (@CurrentTABbing) {#INPUT {%item(@CurrentTABbing,@TABbingPos)} 0} {#INPUT {%t1} 0;#IF (@InputTABchars) {#SHOW No alias found in list}}} {wait|param=10}
#KEY CTRL-` {VijilanteSaysCheckAlias} "" {append}
#KEY SHIFT-CTRL-` {VijilanteSaysBackAlias} "" {append}
#KEY ALT-CTRL-` {VijilanteSaysBlockAlias} "" {append}
#KEY SHIFT-ALT-CTRL-` {TABbedAliases="";TABbingPos=%session.NumAliases;#WHILE (@TABbingPos) {#ADD TABbingPos -1;#VAR CurrentTABbing {%session.AliasNum(@TabbingPos).Name};#VAR InputTABchars {%session.AliasNum(@TABbingPos).ClassName};#IF (%ismember(@CurrentTABbing,@BlockedAliases)=0) {#IF (%ismember(@InputTABchars,@BlockedClasses)=0) {#ADDITEM TABbedAliases {@CurrentTABbing}}}};InputTABchars="";CurrentTABbing=""}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
rassiel
Beginner


Joined: 11 Dec 2007
Posts: 14

PostPosted: Thu Dec 13, 2007 6:10 pm   
 
oohhh my God!!!!You are really fast, thanks a lot, I'll test it and let you know.
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Thu Dec 13, 2007 6:27 pm   
 
Shocked
As much as Vijilante tries to shrug it off, he is actually zScript in human form
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
rassiel
Beginner


Joined: 11 Dec 2007
Posts: 14

PostPosted: Fri Dec 14, 2007 2:50 pm   
 
hello vigilante, I tried your script and I did'nt work as expected.
well, the macros that generetes all the aliases worked very well.
for example, having alias1,alias2,hello1 and hello2 aliases
but whe I type, for example.... al and expands using ctrl+` it expands tu alias1 but does not cycle
also, I delete from the command line alias1 and press ctrl+` again and it doesn't expand anymore.
if I delete all the line from command line and type hell and press crl+` it works again.. if I delete the line again and type hell again
it doesn't work anymore.. I checked the alias list and it does contain all the aliases.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Dec 14, 2007 7:21 pm   
 
All fixed. I had added some extra checking just before I posted the first time and didn't test it well enough. This time I also changed one of the logics to be a little more accurate, and fixed it so that aliases in the root class now get listed. Mostly minor changes.
Code:
#CLASS {VijilanteTAB}
#VAR InputTABchars {} {}
#VAR TABbedAliases {}
#VAR BlockedAliases {onroomenter|onroomcreate|onwalkend|atdisconnect|atexit|atconnect}
#VAR BlockedClasses {}
#VAR CurrentTABbing {} {}
#VAR TABbingPos {} {}
#ONINPUT {^(.*)VijilanteSays(Check|Block|Back)Alias$} {#GAG;#IF (%numwords(%1)=1) {#IF (%ismember(%2,"Check|Back")) {#IF (%ismember(%1,@CurrentTABbing)=0) {InputTABchars=%1;#IF (%regex(@TABbedAliases,%concat("\b((?:",%1,"[^|]+(?:(?:\||\z)",%1,"[^|]+)*)+)"),CurrentTABbing)=0) {CurrentTABbing=""};TABbingPos=0};#IF (@CurrentTABbing) {#IF (%2="Check") {#ADD TABbingPos 1;#IF (@TABbingPos>%numitems(@CurrentTABbing)) {TABbingPos=1}} {#ADD TABbingPos -1;#IF (@TABbingPos=0) {TABbingPos=%numitems(@CurrentTABbing)}}}} {#IF (%2="Block") {#IF (%item(@CurrentTABbing,@TABbingPos)=%1) {#DELITEM CurrentTABbing {%1};#ADD TABbingPos -1;#IF (@TABbingPos=0) {#IF (@CurrentTABbing) {TABbingPos=1}}};#ADDITEM BlockedAliases {%1};#DELITEM TABbedAliases {%1}}}}} "" {case|notrig|regex}
#COND {} {#IF (@CurrentTABbing) {#INPUT {%item(@CurrentTABbing,@TABbingPos)} 0} {#INPUT {%t1} 0;#IF (@InputTABchars) {#SHOW No alias found in list}}} {wait|param=20}
#KEY CTRL-` {VijilanteSaysCheckAlias} "" {append}
#KEY SHIFT-CTRL-` {VijilanteSaysBackAlias} "" {append}
#KEY ALT-CTRL-` {VijilanteSaysBlockAlias} "" {append}
#KEY SHIFT-ALT-CTRL-` {TABbedAliases="";TABbingPos=%session.NumAliases;#WHILE (@TABbingPos) {#ADD TABbingPos -1;#VAR CurrentTABbing {%session.AliasNum(@TabbingPos).Name};#VAR InputTABchars {%session.AliasNum(@TABbingPos).ClassName};#IF (%ismember(@CurrentTABbing,@BlockedAliases)=0) {#IF (@InputTABchars) {#IF (%ismember(@InputTABchars,@BlockedClasses)=0) {#ADDITEM TABbedAliases {@CurrentTABbing}}} {#ADDITEM TABbedAliases {@CurrentTABbing}}}};InputTABchars="";CurrentTABbing=""}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Dec 14, 2007 7:56 pm   
 
Edit: Nevermind. I've got CMUD on the brain and didn't realize this was the zMUD forums. Embarassed
Reply with quote
rassiel
Beginner


Joined: 11 Dec 2007
Posts: 14

PostPosted: Fri Dec 14, 2007 9:23 pm   
 
hummm Confused
already tested. it now completes with no problem but still doesn't cycle through aliases...
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Dec 14, 2007 9:33 pm   
 
I think your on your own further. I just checked it again in both CMud and zMud and it cycles properly in both. CMud requires a few small adjustments in other areas to work right.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
rassiel
Beginner


Joined: 11 Dec 2007
Posts: 14

PostPosted: Fri Dec 14, 2007 9:45 pm   
 
ahh ok... thanks a lot for your time. Mr. Green I will not sleep today trying to make it work
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