Changing Aliases

Posted by Cas on Thu 04 Dec 2008 02:52 AM — 8 posts, 33,551 views.

#0

What I want to do is attach an action... "sneak" to each direction. My mud won't let you override the mud directions such as n,e,s,w, etc. So I made them in MUSHclient which in essence overrides them for me. However, this "sneak" action only works when moving in directions that are obvious exits from the room. When I am in a room without obvious exits and i type say "e" which goes in as sneak east, the mud will spit out a message and not move me.

I was wondering if there is a way to change MUSHclient aliases through a macro or trigger. I'd like to get a one word or something where i could activate/de-activate the "sneak" directions.

Thanks

Cas
Australia Forum Administrator #1
Sure, give the alias a name (label) and then use: SetAliasOption

http://www.gammon.com.au/scripts/doc.php?function=SetAliasOption

Or if you simply want to enable/disable it:

http://www.gammon.com.au/scripts/doc.php?function=EnableAlias

Australia Forum Administrator #2
Quote:

When I am in a room without obvious exits and i type say "e" which goes in as sneak east, the mud will spit out a message and not move me.


If you are in a room without an east exit, typing "e" wouldn't move you east anyway would it? So the alias hasn't really changed the problem?
#3
In some rooms yes. There may be a way to go east, but you cannot actually see it. For example:

Amidst dark grey thunderclouds that are frequently illuminated by arcs of blue lightning. The canyon wall is visible in the northerly directions. Swirling wind and rain makes vision difficult beyond just a few feet.

--- You can go in various directions here, but none of them are "obvious" ones like:

This is a rather large, circular shaped chamber. The chamber is furnished with a comfortable-looking divan that lies along the northern wall, and a small altar that lies along the southern wall. Large archways stand within the eastern and western walls.
There are two obvious exits: west and east.

--- I'm going to give your suggestions a shot. I'm not very good at things besides basic timers, triggers, and aliases; so you may be hearing back from me soon!

Thanks

Cas
#4
I think I kind of know how I want to do this...

I was thinking of making an alias for each direction...

alias n = sneak north
alias e = sneak east

and group them all in a "sneak" group

that way I can enable/disable the group to go from sneak mode to normal movement mode. The only problem is, I have no idea how to do the enable/disable part. I know the help file says to do something wit:

EnableAliasGroup ("groupname", true) - but i've got no idea
#5
I think I got it. I grouped all those aliases and then made a couple aliases with those EnableAliasGroup lines for enable and disable and put them in send to script and it seems to work. Thanks for all your help.

Cas
USA #6
Does the mud spit out a generic fail message or a specific one?

If it's a specific one, "you can not sneak east." it'd be easiest to trigger on that ("^you can not sneak (\w+)\.$") to Send(%1)


If it's a generic fail, then changing your alias 'n' to Send To Script with:
LastDir = 'north'
Send("sneak north")

repeat for other dirs.

and trigger the fail message to:
Send(LastDir)
Amended on Thu 04 Dec 2008 11:35 PM by WillFa
#7
Thanks guys, that's precisely what I was looking for. I've still got the directions grouped so I can turn them on/off if I need to.


Cas