CyNDeR Posted November 9, 2007 Share Posted November 9, 2007 This is a Function from a script i'm writing: expandcollapse popupFunc PickColor() $color = Random(1, 28, 1) If $color = 1 Then MouseClick("left", 38, 646, 1, 0) ElseIf $color = 2 Then MouseClick("left", 53, 646, 1, 0) ElseIf $color = 3 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 4 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 5 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 6 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 7 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 8 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 9 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 10 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 11 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 12 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 13 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 14 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 15 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 16 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 17 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 18 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 19 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 20 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 21 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 22 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 23 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 24 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 25 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 26 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 27 Then MouseClick("left", 70, 646, 1, 0) ElseIf $color = 28 Then MouseClick("left", 70, 646, 1, 0) EndIf EndFunc ;==>PickColor As you can see, it has alot of ElseIf statements. The mouse cordinates arent all filled in yet, but you get the idea. Is there a better way to do this? My scripts: Random Painter Link to comment Share on other sites More sharing options...
jvanegmond Posted November 9, 2007 Share Posted November 9, 2007 Switch $color Case 1 MouseClick("left", 38, 646, 1, 0) Case 2 ;It goes on and on and on EndSwitch github.com/jvanegmond Link to comment Share on other sites More sharing options...
CyNDeR Posted November 9, 2007 Author Share Posted November 9, 2007 Ah, okay, thanks. My scripts: Random Painter Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 9, 2007 Share Posted November 9, 2007 Even better would be to carefully consider the mathematical relationship between those coordinates. How many different coordinates are there. Are they evenly spaced, and by how much? Etc. Then just do the math to generate coordinates. Best method depends on the particular circumstances. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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