ynglee Posted August 9, 2006 Share Posted August 9, 2006 is it possible to sends simulated keystrokes and mouse clicks to the inactive window? how to perform such action??any1 can give me some clue?? Link to comment Share on other sites More sharing options...
Valuater Posted August 9, 2006 Share Posted August 9, 2006 is it possible to sends simulated keystrokes and mouse clicks to the inactive window? how to perform such action??any1 can give me some clue??is this on the internet? ( or web browser )8) Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 9, 2006 Share Posted August 9, 2006 is it possible to sends simulated keystrokes and mouse clicks to the inactive window? how to perform such action??any1 can give me some clue??Use commands like ControlClick() and ControlCommand(), to access windows that are not active. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ynglee Posted August 9, 2006 Author Share Posted August 9, 2006 game...........exe file is it possible?? just slimply pressing "R" should be fine......then i can do orther thing Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 9, 2006 Moderators Share Posted August 9, 2006 game...........exe file is it possible??just slimply pressing "R" should be fine......then i can do orther thing As PsaltyDS said, look at the Control* functions in the Help File. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ynglee Posted August 11, 2006 Author Share Posted August 11, 2006 (edited) help me Im stuck after going through the help file.... finally my code come out........it working fine..... but got 1 problem......i cant send keystrok F1~F12 i go through help file again...but cant find any cle how to deal wit it can some1 guide me?? =========================================================== AutoItSetOption("WinTitleMatchMode", 4) $handle = WinGetHandle("classname=Sword3 Class", "") If @error Then MsgBox(4096, "Error", "Could not find the correct window") Else ControlSend($handle, "", "", ("m")) EndIf ============================================================= Edited August 11, 2006 by ynglee Link to comment Share on other sites More sharing options...
ynglee Posted August 12, 2006 Author Share Posted August 12, 2006 i already settle the F1~F12 problem help me see tis script: #include <GuiConstants.au3> Opt("GUIOnEventMode", 1) AutoItSetOption("WinTitleMatchMode", 4) $handle = WinGetHandle("EMEI", "") GuiCreate("MyGUI", 128, 212,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Checkbox_1 = GuiCtrlCreateCheckbox("Healing", 10, 10, 110, 60) GUICtrlSetOnEvent($Checkbox_1, "Healing") $Checkbox_2 = GuiCtrlCreateCheckbox("Double Ring", 10, 80, 110, 60) GUICtrlSetOnEvent($Checkbox_2, "DoubleRing") $Button_3 = GuiCtrlCreateButton("Exit", 20, 160, 80, 40) GUICtrlSetOnEvent($Button_3, "Exit1") GuiSetState(@SW_SHOW) While 1 Sleep(100) WEnd func Healing() While 1 ControlSend($handle, "", "", "c") sleep(1000) WEnd EndFunc Func DoubleRing() while 1 ControlSend($handle, "", "", "x") sleep(300) ControlSend($handle, "", "", "z") sleep (400) WEnd EndFunc Func Exit1() Exit EndFunci want to perform such action: when i check checkbox1,itcarry out Action1 when icheck checkbos2,it carry out Action2 when check both out,both olso run what command i need to perform such action?(inned them perform continuely until i press exit i try use [while1....action1.....wend]tomake a loop...but like tat it cant carry out action2 cos cannot jumpout the loop1 im a newbie n not familiar wit the autoit,any help will be appriciated...... Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 12, 2006 Share Posted August 12, 2006 i already settle the F1~F12 problem help me see tis script: i want to perform such action: when i check checkbox1,itcarry out Action1 when icheck checkbos2,it carry out Action2 when check both out,both olso run what command i need to perform such action?(inned them perform continuely until i press exit i try use [while1....action1.....wend]tomake a loop...but like tat it cant carry out action2 cos cannot jumpout the loop1 im a newbie n not familiar wit the autoit,any help will be appriciated...... If I understand what you're trying to do (by no means certain), I don't think you want to try and trigger events off a checkbox. Perhaps your loop could simply continuously check their state? The other problem here is there is no exit from you loop in the functions Healing() and DoubleRing(), but the loops are not needed if you continually check the status of the checkboxes. Both functions will be repeated as long as checked, and will stop when unchecked. Maybe this: #include <GuiConstants.au3> Opt("GUIOnEventMode", 1) AutoItSetOption("WinTitleMatchMode", 4) $handle = WinGetHandle("EMEI", "") GuiCreate("MyGUI", 128, 212,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Checkbox_1 = GuiCtrlCreateCheckbox("Healing", 10, 10, 110, 60) $Checkbox_2 = GuiCtrlCreateCheckbox("Double Ring", 10, 80, 110, 60) $Button_3 = GuiCtrlCreateButton("Exit", 20, 160, 80, 40) GUICtrlSetOnEvent($Button_3, "Exit1") GuiSetState(@SW_SHOW) While 1 If GuiCtrlGetState($Checkbox_1) = $GUI_CHECKED Then Healing() If GuiCtrlGetState($Checkbox_2) = $GUI_CHECKED Then DoubleRing() Sleep(100) WEnd func Healing() ControlSend($handle, "", "", "c") sleep(1000) EndFunc Func DoubleRing() ControlSend($handle, "", "", "x") sleep(300) ControlSend($handle, "", "", "z") sleep (400) EndFunc Func Exit1() Exit EndFunc Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ynglee Posted August 15, 2006 Author Share Posted August 15, 2006 PsaltyDS can u check ur script again??didn't work for me i guess is this part went wrongWhile 1 If GuiCtrlGetState($Checkbox_1) = $GUI_CHECKED Then Healing() Sleep(100) If GuiCtrlGetState($Checkbox_2) = $GUI_CHECKED Then DoubleRing() Sleep(100)WEndcos when i check the box it do nothingthen i try to changeIf GuiCtrlGetState($Checkbox_1) = $GUI_CHECKED Then ControlSend($handle, "", "", "c") sleep(1000)didnt work as well......i look in help file aready, the information about the syntax is so limited Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 15, 2006 Moderators Share Posted August 15, 2006 Are you sure this game even lets you send "simulated" key strokes? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ynglee Posted August 15, 2006 Author Share Posted August 15, 2006 (edited) yup $handle = WinGetHandle("EMEI", "")ControlSend($handle, "", "", "x") sleep(300) ControlSend($handle, "", "", "z") sleep (400)can work Edited August 15, 2006 by ynglee Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 15, 2006 Moderators Share Posted August 15, 2006 yup Then change these 2 lines:If GuiCtrlGetState($Checkbox_1) = $GUI_CHECKED Then Healing() If GuiCtrlGetState($Checkbox_2) = $GUI_CHECKED Then DoubleRing()oÝ÷ Ù:ºÚ"µÍY][ ÕRPÝXY ÌÍÐÚXÚÐÞÌJK ÌÍÑÕRWÐÒPÒÑQ H[X[[Ê BY][ ÕRPÝXY ÌÍÐÚXÚÐÞÌK ÌÍÑÕRWÐÒPÒÑQ H[ÝXT[ÊAnd see if that works. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ynglee Posted August 15, 2006 Author Share Posted August 15, 2006 finaly work fine thanks a lot Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 15, 2006 Moderators Share Posted August 15, 2006 finaly work fine thanks a lot Your welcome, I don't use GUICtrlGetState() often (Never have in fact), maybe if you use GUICtrlRead($CheckBox_1) instead of just $CheckBox_1 it might have worked? I don't know to be honest... I always use BitAnd() personsally. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 15, 2006 Share Posted August 15, 2006 Your welcome, I don't use GUICtrlGetState() often (Never have in fact), maybe if you use GUICtrlRead($CheckBox_1) instead of just $CheckBox_1 it might have worked? I don't know to be honest... I always use BitAnd() personsally.Ouch. Completely missed that! Thanks for the educational correction, SmOke_N! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now