Jump to content

Craigslist is somehow blocking AutoIt script?


Recommended Posts

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:

;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 by Melba23
Added code tags
Link to comment
Share on other sites

  • Moderators

sunrifle,

Are you sure you are in the right place? That code looks more like AHK than AutoIt to me. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

sunrifle,

No problem. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...