Jump to content

Automating clicking function

Recommended Posts

I want to automate the clicking of next icon (right arrow) for instagram posts from the web, however, the codes i have right now will close the viewing of posts after clicking just one next arrow to the next post. Can someone tell me what is wrong? Thanks in advance.

 Global $CheckSwap = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")

 Global $MousePrimary, $MouseSecondary

 If $CheckSwap = 1 Then
     $MousePrimary = "right"
     $MouseSecondary = "left"
     $MousePrimary = "left"
     $MouseSecondary = "right"

 Global $ExitKey = "^!x"
 Global $Color = 0xb3b3b3
 Global $Left = 0
 Global $Top = 0
 Global $Right = 1174
 Global $Bottom = 392
 Global $ClickMouse = $MousePrimary
 Global $SearchResult

 HotKeySet($ExitKey, '_Exit')

 While 1
     $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color)

     If Not @error Then
         MouseClick($ClickMouse, $SearchResult[0], $SearchResult[1], 1, 70)

 Func _Exit()

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...