FoLlAnY Posted October 29, 2007 Share Posted October 29, 2007 Hi! First, thanx to all contributors of this forum. So, I have some problems with this code: CODE#include <array.au3> #include <Array2D.au3> #Include <Misc.au3> HotKeySet("q", "quit") $myArray = IniReadSection("highlight.ini", "wpos3") If @error Then ToolTip("Error occurred, probably no such section file.", 0, 0) Sleep(3000) Exit EndIf Dim $myCoords[uBound($myArray)-1][2] $ac = 0 $ad = 1 $dll = DllOpen("user32.dll") Do $myColor = PixelGetColor($myArray[$ad][0], $myArray[$ad][1]) If _IsPressed("01", $dll) Then ReDim $myCoords[$ac+1][2] $myCoords[$ac][0] = $myArray[$ad][0] $myCoords[$ac][1] = $myArray[$ad][1] _ArrayDisplay($myCoords, "Contents In myCoords", 0, 0) _ArrayDelete2D($myArray, $ad) ReDim $myArray[uBound($myArray-1)][2] _ArrayDisplay($myArray, "Contents In myArray", 0, 0) If $ac = 95 Then Exit EndIf $ac+= 1 EndIf If $ad = UBound($myArray) Then $ad = 0 EndIf $ad+= 1 Sleep(100) Until UBound($myArray) = 1 Func quit() DllClose($dll) Exit EndFunc The code works for a few mouseclicks, then "Array variable has incorrect number of subscripts or subscript dimension range exceeded." So, is there someone who can see whats wrong?! Thanx! Link to comment Share on other sites More sharing options...
Paulie Posted October 29, 2007 Share Posted October 29, 2007 I'm afraid that i dunno the contents of Highlight.ini so i can't test the code. and i don't even know what you want this to do... Explain a little bit more, and i'll be happy to help. Link to comment Share on other sites More sharing options...
FoLlAnY Posted October 29, 2007 Author Share Posted October 29, 2007 I'm afraid that i dunno the contents of Highlight.ini so i can't test the code. and i don't even know what you want this to do...Explain a little bit more, and i'll be happy to help.Ok, ul the files needed So, in this testscript (I know pixelgetcolor returns a colourvalue;)), when left mouse is clicked It redims $myCoords with +1 row. Then copies the values of $myArray to $myCoords. So far so good. It also deletes the copied row of $myArray and redim $myArray. Thats where the error comes in after awhile.Hope that info helps.. Link to comment Share on other sites More sharing options...
Paulie Posted October 29, 2007 Share Posted October 29, 2007 Ok, ul the files needed So, in this testscript (I know pixelgetcolor returns a colourvalue;)), when left mouse is clicked It redims $myCoords with +1 row. Then copies the values of $myArray to $myCoords. So far so good. It also deletes the copied row of $myArray and redim $myArray. Thats where the error comes in after awhile.Hope that info helps..I'm afraid i still don't know what exactly you want your code to do. What is the significance of the INI file, and why are you reading it with one array, then trying to copy the contents to a whole new array which would leave 2 arrays containing the same stuff. Link to comment Share on other sites More sharing options...
FoLlAnY Posted October 29, 2007 Author Share Posted October 29, 2007 I'm afraid i still don't know what exactly you want your code to do. What is the significance of the INI file, and why are you reading it with one array, then trying to copy the contents to a whole new array which would leave 2 arrays containing the same stuff.Ok, in this testscript.. there are things cut out (other functions that modifies the array). The differens between myArray and myCoords is that when a colour is true (not ispressed as in this script) it saves the coords to myCoords. And there have to be no dupes, therefor I must delete just that row in myArray so it doesnt search for that specific colour at those coordintes anymore. ok? Link to comment Share on other sites More sharing options...
FoLlAnY Posted October 30, 2007 Author Share Posted October 30, 2007 Ok, in this testscript.. there are things cut out (other functions that modifies the array). The differens between myArray and myCoords is that when a colour is true (not ispressed as in this script) it saves the coords to myCoords. And there have to be no dupes, therefor I must delete just that row in myArray so it doesnt search for that specific colour at those coordintes anymore. ok?Hi, Problem solved. Thanx anyway. 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