RiCK_420_333 Posted April 30, 2008 Posted April 30, 2008 I need to get the chatroom text from the stickam chatroom Music Chat(a link to my chatroom is provided here: http://www.HeavensDaemon.com/MusicChat.php )I want to be able to retrieve the text sent to the room, so I can use it for various actions. Global $WindowTitle = "http://www.stickam.com - Chatroom - Music Chat - Mozilla Firefox" ;Global $WindowClass = "MozillaWindowClass5" Global $WindowClass = "[CLASSNN:MozillaWindowClass5]" Global $WindowHandle Global $TheText Func Start() $StatusCheckBox1 = GUICtrlRead($CheckBox1) $StatusCheckBox2 = GUICtrlRead($CheckBox2) $StatusCheckBox3 = GUICtrlRead($CheckBox3) GUISetState(@SW_HIDE) WinSetState($WindowTitle, "", @SW_MINIMIZE) sleep(1333) WinSetState($WindowTitle, "", @SW_RESTORE) sleep(1333) WinActivate($WindowTitle) sleep(3333) WinWaitActive ($WindowTitle) If $StatusCheckBox3 = 4 Then _Say('Program is now running!') ;ControlGetHandle("Title", "", "[CLASSNN:Edit1]") ;$WindowHandle = ControlGetHandle($WindowTitle, "", $WindowClass) $TheText = ControlGetText($WindowTitle, "", $WindowClass) ConsoleWrite($TheText) If $StatusCheckBox3 = 4 Then _Say($TheText) MsgBox(0, "Text read was:", $TheText) EndFuncAny help or suggestion will be very much appreciated!! Thank you all!!~RiCK
Draygoes Posted April 30, 2008 Posted April 30, 2008 Might I ask why you need this? Please do not see me asking this as an insult, but a lot of people are into making bots these days, and we cannot be to careful. Reveal hidden contents "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.
James Posted April 30, 2008 Posted April 30, 2008 You need to look at the IE.au3 functions. AutoIt cannot directly read text from a web browser. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
RiCK_420_333 Posted April 30, 2008 Author Posted April 30, 2008 Well I know in Visual Basic 6.0 I would have used: FindWindow & FindWindowEx Is there an Autoit equivalent to those? I can get the Hwnd of the main window, now I just need to find the hwnd of the edit control and the one where it shows what people have typed.
RiCK_420_333 Posted April 30, 2008 Author Posted April 30, 2008 Func Start() $StatusCheckBox1 = GUICtrlRead($CheckBox1) $StatusCheckBox2 = GUICtrlRead($CheckBox2) $StatusCheckBox3 = GUICtrlRead($CheckBox3) GUISetState(@SW_HIDE) WinActivate($WindowTitle) $WindowHandle = WinGetHandle("http://www.stickam.com - Chatroom -", "") MsgBox(0, "Window Handle:", $WindowHandle) $WindowTitle = ControlGetText("", "", $WindowHandle) MsgBox(0, "Window Title", $WindowTitle) ; Down to this point I have successfully found my main windows handle, and also retrieved it's full title dynamically. ; Now I need to Enum the Child Windows or Controls to find my edit box for typing, and edit control for displayed text. ; This is where I seem to be stuck, and could use some enlightenment. I need FindWindowEx ? EndFunc
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