Some useful aliases

Posted by Poromenos on Wed 11 Jun 2003 08:50 PM — 15 posts, 51,398 views.

Greece #0
I wrote some useful aliases i thought you people might want.

AddAlias adds an alias, takes 3 parameters, one for alias name, one for text to match and one for text to send. Also puts it on the aliases menu.
AddTrigger adds a trigger, accepts two parameters, one for text to match, and one for text to send
PGag gags lines, accepts one parameter for the text to gag

<aliases>
<alias
match="^AddAlias \&quot;(.*?)\&quot; \&quot;(.*?)\&quot; \&quot;(.*?)\&quot;$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>AddAlias &quot;%1&quot;, &quot;%2&quot;, &quot;%3&quot;, 8225, &quot;&quot;</send>
</alias>
<alias
match="^AddTrigger \&quot;(.*?)\&quot; \&quot;(.*?)\&quot;$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>AddTrigger &quot;&quot;, &quot;%1&quot;, &quot;%2&quot;, 25, -1, 0, &quot;&quot;, &quot;&quot;</send>
</alias>
<alias
match="^PGag (.*?)$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>AddTrigger &quot;&quot;, &quot;*%1*&quot;, &quot;&quot;, 15, -1, 0, &quot;&quot;, &quot;&quot;</send>
</alias>
</aliases>
USA #1
3 wonderful things, I'd love to use them, but I don't have the slightest idea what to do with what you've posted
Greece #2
Oh, ouch, sorry :)
Just copy everything from <aliases> to </aliases>, go to mushclient's "Aliases" screen, and press the "Paste" button :)
Israel #3
Well I stumbled across this.....I thought it could help me quite a bit...so would you mind telling me how to put these aliases in? as I can't seem to do it. I tried pasting it in the notepad "aliases" document but that didn't work too well. So what do I do?
thanks in advance.
Australia Forum Administrator #4
If you copy from - and including - everything from:

<aliases> ... </aliases>

and then go into the configuration screen which shows the list of aliases, there is a button there marked "paste" that should become active. Click on that button.
Israel #5
Ok thanks Nick, however when I do this I get:

Line 6: Attribute not used: send_to="12" (alias)
Line 8: Attribute not used: sequence="100" (alias)
Line 16: Attribute not used: send_to="12" (alias)
Line 18: Attribute not used: sequence="100" (alias)
Line 26: Attribute not used: send_to="12" (alias)
Line 28: Attribute not used: sequence="100" (alias)
Line 6: Attribute not used: send_to="12" (alias)
Line 8: Attribute not used: sequence="100" (alias)
Line 16: Attribute not used: send_to="12" (alias)
Line 18: Attribute not used: sequence="100" (alias)
Line 26: Attribute not used: send_to="12" (alias)
Line 28: Attribute not used: sequence="100" (alias)
Line 6: Attribute not used: send_to="12" (alias)
Line 8: Attribute not used: sequence="100" (alias)
Line 16: Attribute not used: send_to="12" (alias)
Line 18: Attribute not used: sequence="100" (alias)
Line 26: Attribute not used: send_to="12" (alias)
Line 28: Attribute not used: sequence="100" (alias)


So what do I have to fix?

P.S: How exactly do I use the aliases?
Australia Forum Administrator #6
Messages like that indicate you have an older version of MUSHclient. It is saying it doesn't know what to do with some of the fields you are pasting in.

As for how to use them, Poromenos would be the best to answer that, but his original post gave some pretty big clues.
Israel #7
If I switch to a different mushclient will my all my triggers/aliases/macros/timers/scripts still work?
Australia Forum Administrator #8
Each version should be backwards-compatible - that is, it should be able to read old world files. Sounds like your older version isn't that old if it understands the XML-style world files.

However a good general principle is to back up (eg. copy to another directory) all your world files before upgrading. If you decide you don't like it, just copy them back. In any case you would test a single world first, before converting all of them (just loading and saving would convert them).

The XML-style world files are designed to be forwards and backwards compatible anyway, however obviously some things (like send_to="12" ) will not be understood by earlier versions. However it should fail fairly gracefully in these cases.
Israel #9
*blush*. What is XML?
Australia Forum Administrator #10
XML - eXtensible Markup Language.

Here is an example, from further up in this thread:

<alias
match="^AddAlias \&quot;(.*?)\&quot; \&quot;(.*?)\&quot; \&quot;(.*?)\&quot;$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>AddAlias &quot;%1&quot;, &quot;%2&quot;, &quot;%3&quot;, 8225, &quot;&quot;</send>
</alias>

It is like HTML, in a way. You have "tags" like:

<alias> ... </alias>

Tags can be nested. They can have attributes, eg.

<alias match="foo"> <send> bar </send> </alias>

It is extensible because you can fairly easily add new attributes without breaking the general file organisation.
Greece #11
As I mentioned above, you should use them like this:
AddAlias "<alias name>" "<text to match>" "<text to send>"
E.g. AddAlias "myAlias" "hello" "say hi"
AddTrigger "<text to match>" "<text to send">
E.g. AddTrigger "hello" "say hi"
PGag <text to gag>
E.g. PGag Poromenos
#12
Ok... Basically, I'm stumped. I've always been stumped when it comes to scripting AddAlias

I want to script an alias.

Call it:
kame

I want it to send to the mud:
kame

Then i want it to destroy itself, and recreate another alias called:
kame

I want it to send to the mud:
Kame @Attacker

Then I want it to destroy itself and recreate the original alias.
USA #13
If it were me, I wouldn't use addalias, I'd just modify the alias to suit your needs (you can use SetAliasOption to change the send text).
Or set a variable and have it check the variable (and then do the first, or the second).
Or set two aliases and have them enable the other and disable themselves.

Doing that is lots more efficient than deleting/creating aliases, and there's really no need to add an alias (which you might have to add, and then set options, as there are some things you can't set with addalias) if you don't need to.
#14
That still doesn't change the fact that I have no idea what to do.