Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ General
➜ Some useful aliases
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Wed 11 Jun 2003 08:50 PM (UTC) |
Message
| 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 \"(.*?)\" \"(.*?)\" \"(.*?)\"$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>AddAlias "%1", "%2", "%3", 8225, ""</send>
</alias>
<alias
match="^AddTrigger \"(.*?)\" \"(.*?)\"$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>AddTrigger "", "%1", "%2", 25, -1, 0, "", ""</send>
</alias>
<alias
match="^PGag (.*?)$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>AddTrigger "", "*%1*", "", 15, -1, 0, "", ""</send>
</alias>
</aliases>
|
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| David B
USA (80 posts) Bio
|
Date
| Reply #1 on Thu 17 Jul 2003 09:55 AM (UTC) |
Message
| 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 |
My code(with a LOT of Nicks help) to fame:
sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
| Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #2 on Thu 17 Jul 2003 12:02 PM (UTC) |
Message
| Oh, ouch, sorry :)
Just copy everything from <aliases> to </aliases>, go to mushclient's "Aliases" screen, and press the "Paste" button :) |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Morgoth
Israel (38 posts) Bio
|
Date
| Reply #3 on Wed 23 Jul 2003 10:59 AM (UTC) |
Message
| 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #4 on Wed 23 Jul 2003 08:50 PM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Morgoth
Israel (38 posts) Bio
|
Date
| Reply #5 on Thu 24 Jul 2003 05:59 AM (UTC) |
Message
| 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? | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #6 on Thu 24 Jul 2003 07:06 AM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Morgoth
Israel (38 posts) Bio
|
Date
| Reply #7 on Thu 24 Jul 2003 07:53 AM (UTC) |
Message
| If I switch to a different mushclient will my all my triggers/aliases/macros/timers/scripts still work? | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #8 on Thu 24 Jul 2003 07:59 AM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Morgoth
Israel (38 posts) Bio
|
Date
| Reply #9 on Thu 24 Jul 2003 08:51 AM (UTC) |
Message
| |
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #10 on Thu 24 Jul 2003 10:18 AM (UTC) |
Message
| XML - eXtensible Markup Language.
Here is an example, from further up in this thread:
<alias
match="^AddAlias \"(.*?)\" \"(.*?)\" \"(.*?)\"$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>AddAlias "%1", "%2", "%3", 8225, ""</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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #11 on Sun 27 Jul 2003 08:44 PM (UTC) |
Message
| 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 |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| David Berthiaume
(202 posts) Bio
|
Date
| Reply #12 on Fri 23 Sep 2005 06:23 AM (UTC) |
Message
| 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. | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #13 on Fri 23 Sep 2005 06:58 AM (UTC) |
Message
| 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. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| David Berthiaume
(202 posts) Bio
|
Date
| Reply #14 on Fri 23 Sep 2005 07:11 AM (UTC) |
Message
| That still doesn't change the fact that I have no idea what to do. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
35,180 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top