dandv Posted January 15, 2012 Posted January 15, 2012 (edited) I just started using AutoIt (the SFX binaries) yesterday (coming from Macro Express), so I might be missing something.My goal is to automate reporting spambots on Twitter, by opening a new tab in Chrome, going to a certain URL, then filling in the form there. The problem is that AutoIt never quite manages to properly fill in the form. Initially characters were completely garbled (nothing like what I was Send-ing). After setting SendKeyDelay to 20 and calling Sleep(100) after each Send, sending characters freezes (and resumes if I click), or Tabs don't get sent etc. Generally, the behavior is unreliable in unpredictable ways.Here's the script. You can try it out, as it doesn't submit the form. Just have something in the clipboard (the script assumes it's the Twitter username of the spambot).expandcollapse popup#region ---Au3Recorder generated code Start (v3.3.7.0) --- #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- Opt("SendKeyDelay", 20) Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase _WinWaitActivate("Google Chrome","") Send("{CTRLDOWN}t{CTRLUP}") _WinWaitActivate("New Tab - Google Chrome","") Send("https://support.twitter.com/forms/general{ENTER}") _WinWaitActivate("Twitter Help Center - Google Chrome","") Send("{TAB}{TAB}{TAB}{TAB}{TAB}R") Sleep(100) Send("{TAB}Spambot account - {CTRLDOWN}v{CTRLUP}") Sleep(100) Send("{TAB}Per the Twitter rules for evaluating accounts as spam (https://support.twitter.com/entries/18311) I would like to report the user above for breaking the following rules:{ENTER}") Sleep(100) Send("{ENTER}") Sleep(100) Send("- If your updates consist mainly of links, and not personal updates;{ENTER}") Sleep(100) Send("- If you post misleading links;{ENTER}") Sleep(100) Send("- If you post duplicate content over multiple accounts or multiple duplicate updates on one account;{ENTER}") Sleep(100) Send("- If you send large numbers of unsolicited @replies or mentions in an attempt to spam a service or link;{ENTER}") Sleep(100) Send("- If you add a large number of unrelated users to lists in an attempt to spam a service or link;{ENTER}") Sleep(100) Send("{ENTER}") Sleep(100) Send("All their recent links point to the same scam page.") Sleep(100) Send("{TAB}Dan Dascalescu") Send("{TAB}{TAB}") #endregion --- Au3Recorder generated code End ---Questions:1. How can large amounts of text be sent reliably? I see there are some issues with Send() or 2. If #1 is possible, why isn't that the default way Send() works? Edited January 15, 2012 by dandv
JohnOne Posted January 15, 2012 Posted January 15, 2012 2. I would imagine it's because most of the time Send() works perfectly fine, and SendKeepActive() uses much more resources. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
dandv Posted January 17, 2012 Author Posted January 17, 2012 K, no ideas about how to send text reliably with Send()? Most of the time, the sending freezes while characters are being dumped into the window, and resumes if I click the mouse. I suppose I should try stuffing all the text in the clipboard, and sending just a Ctrl+V.
JohnOne Posted January 17, 2012 Posted January 17, 2012 It would make your life easier if you to use IE UDF, but if you are intent on using Chrome then... AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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