sunrifle Posted June 13, 2014 Share Posted June 13, 2014 (edited) I am not an aficionado when it comes to scripting, but I am also not entirely a novice. I have used AutoIt to bot games, and do macros to make my life easier. Much appreciated btw. But I am having difficulty making my latest script work. The purpose is so that I can open multiple tabs for craigslist posts that I wish to reply to. Then tab through the selections on the page till i get to the reply/contact button. If there is no contact/reply button then the window will close. If there is a contact/reply button then the macro will open the dropdown menu, and tab down to the gmail button, and click on it. Then paste the copied text and then send the message. The email page will close itself returning to the original post. the macro will then close the window, defaulting to the next already opened ad. This will continue until there is no white in the sidebar. I would appriciate any help that could be provided. I am using Windows 8, and the Chrome browser. Here is the script:expandcollapse popup;AutoEmail all opened Craigslist ads, screen resolution = 1600x900, and window maximized. ;Text that will be pasted needs to already be copied. ;All x,y coordinates are for 1600x900. ;Press the Windows+Space key to start the macro. ;Press ESC to stop the macro. ;There needs to be a buffer screen with no white on the left hand side to prevent the macro from closing all windows. Recommend [url=http://www.blackle.com/]http://www.blackle.com/[/url] #space:: BreakLoop = 0 WhiteSideBar = ffffff ContactBlue = a4c6fd SendBlue = 4b8cf6 SavedGray = a0a0a0 Loop { PixelSearch, Px, Py, 310, 130, 390, 165, ContactBlue, 0, Fast RGB ;Search this area of pixels for Highlighted Contact/Reply button. Should Tab 5 times if not. This is needed because sometimes the "account" button doesn't appear, and 5 tabs would navigate to the reply/contact button. if (ErrorLevel = 1) { Send {Tab down} sleep 500 ;Pause Send {Tab up} Send {Tab down} sleep 500 ;Pause Send {Tab up} Send {Tab down} sleep 500 ;Pause Send {Tab up} Send {Tab down} sleep 500 ;Pause Send {Tab up} Send {Tab down} sleep 500 ;Pause Send {Tab up} } if (BreakLoop = 1) break ;Stop Macro PixelSearch, Px, Py, 310, 130, 390, 165, ContactBlue, 0, Fast RGB ;Search this area of pixels for Highlighted Contact/Reply button. Should Tab 1 time if not, this will make the focus on the contact/reply button if the "account" button exists. if (ErrorLevel = 1) { Send {Tab down} sleep 500 ;Pause Send {Tab up} } if (BreakLoop = 1) break ;Stop Macro PixelSearch, Px, Py, 310, 130, 390, 165, ContactBlue, 0, Fast RGB ;Search this area of pixels for Highlighted Contact/Reply button. Should close window if not, this is incase there is no contact/reply button. if (ErrorLevel = 1) { Send ^w sleep 5000 ;Pause } if (BreakLoop = 1) break ;Stop Macro PixelSearch, Px, Py, 310, 130, 390, 165, ContactBlue, 0, Fast RGB ;Search this area of pixels for Highlighted Contact/Reply button. Should open menu, goto gmail link and open Gmail. if (ErrorLevel = 0) { Send {Enter} sleep 500 ;Pause Send {Tab down} sleep 500 ;Pause Send {Tab up} sleep 500 ;Pause Send {Tab down} sleep 500 ;Pause Send {Tab up} sleep 500 ;Pause Send {Enter} sleep 10000 ;Pause for page to load } if (BreakLoop = 1) break ;Stop Macro PixelSearch, Px, Py, 200, 820, 280, 855, SendBlue, 0, Fast RGB ;Search this area of pixels for Send Mail button. Should paste text if so. if (ErrorLevel = 0) { Send ^v sleep 10000 ;Pause for document to save } if (BreakLoop = 1) break ;Stop Macro PixelSearch, Px, Py, 200, 820, 280, 855, SavedGray, 0, Fast RGB ;Search this area of pixels for Send Mail button, gmail has to save email prior to sending is available. Should paste text if so. if (ErrorLevel = 0) { Send ^v sleep 10000 ;Pause for page to close Send ^w ;Close Craigslist posting sleep 10000 ;Pause for new page } if (BreakLoop = 1) break ;Stop Macro PixelSearch, Px, Py, 50, 250, 100, 260, WhiteSideBar, 0, Fast RGB ;Search this area of pixels for a white side bar. If there is any white it will continue, if none then end script. This will end the script once there are no more craigslist postings. if (ErrorLevel = 0) break ;Stop macro if (BreakLoop = 1) break ;Continue to next ad if (BreakLoop = 1) break ;Stop Macro } return Esc:: BreakLoop = 1 return Edited June 13, 2014 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
sunrifle Posted June 13, 2014 Author Share Posted June 13, 2014 The problem is that on any ad that has a reply/contact button the script stops on the CL and then hits enter to go to the main CL page Link to comment Share on other sites More sharing options...
AutID Posted June 13, 2014 Share Posted June 13, 2014 (edited) How many big projects have you created in autoit?!? This is a question for advanced autoit user because I haven't seen this autoit syntax yet!!! Edited June 13, 2014 by AutID https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
Bert Posted June 13, 2014 Share Posted June 13, 2014 Have you looked at IE.au3 in the help file? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 13, 2014 Moderators Share Posted June 13, 2014 sunrifle,Are you sure you are in the right place? That code looks more like AHK than AutoIt to me. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ZacUSNYR Posted June 13, 2014 Share Posted June 13, 2014 Cool you're spamming CL ads? Sounds like a good time, sign me up for offering free help. Link to comment Share on other sites More sharing options...
sunrifle Posted June 13, 2014 Author Share Posted June 13, 2014 crap, youre right its an AHK..... sorry Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 13, 2014 Moderators Share Posted June 13, 2014 sunrifle,No problem. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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