I'm attempting to create events programatically (keypresses & mouse clicks) but not having any success.
My thought is that this code should create a new mouse event where location (30,30) is left clicked which should move the ego to that location:
(if(Said('look'))
(= hEvent Event:new())
(send hEvent:
type(evMOUSEBUTTON)
x(30)
y(30)
modifiers(512) // 512 left click, 515 right click
claimed(FALSE)
)
(super:handleEvent(hEvent))
)
But it's not working, nothing seems to happen. I've got it placed in a template game in the Rm001 script.
Here's a simpler event that should fire a keyboard event (ALT-M) and trigger the easy-alt debugging that displays the available memory, but doesn't work either:
(send hEvent:
type(evKEYBOARD)
message($3200)
claimed(FALSE)
)
Is this even possible to do? I suspect that I'm creating the event properly, but maybe the handleEvent call is incorrect?