Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, 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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Tips and tricks ➜ Alias editing with aliases?

Alias editing with aliases?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by PJ   USA  (48 posts)  Bio
Date Sat 19 Oct 2002 05:10 PM (UTC)
Message
I'd like to use an alias such as 6 to edit an alias that I have...

("Macro_F6+++" is an alias I have and it sends "Bash @Target", @Target comes from a script I have.)

I want to be able to edit the alias "Macro_F6+++" to change the word Bash to Bodyslam or anything else I want by using an alias where I type in "6 Bodyslam"

Simplifying that:
I want alias "6 *" to change the alias "Macro_F6+++" From "Bash @Target" to "* @Target"

Is that possible?
Top

Posted by Magnum   Canada  (580 posts)  Bio
Date Reply #1 on Sat 19 Oct 2002 09:23 PM (UTC)

Amended on Sun 20 Oct 2002 07:27 AM (UTC) by Magnum

Message

Sub ConfigureF6 (AliasName, AliasLine, arrWildcards)
   World.AddAlias "OnKeypressF6", "OnKeypressF6", arrWildcards(1) & " @Target", 1569, ""
End Sub

Create an alias, called "6 *", and configure it to call that subroutine. (In the box labelled "script", put "ConfigureF6").

Under General Configuration, Input, Macros ... configure the F6 key to send "OnKeypressF6".

When you press the key, it will call the alias also named "OnKeypressF6", which will send the line you want.

Hey! Trick question. I just looked, and you can not configure F6 for some reason. ...Well, you can change the macro key to what you want, and edit the stuff I said accordingly.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by PJ   USA  (48 posts)  Bio
Date Reply #2 on Sat 19 Oct 2002 10:16 PM (UTC)
Message
Sorry, i should have explained a little more, my macro F6 is set to output "Macro_F6+++" which in turn is an alias that sends Bash @Target. Target is a variable from a script which i got help on earlier to solve a PKing problem. So what i was wondering is if there was a way to change the word Bash to * by using another alias where i type 6 *.. Is this possible with or without adding more variables?

Sorry for any redundancy, couldnt see what i'd already said.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 19 Oct 2002 10:39 PM (UTC)

Amended on Sun 20 Oct 2002 01:55 AM (UTC) by Nick Gammon

Message
I would make your "alias changing alias" delete the existing one and re-add it. Something like this:


sub ChangeAlias (sName, sLine, wildcards)
  world.deletealias "myalias"
  world.addalias "myalias", "Macro_F6+++", wildcards (1) + " @Target", 512 + 1, ""
end sub


I haven't tested it, but it is the general idea.

(The 512 above is "expand variables", the 1 is "enabled").

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by PJ   USA  (48 posts)  Bio
Date Reply #4 on Sun 20 Oct 2002 04:16 AM (UTC)
Message
I dont quite get what i'm supposed to do..
So I add that all to my script and have the macro call it?

I went ahead and tried that but it didnt work... Otherwise i'm lost
Top

Posted by PJ   USA  (48 posts)  Bio
Date Reply #5 on Sun 20 Oct 2002 04:17 AM (UTC)
Message
err, alias, i meen...
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #6 on Sun 20 Oct 2002 06:52 AM (UTC)
Message
I would make an alias:

6 *

This alias calls that subroutine. If you aren't sure what is happening, put a world.note in the sub, eg.

world.note "alias called with wildcard " + wildcards (1)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Magnum   Canada  (580 posts)  Bio
Date Reply #7 on Sun 20 Oct 2002 07:26 AM (UTC)
Message
Quote:

I would make your "alias changing alias" delete the existing one and re-add it. Something like this:

sub ChangeAlias (sName, sLine, wildcards)
  world.deletealias "myalias"
  world.addalias "myalias", "Macro_F6+++", wildcards (1) + " @Target", 512 + 1, ""
end sub


From: http://www.mushclient.com/scripts/function.php?name=AddAlias
Quote:

const eEnabled = 1 ' enable alias
const eIgnoreAliasCase = 32 ' ignore case when matching
const eOmitFromLogFile = 64 ' omit this alias from the log file
const eAliasRegularExpression = 128 ' alias is regular expressions
const eExpandVariables = 512 ' expand variables like @direction
const eReplace = 1024 ' replace existing alias of same name
const eAliasSpeedWalk = 2048 ' interpret send string as a speed walk string
const eAliasQueue = 4096 ' queue this alias for sending at the speedwalking delay interval
const eAliasMenu = 8192 ' this alias appears on the alias menu
const eTemporary = 16384 ' temporary - do not save to world file

I chose (From the bottom up):

Replace   :  1024
Expand    :   512
IgnoreCase:    32
Enabled   :     1
-----------------
Total     :  1569

Heh... Made a mistake in addition the first time, I put 1570. Doh!

Anyway, Nick, I thought the "replace" value would make the need to delete the old alias unnecessary.

Monkey:

After adding the subroutine, create an alias to call the new subroutine. You have indicated you want the new alias to be "6 *".

Alias Match: 6 *
Enabled    : Checked.
Label      : Configure_F6
Script     : ChangeAlias


Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #8 on Sun 20 Oct 2002 07:47 AM (UTC)
Message
Quote:

Anyway, Nick, I thought the "replace" value would make the need to delete the old alias unnecessary.



Quite right, I was asleep when I wrote that. :O

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


28,588 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.