seanbrockest Posted June 4, 2014 Posted June 4, 2014 (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 June 4, 2014 by seanbrockest
Danp2 Posted June 4, 2014 Posted June 4, 2014 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. Latest Webdriver UDF Release Webdriver Wiki FAQs
seanbrockest Posted June 4, 2014 Author Posted June 4, 2014 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.
JohnOne Posted June 4, 2014 Posted June 4, 2014 "end (program)" There is a syntax error for you. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Danp2 Posted June 4, 2014 Posted June 4, 2014 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. Latest Webdriver UDF Release Webdriver Wiki FAQs
Solution seanbrockest Posted June 4, 2014 Author Solution Posted June 4, 2014 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! Mobius 1
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