boomingranny Posted March 3, 2011 Posted March 3, 2011 Hi, I am trying to make a script to automatically logout of facebook when i am away from my computer for a few minutes, or when i hit a hotkey. I am using IE, and whatever i do i can't get it to logout. i have tried simply browsing to the http://www.facebook.com/logout.php i have tried automating submission of the form, i have tried automating clicking the logout button nothing seems to be working for me. Has anyone else out there managed to script this? Cheers, Daniel
guinness Posted March 3, 2011 Posted March 3, 2011 Maybe have a look at _IEAction() to Click the Logout button?! Note: I don't personally use the IE Functions. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
boomingranny Posted March 3, 2011 Author Posted March 3, 2011 Maybe have a look at _IEAction() to Click the Logout button?! Note: I don't personally use the IE Functions.thanks for the help,tried _ieaction($oelement,"focus") then _ieaction($oelement,"click") still doesn't appear to click ittried setting focus to it then sending ie an enter key, still doesn't click it...
JohnOne Posted March 3, 2011 Posted March 3, 2011 Assuming you are already logged into facebook, this will navigate there, sleep, then logout. I've not long been using IE functions so its very basic. #include <IE.au3> $oIE = _IECreate("http://www.facebook.com/") $oForm = _IEGetObjById($oIE,"logout_form") Sleep(5000) _IEFormSubmit($oForm) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
boomingranny Posted March 3, 2011 Author Posted March 3, 2011 Assuming you are already logged into facebook, this will navigate there, sleep, then logout. I've not long been using IE functions so its very basic. #include <IE.au3> $oIE = _IECreate("http://www.facebook.com/") $oForm = _IEGetObjById($oIE,"logout_form") Sleep(5000) _IEFormSubmit($oForm) thanks John, i had been doing that, but it has helped because i have found that it does (half) log you out of facebook. if you don't run the above code then you close and reopen IE then you are still logged in if you DO run the above code then you close and reopen IE then you are logged off if you DO run the above code BUT you DON'T close IE you are still logged in! so i am using the above code then forcing all ie processes to terminate, and that is working for my needs. thanks.
JohnOne Posted March 3, 2011 Posted March 3, 2011 Weird about the half logged out thing, perhaps it has something to do with cookies. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
pipo223 Posted May 9, 2011 Posted May 9, 2011 Hi Guys Beside I have a problem with posting information on the share textarea. I haven't been able to find the form name corresponding to the textarea name which is "xhpc_message_text".can you please give me an example how to do it using Autoit ?
pipo223 Posted May 9, 2011 Posted May 9, 2011 (edited) Here is my code. My problem is that i cannot write in the status textarea. Help me please#include <IE.au3>_IEErrorHandlerRegister()$user = "email@hotmail.com" ;<<< Change username$pass = "password" ;<<< Change password$url = "http://www.facebook.com" ;<<< Change webpage link$oIE = _IECreate ($url)$size = _IEPropertyGet( $oIE, "hwnd")WinSetState( $size, "", @SW_MAXIMIZE)_IELoadWait ($oIE)$uForm = _IEFormGetObjByName ($oIE, "login_form") ;<<< Change to form html name on webpage$uText = _IEFormElementGetObjByName ($uForm, "email") ;<<< Change to input name of username field box within form on webpage_IEFormElementSetValue ($uText,$user)$pText = _IEFormElementGetObjByName ($uForm, "pass") ;<<<Change to input name of password field box within form on webpage_IEFormElementSetValue ($pText,$pass)_IEFormSubmit ($uForm)_IELoadWait ($oIE)$form3 = _IEFormGetObjByName ($oIE, "u950521_79")$mind = _IEFormElementGetObjByName ($form3, "xhpc_message_text")_IEFormElementSetValue ($mind, "test") Edited May 9, 2011 by pipo223
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