Sign in to follow this  
Followers 0
Harusal

Send Keys to an inactive window

11 posts in this topic

Hey is there a way to send keys to an inactive window? im trying to make a bot for an online game that will kill monsters for them, and let them be browsing the internet or do whatever while the bot kills monsters for them.

Share this post


Link to post
Share on other sites



ControlSend(), use search next time.

Share this post


Link to post
Share on other sites

how would i use that to send keys to inactive window? the game is called knight online it's windows name is Knight OnLine Client can you give me an example on how that would work please?

i don't know if you need this or not but maybe it will help:

Posted Image

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Look in the help file for the parameters for the controlsend command, then plug in.

depending on the client you *may* not be able to

Edited by TheTex

Share this post


Link to post
Share on other sites

i have been trying to figure it out, but it's not working can you give me an example to send the key z please =)

Share this post


Link to post
Share on other sites

I'm an old KO player myself so I know it won't work with ControlSend(), however it works with normal Send() but you can't have the window minimized.

Share this post


Link to post
Share on other sites

I'm an old KO player myself so I know it won't work with ControlSend(), however it works with normal Send() but you can't have the window minimized.

but the game no longer has hack protection so many stuff that didn't work before are working now

Share this post


Link to post
Share on other sites

I havn't played the game for almost two years now but try to send something with ControlSend() and then use AutoIt Window tool to see if you can catch the keystrokes, if they appears as "hidden" nothing has changed for more then two years.

The correct syntax would be ControlSend("Knight OnLine Client", "", "Edit1", "This is some text")

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Posted Image

Hi,

Your window is in flash ?...Never mind, you can just use :

ControlSend("Knight OnLine Client","","","your text")
 $xy=Mousegetpos()
 ControlClick("Knight OnLine Client","","","left",1,$xy[0],$xy[1])

You can of course use others Control functions.

2nd option if you want to write in some edits :

WinActivate("Knight OnLine Client","")
WinWaitActive("Knight OnLine Client","",2)
Send("Text in Edit1")
Send("{TAB}")
Send("Text in Edit2")
Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Hes looking to send keys, not send a string of text to type. Keys = z (target) 1-9 (skills)

edit1 is a notepad control, i do not believe it will work with this game.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Hes looking to send keys, not send a string of text to type. Keys = z (target) 1-9 (skills)

edit1 is a notepad control, i do not believe it will work with this game.

For sendkeys just simply

WinActivate("Knight OnLine Client","")
 WinWaitActive("Knight OnLine Client","",2)
 Send("{1}{2}{3}{A}{B}{C}");.....

If you want to send keys to window always inactive try ControlSend ...

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0