ID:139730
 
Code:
client/var/list/Key=list("A", "B", "C", "D", "E")

proc
GenerateKeyMacros(client/C, macro_control="macro")
for(var/v in C.Key)
C.Key[v]=0
winset(C, "[v]_Macro", "parent=[macro_control];name=[v]+UP;command='KeyUp [v]'")
alert(C, "parent=[macro_control];name=[v]+UP;command='KeyUp [v]'")//test...and its there

client/verb
KeyUp(key as text)
set instant = 1
world<<"yea"
if(Key.Find(key))
Key[key]=0
else
return
KeyDown(key as text)
set instant = 1
if(Key.Find(key))
Key[key]=0
else
return

//winset(usr, "myCtrlEmacro", "parent=macro1;name=Ctrl+E;command=exit")
//winget(player, null, "macros") will return the IDs of the macros available in the program, separated by semicolons.


client
New()
..()
GenerateKeyMacros(src, "macro")



mob
verb
Check()
src<<winget(src, null, "macros")
Stat()
..()
statpanel("Checks")
for(var/v in client.Key)
stat("[v] : [client.Key[v]]")


Problem description:

It's suppose to create macros at runtime, i wanted to do something like in Allegro c++ and such but it doesn't seem to be working out, im not sure if its the verb OR the setting of macros, can someone help me?

Hehe, jumped to conclusions, seemed i put a zero in keydown...anyway i solved it thanks to anyone who even though of helping :)