Aliases for Mushclient

by Ethelon

Back to Mechanic's Corner.

Ethelon2005-03-04 19:38:46
Ok, seems the free system was a big hit, but now I've got constant emails/PMs/IMs asking questions on how to set aliases and such, so I've started this thread. Any of the other old Mushclient users, please feel free to help and list tips you may have here aswell for all the new Mush users.

To start out, I will list the steaps to making a simple alias to do something to your target. We will use web for this one, seeing as how it's so common.

1) Use "Shift+Ctrl+9" to open up the alias screen and Click the ADD button, this will open up a new alias box.

2) In the Alias line type: web

3) In the Send box type: abjure web @target

4) Along the left side of the alias you will see a row of boxes, Click the one labeled EXPAND VARIABLES. That's it, now whenever you type "web" you will web your target, if you have the skill of course.

It should look like this:


The "@" symbol is what calls a variable, so if for instance you have a variable called minion and wanted to call it into your alias/trigger you would then use "@minion" and click the EXPAND VARIABLES box.
Unknown2005-03-04 19:52:15
Here's the tip I posted over in another forum:

If you want to setup an alias to do something general and then have a few specific cases (e.g., affliction tracking or curing), make use of the regular expressions and the sequence number for your aliases.

1. Setup an alias to accept any affliction as a single word. Use the pattern "^afflicted (?P\\w+)$" which will not only match your call, but also store your passed affliction in the % pattern variable. (I find naming matches in patterns helps keep things easier to read and aligned when I later change the pattern with more () matches.) Set the sequence number for this general to alias to 100, so it will be the last to execute. Inside, do whatever you like to track the affliction: set a variable, call a script function, print a message, etc.

2. Setup another alias that will handle a specific affliction and print a warning, enable/disable some other trigger, etc. Have this match on a more specific affliction word, such as "^afflicted paralysis$" and set the sequence number to something less than 100 (90 is good), so that it will fire before the general alias. If this override alias does all the handling/curing/whatever, you don't need the "keep evaluating" option. If you're just echoing a colored warning or something along those lines, you should check "keep evaluating" to allow the generic alias catch it and track it, too.

Another use for this method is overriding, temporarily, some alias. Say you wanted to have two aliases that heal any afflictions you have, one for when you are aeoned and one when you aren't. Give them both names (not the pattern, but the label) and disable the aeon healing one by default. When you are aeoned, enable the aeon healing (which would be a lower sequence number and not have "keep evaluating" checked, ideally) to process your curing. When aeon is cured, disable this special alias and allow the curing to return to normal. This way your triggers and aliases don't really need to know which one is doing the curing.
Yrael2005-03-05 23:03:36
I cant use Ethelon's system, because I cant lay hands on it, but I can try and transplant my system over to it. What is the equivalent of ZMUD's #wait command, and does it still work in milliseconds?
Eldanien2005-03-06 18:49:11
The best way I can figure to perform fine-granularity delayed actions is to create a timer, and enable/disable the timer when you need to use it. The granularity of timers in MUSHclient can be set in preferences, down to one tenth of a second.

Basically, call an alias, passing the delay amount and action.

delay 50 touch dairuchi

The 'delay' alias will call a script that enables a timer you've created and stores the action in a variable. When that timer hits, have the function the timer calls send that action variable to the client. IE, World.send MyDelayedAction.

That's the really basic gist of it. If you can't figure it out from there, ah, ask someone else. =P

I have to say though, delayed actions like that tend to indicate poor design. The only timer I would suggest is one that hits your cure and sip functions, which individually verify need.

What task exactly are you trying to accomplish?
Yrael2005-03-06 22:12:24
Mainly? So I can whack together a defev alias. Heh. That, and a parser character (Like ZMUD's ; character) would be nice..
Eldanien2005-03-07 14:40:50
A parser character? You mean putting multiple commands in one line?

I use a semi-colon in MUSHclient. You can set your choice in preferences, but I think the default is the semi-colon.

For defs, I do things a bit differently. I track eq/balance (amongst lots of other things), and track (trigger when I call DEF) which defenses I have and don't have. I then call an alias 'defup', which fills in what I'm missing.

def
wait
def
wait
def

is what you're trying to do, right? If I could suggest, try changing the way you do it to how I suggested. Your defup process will be faster, and not prone to screwing up due to lag.

If you really want to do the def/wait/def method, then create a timer that fires every 1/10th of a second, have it call a function that increments a variable. When you call your DEFUP alias (or whatever you've named it), have it enable the timer. The function your timer calls should, when that variable hits certain values, world.send whatever def command you want. At the end, have the function disable the timer, so it doesn't keep running and eating resources.
Trelian2005-03-13 20:54:27
I'm workin on usin mushclient, but i can't get a targetting alias, anyone know how to set one up? Yes, I am stupid, thank you very much. doh.gif
timsae2005-04-10 05:16:17
Is it possible to expand variables at the command line? (ie. p @pipe1 or sip @manavial)
Unknown2005-04-10 12:43:32
QUOTE(Trelian @ Mar 13 2005, 03:54 PM)
I'm workin on usin mushclient, but i can't get a targetting alias, anyone know how to set one up? Yes, I am stupid, thank you very much. doh.gif
72386



Copy this and paste it into your aliases dialog:

CODE

match="^t (.+)$"
enabled="y"
variable="target"
send_to="9"
sequence="100"
>
%1



Use it with "t thing_you_want_to_target" and it'll send it to your "target" variable.
Laysus2005-04-10 23:48:17
it possible to actually put that in at the alias window or something similar so I can learn how to do similar stuff in the future? tongue.gif
Laysus2005-04-10 23:55:46
also, got a small problem where my aliases aren't actually being used, just any input I put in is going straight through to the game :/
Unknown2005-04-11 00:36:32
If you want to create a targetting alias using the "Add Alias" dialog-type thing, here's the settings I recommend:

Alias: ^t (?P(\\d|\\w)+)$
Send: %
Send To: Variable
Variable: target

Checked: Enabled, Regular Expression

Everything else can be unchecked and the Label/Group are optional. I like to use named parameters in my regular expressions to keep things easier to read in my scripts, and it helps keep them "aligned" if I add captures to the alias/trigger later on for whatever reasons. You can read more about how to use the (?P) syntax in the MUSHclient PCRE docs.
Trelian2005-06-29 09:39:07
Thanks guys, I figured most of it out. Just one last thing I need to figure out, like with Ethelon's system, how did you get the status bar going? Like with zmud, you can customize it pretty easily...It's a bitch here lol
Unknown2005-06-29 13:51:22
It is a bit of a pain to use the status bar or the info bar in MUSHclient, but Nick is set against adding too much GUI stuff and slowing down the client.

Look for the 'Info(blah)' or 'Status(blah)' functions in the list of functions (found in the MC help files). You have to clear the info bar to update items and then re-add everything.
Diamante2005-06-30 00:07:38
Hey Ethelon whats your targetting alias thing I wanna use it for a differnt realm