Jump to content

Need some help bringing this all together


Go to solution Solved by seanbrockest,

Recommended Posts

I've been using autohotkey for years as an easy click macro for robots, but i'm not sure it can do what i'm looking for this time.
I've researched some of the code I need, That having been said, i'm NOT a coder. I need some help with syntax/flow
 
Also, not sure if it's possible, but I would like the program to always run in the background (maybe on my taskbar like AHK scripts do), and trigger on a hotkey
 
-----------------------
Local $startxpos = MouseGetPos(0)
Local $startypos = MouseGetPos(1)

Local $colorxpos = $startxpos-54
Local $colorypos = $startypos+90

local $pixelcolor1 = PixelGetColor($colorxpos, $colorypos)


For $i = 1 To 10
MouseClick("left")
sleep(2000)


while PixelGetColor($colorxpos, $colorypos) <> $pixelcolor1
sleep(500)
wend


next
-----------------------
 
EDIT: okay i made some edits as i was researching syntax. Think it's done now.
Edited by seanbrockest
Link to comment
Share on other sites

  • Solution

I think i've finished it myself. 

HotKeySet("{ESC}", "Terminate")

Global $startxpos = MouseGetPos(0)
Global $startypos = MouseGetPos(1)

Global $colorxpos = $startxpos - 54
Global $colorypos = $startypos + 90

Global $pixelcolor1 = PixelGetColor($colorxpos, $colorypos)
Global $runtimes

Func Terminate()
    Exit 0
EndFunc


$runtimes = InputBox("runtimes", "How many times do you want to do it?", 10)
For $i = 1 To $runtimes
    MouseClick("left")
    Sleep(3000)

    While PixelGetColor($colorxpos, $colorypos) <> $pixelcolor1
        Sleep(500)
    WEnd

Next

Thanks though!

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...