bills Posted May 31, 2007 Share Posted May 31, 2007 im trying to make a script that automatically fills in the required information when doing link exchanges. http://www.pussbrudarna.se/trade.php this is the site that im putting the information in. i got the script to add text in the form on a similar page but this one wont work. While 2 If WinActive("CjOverkill Version 4.1.1 - Microsoft Internet Explorer") Then WinWaitActive("CjOverkill Version 4.1.1 - Microsoft Internet Explorer") $o_form2 = _IEFormGetCollection ($oIE, 0) $o_pass2 = _IEFormElementGetObjByName ($o_form2, "pass") $o_url2 = _IEFormElementGetObjByName ($o_form2, "url") $o_sitename2 = _IEFormElementGetObjByName ($o_form2, "site_name") $o_sitedesc2 = _IEFormElementGetObjByName ($o_form2, "site_desc") $o_email2 = _IEFormElementGetObjByName ($o_form2, "email") $o_submit2 = _IEFormElementGetObjByName ($o_form2, "add") $pass2 = "lallare" $email2 = "stevenzzzon@yahoo.com" $sitedesc2 = "Se mig posera naken framför kameran" $sitename2 = "Elins lilla sida" Sleep(300) Send("{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}") _IEFormElementSetValue ($o_pass2, $pass2) _IEFormElementSetValue ($o_sitename2, $sitename2) _IEFormElementSetValue ($o_sitedesc2, $sitedesc2) _IEFormElementSetValue ($o_email2, $email2) Sleep(6000)Then i want to copy (CTRL-C) the rest of the line containing "Admin EMail: " after "Admin EMail: ", paste it in a field in another site(i know how to do the paste) and then copy the rest of the line containing "Send Traffic To: " after "Send Traffic To: ".Can any of you guys help me? Link to comment Share on other sites More sharing options...
bills Posted May 31, 2007 Author Share Posted May 31, 2007 Doesnt anyone know how to do this? Link to comment Share on other sites More sharing options...
retghy Posted May 31, 2007 Share Posted May 31, 2007 To start you are missing some WEND and ENDIF.... Link to comment Share on other sites More sharing options...
bills Posted May 31, 2007 Author Share Posted May 31, 2007 This is just a part of the code. I got the WEnd and EndIf further down the code. This is just the part i need help with. Ive checked the helpfiles but i cant get it to work the way i want it.. Link to comment Share on other sites More sharing options...
retghy Posted May 31, 2007 Share Posted May 31, 2007 (edited) You should put the whole code so people can try it and know whats wrong... I tweaked the code a little and at least the script is filling the forms automatically.. #include <IE.au3> If WinActive("CjOverkill Version 4.1.1 - Microsoft Internet Explorer") Then WinWaitActive("CjOverkill Version 4.1.1 - Microsoft Internet Explorer") EndIf $oIE = _IECreate ("http://www.pussbrudarna.se/trade.php") $o_form2 = _IEFormGetCollection ($oIE, 0) $o_pass2 = _IEFormElementGetCollection ($o_form2,5) $o_url2 = _IEFormElementGetCollection ($o_form2,0) $o_sitename2 = _IEFormElementGetCollection ($o_form2,1) $o_sitedesc2 = _IEFormElementGetCollection ($o_form2,2) $o_email2 = _IEFormElementGetCollection ($o_form2,3) $o_submit2 = _IEFormElementGetCollection ($o_form2,6) $pass2 = "lallare" $email2 = "stevenzzzon@yahoo.com" $sitedesc2 = "Se mig posera naken framför kameran" $sitename2 = "Elins lilla sida" Sleep(300) Send("{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}") _IEFormElementSetValue ($o_pass2, "bla") _IEFormElementSetValue ($o_sitename2, "bla") _IEFormElementSetValue ($o_sitedesc2, "bla") _IEFormElementSetValue ($o_email2, "bla") _IEFormElementSetValue ($o_url2, "bla") Sleep(6000) I saw that you were using _IEFormGetCollection and then trying to fill the forms using names as reference and not the index number, also, when using _IEFormElementSetValue you were trying to fill the form with the same variable. Other than that, I'm not able to give you a technical explanation of what I did, I'm a beginner in the IE.au3 and form filling world too Let me know if it works for you. Edited May 31, 2007 by retghy Link to comment Share on other sites More sharing options...
bills Posted June 1, 2007 Author Share Posted June 1, 2007 That works with that site! Great! Thanks!Though when i try the code on another site with the same forms and window name it doesnt fill out the fields?http://www.amator6.com/trade.phpI dont understand the difference between these two. Why does it work in the first but not in this?Also does anyone know if i can make the script pause at a point and wait for the command CTRL-C and then resume?Thanks a lot guys! Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted June 4, 2007 Moderators Share Posted June 4, 2007 This should work... #include <IE.au3> $sURL = "http://www.amator6.com/trade.php" $oIE = _IECreate($sURL) $oForm = _IEFormGetCollection($oIE, 0) $oURL = _IEFormElementGetObjByName($oForm, "url") $oSiteName = _IEFormElementGetObjByName($oForm, "site_name") $oSiteDesc = _IEFormElementGetObjByName($oForm, "site_desc") $oEmail = _IEFormElementGetObjByName($oForm, "email") $oICQ = _IEFormElementGetObjByName($oForm, "icq") $oPassword = _IEFormElementGetObjByName($oForm, "pass") _IEFormElementSetValue($oURL, "1") _IEFormElementSetValue($oSiteName, "2") _IEFormElementSetValue($oSiteDesc, "3") _IEFormElementSetValue($oEmail, "4") _IEFormElementSetValue($oICQ, "5") _IEFormElementSetValue($oPassword, "6") _IEFormSubmit($oForm) 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