Random Scripting Error

by Talnar

Back to Mechanic's Corner.

Talnar2007-07-18 14:56:11
I have made an alias for Nexus to do the Assault ability in Pureblade. I set that up for a Keybinding. For some reason, I get an error message saying that the script is going wrong. Here's the alias:

CODE
Alias:
Name: assault
Script: assault $target $loc


Any idea what's wrong?
Shiri2007-07-18 14:57:28
Do you actually have a $target and $loc already?

If not, just try (type this in the nexus terminal)
#set target weevil
#set loc head
Unknown2007-07-18 16:05:22
Note, however, and you cannot assault a weevil in this way. wink.gif
Talnar2007-07-18 17:04:37
Well duh. And yes, there are $target and $loc variables already.
Acrune2007-07-18 22:17:22
Will an alias try to call itself if its name is in the alias?
Talnar2007-07-19 01:35:02
Hmm... That might be it. However, I just put the entire script into a Keybinding itself, and that seems to work.
Unknown2007-07-19 14:55:43
QUOTE(Talnar @ Jul 18 2007, 08:35 PM) 426849
Hmm... That might be it. However, I just put the entire script into a Keybinding itself, and that seems to work.


Seems like having the alias name inside of the alias would create an infinite loop. I don't know nexus programming very well, but I'm assuming there is no easy escape character. Changing the name of the alias should take care of it for you, or (like you said) put it directly in the keybinding. The downside of the second solution is that you can never execute the script in any other way. That shouldn't matter too much for an offensive script, but just as a practice I avoid putting too much directly in macros/keybindings. I like having them call aliases instead.
Unknown2007-07-19 19:19:58
Doesn't Nexus have a #SEND command you can use to get around the infinite loop situation in a case like this?
Talnar2007-07-22 19:05:16
Don't think so, no.
Unknown2007-07-23 01:47:12
Talnar2007-07-25 01:20:55
By golly, we do! Gee! That's keen!