Jump to content
Elku

ControlSend not working on inactive window

Recommended Posts

Elku

I googled and looked everywhere, couldn't find an answer to this issue. I want to make a macro that works on an inactive (but not minimized) game called Life is Feudal (where the devs have said that macroing is 100% fine).

 

Here is the core of the code;

$winhandle=0
$process= InputBox("Process","Enter the PID")

$Windowlist=WinList("Life is Feudal: MMO")

For $i = 1 to $Windowlist[0][0]
    If WinGetProcess($Windowlist[$i][1])= $process Then
        $winhandle=$Windowlist[$i][1]
    EndIf
 Next

while (1=1)
 Controlsend($winhandle,"","","e")
 sleep(100)
WEnd

Now, this works flawlessly if the game is active, if I alt-tab, it will still try to send "e" to the window (I checked), but the game won't receive it. I've tried all kinds of many but it's just not working. The same code works for pretty much any games I've tried, just not this one, not sure why.

Share this post


Link to post
Share on other sites
Jos

@Elku, Guess you have missed the part where we have changed our forum rules (quite some years ago) and don't allow any topics for game automation anymore.

Please read them now.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.