binding several lines of text via SetAliasOption to the "send" field

Posted by Viper2003 on Wed 11 Feb 2004 05:41 AM — 3 posts, 14,487 views.

#0
I was wondering if anyone knew how to bind multiple lines to the send field of an alias on the fly.

Basically I have an alias labelled "numpad5" which I have bound to that location on the keyboard. Everytime I enter a new area that I have a predefined alias to, I rebind this alias to a new line of text such as:

/world.SetAliasOption("numpad5", "send", "k ant");

So I can navigate the area and attack mobs with ease by using the numeric keypad.

However, I would also like to be able to rebind this alias for multiple lines so I could for example cast a spell as well. So the send field would contatin something like:

k ant
cast magic misile ant

But I do not always want this alias to contain more than 1 line of text.

One work around I worked out was setting a target variable and retrieving the contents of this variable and instead having the contents of the variable change but not the alias itself.

Is there anyway to insert newlines into an alias send field via SetAliasOption?

Newlines seem to work in AppendToNotepad eg:

world.AppendToNotepad("Tell Monitor", theoutput + "\r\n");

but not in SetAliasOption:

world.SetAliasOption("numpad5", "send","kill blah\r\nr blah");

and instead it appears all on the same line when I check the alias:
kill blahr blah
Amended on Wed 11 Feb 2004 05:43 AM by Viper2003
Australia Forum Administrator #1
You have found a bug in SetAliasOption that will be fixed in version 3.44, being released in a few days probably.

For the time being, use your idea of the variable, or just wait for the new version.

A similar bug applies to SetTriggerOption and SetTimerOption.
Australia Forum Administrator #2
Another work-around would be to do this:

Set the "send" to:

Send "kill blah" & vbCrLf & "r blah"

Then set the alias to "send to script", ie.

SetAliasOption "numpad5", "send_to", "12"



(edit)

Sorry, this is JScript not VBscript, so it would be a bit different, like:

world.SetAliasOption ("numpad5", "send", "Send (\"kill blah\\\\nr blah\");");

The heap of backslashes are there to stop the \n becoming a \n until the right moment.

I typed that in the command window, in a script you can probably reduce them from 4 to 2 backslashes, but I would experiment.

Then, in Jscript the other line becomes:

SetAliasOption ("numpad5", "send_to", "12");