andrew01 Posted November 9, 2007 Share Posted November 9, 2007 (edited) Ok so I am trying to create this script (happens to be involving myspace, but I have been having trouble with the _IE functions in general for a while). Basically, the script will open up a page and send a message. What I have so far:$hIE = _IEPropertyGet($oIE, "hwnd") ; Get the handle WinSetState($hIE, "", @SW_MAXIMIZE) _IELoadWait($oIE) $oForm = _IEFormGetObjByName ($oIE, "Subject:") ; These next few lines I am having trouble with --> I have no idea how to 'set focus' to forms, type in forms, press submit, etc. Everything here is wrong, and I have tried and tried but cant figure it out $oText = _IEFormElementGetObjByName ($oForm, "0") _IEFormElementSetValue ($oText, "Hey! It works!") _IEFormSubmit ($oForm) Send("Hey") Sleep(100) Send("{TAB}") Sleep(100) Send("^v") Send("{ENTER}") Send("{ENTER}") Send("SADFSADFSADFSAFSDAFSADFSDAFSADF") Sleep(100) Send("{ENTER}") Send("{ENTER}") Send("ASDFSDAFSFDSAFSAFDAFSAFDFSFSDAF") Sleep(100) MouseClick("left", 353, 915) MouseClick("left", 351, 878) MouseClick("left", 349, 915) MouseClick("left", 347, 915) Sleep(5000)What it is 'basically' supposed to do:1.) Navigate to the 'send message' page2.) Somehow set focus on the 'Subject:' field then type something in that field3.) Set focus/navigate down to the 'Message:' field then type something in that field4.) Send the messageI am trying to figure out ways to do this without using mouse click, something a bit more efficient. Any help given would be greatly appreciated, thank you. EDIT: Sorry I forgot to post the screenshot of the page I am working with, in case it helps visualize any better. Thanks Edited November 9, 2007 by andrew01 Link to comment Share on other sites More sharing options...
andrew01 Posted November 9, 2007 Author Share Posted November 9, 2007 Anyone, please Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted November 9, 2007 Moderators Share Posted November 9, 2007 The lack of response is most likely due to this having strong characteristics of a spam bot. Link to comment Share on other sites More sharing options...
andrew01 Posted November 10, 2007 Author Share Posted November 10, 2007 Well, could anyone at least try to help me understand this: It is the example under: _IEFormElementGetObjByName ; ******************************************************* ; Example 1 - Get a reference to a specific form element by name. ; In this case, submit a query to the Google search engine ; ******************************************************* ; #include <IE.au3> $oIE = _IECreate ("http://www.google.com") $oForm = _IEFormGetObjByName ($oIE, "f") $oQuery = _IEFormElementGetObjByName ($oForm, "q") _IEFormElementSetValue ($oQuery, "AutoIt IE.au3") _IEFormSubmit ($oForm) It opens up good and searches for autoit. I have no idea where "f" and "q" come from though, could someone explain the code above to me please? Link to comment Share on other sites More sharing options...
JustinReno Posted November 10, 2007 Share Posted November 10, 2007 I've made one, it was easy useing the UDFS, but i'm not releasing it. Link to comment Share on other sites More sharing options...
Generator Posted November 10, 2007 Share Posted November 10, 2007 (edited) I've made one, it was easy useing the UDFS, but i'm not releasing it.Your respond was completely useless and provide nothing but a "show-off" which isn't hard to accomplish + waste of Jon's bandwidth. To get the form collection, try my loop below #include<IE.au3> $thread="http://www.website.com" $Time=5000 _GetValue($thread,$Time) Func _GetValue($ThreadLink,$oTimeout) Local $oIE,$oForm,$oQuery,$o_Query _IEErrorHandlerRegister() _IELoadWaitTimeout($oTimeout) $oIE=_IECreate($ThreadLink,0,1,1) MsgBox(64,"Warning","Input text into element and click ok to continue") $oForm = _IEFormGetCollection ($oIE) $iNumForm=@extended For $i=0 to $iNumForm-1 $oForm = _IEFormGetCollection ($oIE, $i) $oQuery = _IEFormElementGetCollection ($oForm) $iNumElement=@extended For $n=0 to $iNumElement-1 $o_Query=_IEFormElementGetCollection($oForm,$n) If String(_IEFormElementGetValue($o_Query))="English" Then MsgBox(64,"Form: "&$i,"Element: "&$n) EndIf Next Next EndFunc Edit: Change the "English" to desire text Edited November 10, 2007 by Generator Link to comment Share on other sites More sharing options...
andrew01 Posted November 10, 2007 Author Share Posted November 10, 2007 Thank you very much Generator, I will mess around with that right now Link to comment Share on other sites More sharing options...
andrew01 Posted November 10, 2007 Author Share Posted November 10, 2007 Generator, thank you so much it's working now. One more question, is it possible to enter some type of text that has quotes around it? For example $hello = ""Hello"" Send($hello) ;or Send(""hello"") So the text being sent out is "hello" (with quotations). Anyway to do that? Thanks. Link to comment Share on other sites More sharing options...
JustinReno Posted November 10, 2007 Share Posted November 10, 2007 (edited) Your respond was completely useless and provide nothing but a "show-off" which isn't hard to accomplish + waste of Jon's bandwidth.No, it wasn't useless; Not showing off (Just contributing to a thread). And taking less than a minute of Jon's bandwith. Don't jet jealous, haha. Edited November 10, 2007 by JustinReno Link to comment Share on other sites More sharing options...
Generator Posted November 10, 2007 Share Posted November 10, 2007 No, it wasn't useless; Not showing off (Just contributing to a thread). And taking less than a minute of Jon's bandwith. Don't jet jealous, haha.Once again you did not answer thread opener's question and bring up something completely unrelated, i just can't see how your last thread is useful, there's a way around everything.For quote use '"msg"' 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