Question is to do with attaching to the game.
If I don't attach MM and I just click the game to give it focus then keyboard presses work fine.
Code: Select all
keyboardPress(key.VK_9)
So I am trying to attach MM to the game and hopefully the keypresses are only done in the game.
I have been trying different things and they all seem to print that MM is attached to the game but the keypresses arn't done anymore even when I click the game and give it focus. It still recognizes when I do keypresses in game though.
Code: Select all
local windowList = findWindowList("Grand Fantasia", "DJO_CLASS");
print(windowList[1])
if( #windowList == 0 ) then
print("You need to run GF first!")
end
function getWin()
if( __WIN == nil ) then
__WIN = windowList[1]
end
return __WIN;
end
attach(getWin())
print(getAttachedHwnd())
Anyway so it prints
Code: Select all
Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and load a new script.
-------------------------------------------------------
263534
263534
So if game isn't attached then the keypresses are fine, if game is attached then it doesn't work.
I came across this while doing some searching.
So I'll just assume for now I haven't actually done anything wrong and that in order for the keypresses to work when attached it may need to be recoded to suit this game.Check the log to see if attach() failed. Try also running it in un-attached mode (but this requires the game window to be focused) to see if the key presses go through. Every game is programmed differently, and so it is impossible to write one function that works on everything. This game just seems to not use the normal input queue, and, instead, uses it's own. This prevents MicroMacro from jamming false key presses into the queue.
Not huge a priority for me, I was hoping I just did something incorrect and was an easy fix lol
I'll try changing the key delay and see how that goes.