alias and plugin question

Posted by Linoge on Sun 21 Mar 2004 05:56 PM — 2 posts, 10,983 views.

#0
hi, im new to mushclient and was just getting my feet wet
experimenting with plugins. I wrote a plugin that created
an alias which would create other aliases (for different containers, etc..) everthing worked fine, the AddAlias function even returned eOk but the aliases arent being
added to world

my function looked something like this.
a little simplified but i cant get this to
work either.

function SomeFunction()
{
world.AddAlias("", "pup *", "put %1 pack", 1, "");
}

any ideas what im doing wrong?

and one other question is there any built-in way of having the values of variables created in the <script> section of a plugin persist through sessions?

Thanks, Linoge
Australia Forum Administrator #1
Aliases

Your AddAlias should work, it worked for me.

However your alias is added to the plugin, not to the world, so if you look at the world's alias list you won't see it.

Try typing:


/world.debug ("plugins");


That will show what aliases are in your plugins.

If that doesn't work, find out what the return code from the AddAlias is, eg.


world.Note (world.AddAlias("", "pup *", "put %1 pack", 1, ""));


If non-zero, look it up in the error code list to see what is going wrong.

Variables

If you "save state" in your plugins the variables will be saved, eg.


<plugin
   name="whatever"
   ...
   save_state="y"
   ...
   >