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 ➜ General ➜ Adding Aliases with a Alias

Adding Aliases with a Alias

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


Posted by Jcet   USA  (25 posts)  Bio
Date Thu 07 Jun 2001 04:15 AM (UTC)
Message
I'm trying to make a Script(VBS) but i keep running into errors...
All i need, is the Sub to be:
Sub Bot (then whatever here)
and then i need world.addalias...
name: i dont kare
the matchtext: "."
send text: "rocket " and the first wildcard
script to be: OnPk

i just cant figure it out, -_-'
Sorry im kinda new.


-Jcet
See no good, hear no good, be no good, kill all good!
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 07 Jun 2001 06:54 AM (UTC)
Message
There are two things here, one is adding the alias (which makes a new word you can type), and the other is doing something when you type that word.

If you just want to add it once, you may as well do that in the configuration screen, rather than in a script, but if you want to do it in a script do it like this:


world.AddAlias "MyAlias", ". *", "", 1 + 1024, "On_MyAlias"


This will add an alias called "MyAlias".
It matches on: . *
- this means a dot followed by a wildcard
It sends nothing to the world.
It is enabled (1) and replaces any alias of the same name (1024).
It calls the script "On_MyAlias".

Then make a subroutine like this:


sub On_MyAlias (strName, strOutput, wildcards)
world.Send "rocket " + wildcards (1)
end sub


However you don't really need a script for that step either. You can do the whole thing in the alias configuration screen.

Add a new alias - click on "Add" - and enter:


Alias: . *
Send: rocket %1
[/mono/

... and click on OK. That's all there is to it. :)

- 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.


10,461 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.