Adding Aliases with a Alias

Posted by Jcet on Thu 07 Jun 2001 04:15 AM — 2 posts, 13,192 views.

USA #0
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.

Australia Forum Administrator #1
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. :)