Sign in to follow this  
Followers 0
seanbrockest

Need some help bringing this all together

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



What program are you attempting to automate? Also, be sure to read the forum rules (link at the bottom of the page) to make sure that you aren't breaking them. :shifty:

Share this post


Link to post
Share on other sites

I'm asking for help checking my code for obvious newbie syntax errors, and then turning it into a program which will work on a hotkey.

If you think i've violated a rule, let me know.

Share this post


Link to post
Share on other sites

You didn't provide the name of the application as requested. You also didn't bother to run your script. I doubt that you will get much assistance unless you can provide additional details.

Share this post


Link to post
Share on other sites

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!

1 person likes this

Share this post


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
Sign in to follow this  
Followers 0