Hi I want to set an Accelerator so I can press say keypad9 and have it attack my Variable "target". Does anyone know how I'd go about doing this?
Help using variable in Accelerator
Posted by Yoshtodd on Sat 05 Nov 2005 12:26 AM — 2 posts, 12,193 views.
To add such an accelerator in Lua scripting I did this in the command window:
The initial "/" is the scripting prefix, you wouldn't use that if it was in a script file (eg. for the World Open callback).
When Numpad9 is pressed the above sends:
In other words, it make a script call to send the word "attack" followed by the current contents of the variable "target". Note the single quotes because the whole thing is inside double quotes when we add the accelerator.
For the various key names, see:
/Accelerator ("Numpad9", "/Send ('attack ' .. GetVariable ('target'))")
The initial "/" is the scripting prefix, you wouldn't use that if it was in a script file (eg. for the World Open callback).
When Numpad9 is pressed the above sends:
/Send ('attack ' .. GetVariable ('target'))
In other words, it make a script call to send the word "attack" followed by the current contents of the variable "target". Note the single quotes because the whole thing is inside double quotes when we add the accelerator.
For the various key names, see:
http://www.gammon.com.au/scripts/doc.php?function=Accelerator