CyberDrag0n Posted January 4, 2007 Posted January 4, 2007 I'm just a beginner for autoit. I found this program very useful so I begin to learn. My problem is I use controlsend command to target a window but it dont work when I minimize or click another window. Hero is my simple script. Pls advice and guide...thanks WinExists("Water Margin Online") While 1 ControlSend("Water Margin Online", "", "", "{F9}") Sleep (4000) ControlSend("Water Margin Online", "", "", "{F3}") Sleep (1500) ControlSend("Water Margin Online", "", "", "{F1}") Sleep (30000) ControlSend("Water Margin Online", "", "", "{F3}") Sleep (1500) WEnd My simple noob bot, hehe!
Zedna Posted January 6, 2007 Posted January 6, 2007 instead ControlSend("Water Margin Online", "", "", "{F9}")oÝ÷ ÚÚòjëh×6Send("Water Margin Online", "", "{F9}")oÝ÷ Úâ*.¬*'¶º%Iéݲü¢{k¢Rjëh×6ControlSend("Water Margin Online", "", "ControlID here", "{F9}") Resources UDF ResourcesEx UDF AutoIt Forum Search
CyberDrag0n Posted January 8, 2007 Author Posted January 8, 2007 But the game don't have a ControlID Press CTRL-ALT-F to freeze the display. >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: Water Margin Online Class: Darkstar Window Class Size: X: 611 Y: 83 W: 646 H: 512 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Screen: X: 779 Y: 103 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0x0164F9 Dec: 91385 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: Control ID: ClassNameNN: Text: >>>>>>>>>>> Status Bar Text <<<<<<<<<<< >>>>>>>>>>> Visible Window Text <<<<<<<<<<< >>>>>>>>>>> Hidden Window Text <<<<<<<<<<< I know the command Send but I want to send commands to the game (minimized) while I'm browsing with my IE. My friend used autoit (older version) to created an exe like macro and it work well also when then window is minimized but he refuse to tell me the source I hope that some one could guide me here ... Thanks in advance
someone Posted January 8, 2007 Posted January 8, 2007 Not sure if this would give you anything but have you tried WinGetHandle to give you the control ID of the game window? While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
CyberDrag0n Posted January 11, 2007 Author Posted January 11, 2007 Can you teach me how can WinGetHandle to give me the control ID of the game window and ControlSend command to the window because all the help file show is this: ; Identify the Notepad window that contains the text "this one" and get a handle to it ; Change into the WinTitleMatchMode that supports classnames and handles AutoItSetOption("WinTitleMatchMode", 4) ; Get the handle of a notepad window that contains "this one" $handle = WinGetHandle("classname=Notepad", "this one") If @error Then MsgBox(4096, "Error", "Could not find the correct window") Else ; Send some text directly to this window's edit control ControlSend($handle, "", "Edit1", "AbCdE") EndIf Thanks...
someone Posted January 12, 2007 Posted January 12, 2007 (edited) I have to say I haven't ever used autoit in a game so I might be missing something but this code below works as far as getting a window's handle and using it in controlsend... Run("notepad.exe") WinWaitActive("Untitled - Notepad", "") $handle = WinGetHandle("Untitled - Notepad", "") If @error Then MsgBox(4096, "Error", "Could not find the correct window") Else ControlSend("Untitled - Notepad", "", $handle, "Sending text to control ID of notepad") EndIf Hopefully that helps you out! Andrew Edited January 12, 2007 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
Joon Posted January 12, 2007 Posted January 12, 2007 (edited) Some games go to PAUSE state if it loses the focus. Edited January 12, 2007 by Joon
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