how to make Script that sends keys to program when its minimised

12/06/2014 17:51 dami10678#1
Hi, I would like to make script that will continuosly spam these keys at the same time until i stop E.g. Using these Z+2+space every 0.5 sec all the time until i stop it. But I want to use it on just one program so I can minimise it and for. e.g browse internet and stuff.. I am new person to Auto it so looking for some help from you guys?
Thanks
12/06/2014 18:07 fear-x#2
you can use ControlSend() . read the helpfile
12/06/2014 18:10 alpines#3
You can't send keys to a window which is minimized. Restore it and put it in the background.
12/06/2014 18:13 dami10678#4
Would you guys guide me with how to make it as im newbie..

I tried this but it doesnt work..

AutoItSetOption ("WinTitleMatchMode",2)
While 1
Sleep (2000)
ControlSend ("iMetin.pl","","","{Space}")
ControlSend ("iMetin.pl","","","{2}")
ControlSend ("iMetin.pl","","","{z}")
WEnd

@It works only if i click chat but there are items that are going to be used when it click e.g. 2 and it doesnt click it only do it if i click on chat why?
12/06/2014 22:00 alpines#5
You may press on 2 for a short time. Try something like this
Code:
ControlSend("window", "", "", "{SPACE down}")
Sleep(250)
ControlSend("window", "", "", "{SPACE up}")
12/07/2014 09:40 KDeluxe#6
If you have to press the key for a specific time, you should modify the "SendKeyDownDelay" option.
Code:
Opt("SendKeyDownDelay", 250)