ID:157143
 
How would I go by clicking on a skill and a text box pops up and I enter a macro that will allow me to use that skill.

Example: I Click on Blast, text box pops up. And I type in A. Now everytime I press "A" it will use Blast.

How would I go on by doing something like that?
And also how could I limit it to lets say only "A,S,D,F"?
Or something in that area?

I would imagine it being something like

mob/verb/test()
usr.test2=input("Type in either A,S,D or F in box"," Macro") as text
if(usr.test2=="A")
//Do whatever here...

Again I don't really know how I would do this which is why I'm kinda asking...
Also I would like it to work with Multiple Skills.
Is it possible to do it without the skills sharing same name or whatever????
I love how my question is skipped >.>
In response to Isenggard
let's see.. I'm not quite sure on how to do these kinds of things but.

This might help you along.

http://www.byond.com/ members/?command=reference&path=client%2Fvar%2Fscript%2Fmacr o

And as for the restriction of keys.
var/list/L = list("a","s","d","w")

obj/blast
icon = 'Blastskill.dmi' // or w.e
Click()
var/newmac = input("Select either A,S,D or W as a macro","Macro") as text
if(newmac in L)
// do changestuff here.
else
// do "not valid key" stuff here.
return
In response to Zeppo
Okay the restrictions I appreciate the help with that. But the link.... It's something I already read. That doesn't really help me with using the verb?

how would I go by assigning the A,S,D and W as macros?
I can easily do it in the interface but how would I go by adding commands do the macro which can be used to use the skill or any other skill that is placed with that macro?
In response to Isenggard
In response to Zeppo
I know how to use macros. But I just need to know how to assign the macro different verbs.
like how would i go by using skills with a common verb or proc like

obj/skill
proc/test()
blast
test()
usr<<"Bam"
In response to Isenggard
Not sure i know what you're getting at but. as it said in the link i gave you.

"A new macro can be added to a macro set at runtime by including a parent parameter, which points to the ID of an existing macro set. Using the example above, Ctrl+E could be added as a macro at runtime like so:

winset(usr, "myCtrlEmacro", "parent=macro1;name=Ctrl+E;command=exit")"

Macros that were added this way can also be deleted again by setting their parent to a blank value.

winset(usr, "macro1.myCtrlEmacro", "parent=").

mob/var/list/macos = list()

mob/verb/Set_Macro()
var/macroname = input("name the macro") as text
usr.macos.Add(macroname)
var/command = input("The command verb") as text //ex. "Say","Punch","Train","Rest" etc..
var/key = input("key to execute with") as text // wsad?
winset(usr,"[macroname]","parent=macro;name=[key];command=[command]")

mob/verb/change_makro(var/a in macos)
winset(usr, "macro.[a]", "parent=") //delete the old one
usr.macos.Remove(a)
var/macroname = input("name the macro") as text//make a new one
usr.macos.Add(macroname)
var/command = input("The command verb") as text
var/key = input("key to execute with") as text
winset(usr,"[macroname]","parent=macro;name=[key];command=[command]")

Now this is just out of my head and i haven't tested it.
In response to Zeppo
Thanks for continuously helping me =D that's mighty nice of you, but I solved it =P