CyNDeR Posted November 4, 2007 Share Posted November 4, 2007 (edited) I'm trying to write a script to pet my Flufffriends pet on facebook. I'm trying to use the IE functions, but i can't understand the IE.au3 manual pages. I've used DebugBar to get the info i think i need, but i just don't understand how to use it, lol. Please, don't just write the code for me, i want to do it on my own, i just need some help. If i'm not mistaken i need to use _IEAction to click on the "pet" button, but i'm not sure how. Basically, the script will: 1. Attach to open facebook window in IE 2. Click the "pet" button 3. Reload page 4. Repeat. Edited November 4, 2007 by CyNDeR My scripts: Random Painter Link to comment Share on other sites More sharing options...
Generator Posted November 4, 2007 Share Posted November 4, 2007 1. $oIE=_IECreate("www.facebook.com") ;For autologin PM me 2. I assumed you got the name $oObj=_IEGetObjByID/Name("Name") _IEAction($oObj,"click") 3. _IEAction($oIE,"refresh") 4. While/WEnd Loop Link to comment Share on other sites More sharing options...
CyNDeR Posted November 4, 2007 Author Share Posted November 4, 2007 1. $oIE=_IECreate("www.facebook.com") ;For autologin PM me 2. I assumed you got the name $oObj=_IEGetObjByID/Name("Name") _IEAction($oObj,"click") 3. _IEAction($oIE,"refresh") 4. While/WEnd Loop No, i'm not sure i have the name. How would i find it? So far the code is: #include <IE.au3> $oIE = _IECreate("http://www.facebook.com/profile.php?id=#########") $oObj = _IEGetObjByName($oIE, "Pet Me!") While 1 WEnd _IEAction($oObj,"click") _IEAction($oIE,"refresh") I thought that was the name, but its not found. My scripts: Random Painter Link to comment Share on other sites More sharing options...
Nahuel Posted November 4, 2007 Share Posted November 4, 2007 This will tell you the names. Link to comment Share on other sites More sharing options...
CyNDeR Posted November 4, 2007 Author Share Posted November 4, 2007 (edited) This will tell you the names. I believe i found the ID, but i can't find a name. My code so far is: #include <IE.au3> $oIE = _IECreate("http://www.facebook.com/profile.php?id=#########") $oObj = _IEGetObjById($oIE, "app2219808235_pet_friend") _IEAction($oObj,"click") _IEAction($oIE,"refresh") While 1 WEnd I don't get any errors, but it doesnt work either. And also, DebugBar lists it as being a form, would that matter? This is the form: <FORM class=form_class id=app2219808235_pet_friend accept-charset=utf-8 encType=multipart/form-data fbcontext="a28ffc8a7db5"><INPUT type=hidden value=606125029 name=fb_sig_profile><INPUT type=hidden value=1194160032.6484 name=fb_sig_time><INPUT type=hidden value=1 name=fb_sig_added><INPUT type=hidden value=606125029 name=fb_sig_user><INPUT type=hidden value=1186629739 name=fb_sig_profile_update_time><INPUT type=hidden value=3d3796219a60ddb87b8d3adb-606125029 name=fb_sig_session_key><INPUT type=hidden value=0 name=fb_sig_expires><INPUT type=hidden value=a0bf7641206a1e479e7a6c360c84698f name=fb_sig_api_key><INPUT type=hidden value=48dd1d1a83a242d11b2910d1e1b6ac36 name=fb_sig><INPUT type=hidden value=wide name=column><INPUT type=hidden value=Fluffy name=friend_name><INPUT class=submit_button onclick='var self = this;FBML.clickRewriteAjax(2219808235, true, "app2219808235_ffriend_area", "http:\/\/74.208.44.48\/fluff\/pet_ffriend.php", "app2219808235_pet_friend", null);return false' type=submit value="Pet Me!" clickrewriteform="pet_friend" clickrewriteid="ffriend_area" clickrewriteurl="http://74.208.44.48/fluff/pet_ffriend.php"></FORM> Edited November 4, 2007 by CyNDeR My scripts: Random Painter Link to comment Share on other sites More sharing options...
Generator Posted November 4, 2007 Share Posted November 4, 2007 (edited) Of course it won't work...#include <IE.au3>$oTmeout=5000$oIE = _IECreate("http://www.facebook.com/profile.php?id=#########")$oObj = _IEGetObjById($oIE, "app2219808235_pet_friend")While 1_IEAction($oObj,"click")_IELoadWait($oIE, $oTimeout, $oTimeout)_IEAction($oIE,"refresh")_IELoadWait($oIE, $oTimeout, $oTimeout)WEnd Edited November 4, 2007 by Generator Link to comment Share on other sites More sharing options...
CyNDeR Posted November 4, 2007 Author Share Posted November 4, 2007 Okay, the problem i had is that it wouldnt click on the button. I figured out how to do it, but the form has multiple values which are generated as the page loads (i think). I took out everything besides opening the page, and click the button. This is what i got:#include <IE.au3> $oIE = _IECreate("http://apps.facebook.com/fluff/fluffbook.php") $oForms = _IEFormGetCollection($oIE, 1) $oElement = _IEFormElementGetCollection($oForms, 11) _IELoadWait($oIE) _IEAction($oElement,"click")It opens the page, click the button, but since it doesnt send all of the other values, i get this message:Sadness!! Attempts to automate/script (fluff)Friends have resulted in major servers problems, data loss, and downtime. If this continues, (fluff)Friends may have to shut down. PLEASE do not automate/script the application.=( =( =( =( =( =( =( =( =( =(Fluff friends is a free application created by one developer part time. I will not be able to continue fixing this if people keep breaking it. Fluff is just intended to be fun. Please do not destroy this for everyone.I won't try to write a script that works, it's just too much hassle, i was just bored anyway. But, it did help me learn about IE functions. Thanks for all your help guys. My scripts: Random Painter 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