Keypad and Variables

Posted by Aheram on Mon 27 Dec 2004 04:17 PM — 3 posts, 14,924 views.

#0
I have set my the * in my Keypad to "glance at $target" ("$target" is from the MUD's own variable program). Is there a way of doing this on MUSH client? I notice that Keypads do not Expand Variables.
USA #1
You use the keypad (or any other macro) to send an alias, which can either be one you use often (like "gt" or something that you might actually use as a normal alias) or something that you probably wont have a collision with (like "asdkjdflkajafdsf", or if youre really worried about it, generating a unique ID for it, you could probably even use KeypadAsterisk so that you'd know what it was).

Then you can do whatever you'd like (scripting, expanding variables) via the alias.
Australia Forum Administrator #2
This comes up so often I have added a new menu command "generate unique ID". This lets you generate one of those random words without needing any scripting.

eg.

I use that to get a string like "b50c88e5f4deaf46cf7ad818".

Make your keypad send that.

Then make an alias to match on "b50c88e5f4deaf46cf7ad818". In the alias you can do:


glance at @target


Note the @ sign not the $. Then check "expand variables" in the alias. Then whatever is in the "target" variable will be sent. You can set up variables with another alias, or simply through the variable configuration screen.