awlekso Posted September 6, 2017 Share Posted September 6, 2017 hello everyone i'm new on autoit how can i add hotkeys on my script to start and stop with f1. really i hope someone can help me please. $Variable = PixelSearch(18, 23, 1250, 951, 0x11223e) If IsArray($Variable) = True Then MouseClick("Right", $Variable [0], $Variable [1], 1) Else $Variable = PixelSearch(18, 23, 1250, 951, 0x112442) If IsArray($Variable) = True Then MouseClick("Right", $Variable [0], $Variable [1], 1) Else $Variable = PixelSearch(18, 23, 1250, 951, 0x020307) If IsArray($Variable) = True Then MouseClick("Right", $Variable [0], $Variable [1], 1) Else $Variable = PixelSearch(18, 23, 1250, 951, 0x122116) If IsArray($Variable) = True Then MouseClick("Right", $Variable [0], $Variable [1], 1) Else $Variable = PixelSearch(18, 23, 1250, 951, 0x0b172d) If IsArray($Variable) = True Then MouseClick("Right", $Variable [0], $Variable [1], 1) Else $Variable = PixelSearch(18, 23, 1250, 951, 0x122036) If IsArray($Variable) = True Then MouseClick("Right", $Variable [0], $Variable [1], 1) Else $Variable = PixelSearch(18, 23, 1250, 951, 0x0e0d14) If IsArray($Variable) = True Then MouseClick("Right", $Variable [0], $Variable [1], 1) EndIf EndIf EndIf EndIf EndIf EndIf EndIf Link to comment Share on other sites More sharing options...
KickStarter15 Posted September 7, 2017 Share Posted September 7, 2017 Hi, Welcome to our forum. What are you trying to accomplish here? Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. Link to comment Share on other sites More sharing options...
badcoder123 Posted September 7, 2017 Share Posted September 7, 2017 Instead of so many else you should do elseif and then you'd only need 1 endif You're probably better making an infinite loop for pixelsearches HotKeySet("_KEY", "Function") Func Function ;insert stuff EndFunc Link to comment Share on other sites More sharing options...
awlekso Posted September 7, 2017 Author Share Posted September 7, 2017 @badcoder123 can you explan me how can i add all my colors on this way how are you saying,can you make new script with hotkey "F1" with all my colors please i really don't know how to work with autoit. @KickStarter15 i want to have a script with hotkey "F1" to start my script with all my colors,ex f1 pixelsearch look for colors what i have on my script. hope you guys will help me sorry if my english is bad. Link to comment Share on other sites More sharing options...
Developers Jos Posted September 7, 2017 Developers Share Posted September 7, 2017 Why use all this difficult Pixelsearch() and MouseClicking for a regular program? I hope you read the forum rules as that explains which type of program we don't want to see any discussions on. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
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