Problem calling script from an alias

Posted by Vink on Sat 03 Nov 2001 08:43 PM — 4 posts, 15,737 views.

#0
in my auto-target setup i an alias

Alias: target *
Send:
Enabled: checked
All other options: unchecked
Label: Target_Alias
Script: OnAliasTarget

and in my script file

sub OnAliasTarget (thename, theoutput, thewildcards)
world.setvariable "target", thewildcards (1)
world.note "Victim set to " & thewildcards (1)
end sub


and another alias

Alias: b
Send: backstab @target
Enabled: checked
Expand variables: checked
All other options: unchecked


when i type "target man"
it should send the message "Victim set to man"
but it does not
when i type "b" it should backstab man, but i get a popup
box that says variable target not defined

why doesn't it work?
Australia Forum Administrator #1
I tried what you did and it worked OK.

Your problem with the second alias is that the first one didn't work and set the variable, why I don't know.

Do you have scripting enabled, and the appropriate script file in the "Script file" box in the scripting configuration tab?
Australia Forum Administrator #2
Also, be cautious when typing in the alias that you don't slip in an extra, unnoticed, space.

For example, this won't work:


target *(space)


or


target(space)(space)*


#3
yep i didn't have scripting enabled, i assumed it was automatically enabled for some reason
*whap me*
thanks nick