RE: [Help] MS Agent catching clicks
deAd sort of explained why this works.
The thing is, the JScript parser that runs the code will create the functions and event functions before it makes the objects and does the rest of the code, so when it sees "function agent::Click" (ie. the event "Click" for the object "agent") it hasn't made the agent object, so it would complain that it is undefined. However, if you put the function inside a variable, it's ignored and the event function isn't defined until you call the variable. (The "Clicked();" bit) And when you call the variable, it should be after the agent object is made, so it will understand it and not say it's undefined.
And according to the agent documentation those variables are what you said, yeah. Though I don't think fwKeys is just the shift key, I think it has numbers to represent other keys like ctrl and such. Can't remember where I saw that now though.
|