mob/verb
F5()
set hidden=1
var/Skill2Use=src.HotKeys["F5"];src.UseSkillProc(Skill2Use)
I basicaly have to have that exact same code for keys F5-F8 because from what I've seen theres no way to determine which key was pressed
ID:161426
May 8 2008, 12:20 pm
|
|
is there any way to determine what key was pressed by a user without defining a specific macro for that key? From what I've seen its not. This would be incredibly usefull for setting up in-game hotkeys without having to code the same thing multiple times for multiple keys, and depending on how it worked possibly even for some kind of on-screen/in-game data entry system
mob/verb I basicaly have to have that exact same code for keys F5-F8 because from what I've seen theres no way to determine which key was pressed |
You can take advantage of the fact that macros are just manual calls to the command line. Therefore, you can call a verb and send various arguments. What you can do is define a single verb to handle your set of key macros, and send a different value parameter depending on the key being pressed.
mob/verb You would call this verb by assigning the macro as "hotkey [mycommand]". For example, you could assign F1 to call "hotkey F1", and the verb would be called with the param as "F1". This will allow you to define one central verb to handle your macros, not requiring you to define many verbs for different hotkey commands. |
In response to Unknown Person
|
|
i see, not 100% what i was looking for, but it should work much better then the way im doing it now, thanks =)
|
In response to Falacy
|
|
EH dont move my topic! this is still a feature request!
|
In response to Falacy
|
|
Falacy wrote:
EH dont move my topic! this is still a feature request! What are you requesting? You do realize you can just add macros at runtime yes? So all you have to do is loop through ASCII numbers and do ascii2text() to convert them to a letter. Then make that letter a macro. -- Data |
George Gough