Esamu Posted January 23, 2011 Share Posted January 23, 2011 Okay guys, I didn't work with AutoIt for like a year or so, and wanted to try something again. But I ran into a problem with some arrays I'm using. First of all, the purpose of this script is to read some data out of a group of programs and save the data into an array. You can find the whole code at http://pastie.org/1490367, but I'll try to give you only the snippets you need to. $iBotList=WinList('[CLASS:ThunderRT6FormDC]') If $iBotList[0][0] = 0 Then MsgBox(0, "Error", "No iBot found. Closing...") Exit 1 EndIf #Region - Dim data variables Dim $CHAR[$iBotList[0][0]] Dim $LVL[$iBotList[0][0]] Dim $GOLD[$iBotList[0][0]] Dim $SP[$iBotList[0][0]] Dim $EXP[$iBotList[0][0]] Dim $KILLSMIN[$iBotList[0][0]] Dim $KILLSTOTAL[$iBotList[0][0]] Dim $XPMIN[$iBotList[0][0]] Dim $XPTOTAL[$iBotList[0][0]] Dim $SPMIN[$iBotList[0][0]] Dim $SPTOTAL[$iBotList[0][0]] Dim $ITEMPICK[$iBotList[0][0]] Dim $DEATHS[$iBotList[0][0]] Dim $TOTALDCS[$iBotList[0][0]] [...] For $i = 1 to $iBotList[0][0] #Region - Reading data from bots $HANDLE = $iBotList[$i][1] $CHAR[$i] = ControlGetText($HANDLE, "", "[CLASS:" & $LABELCLASS & ";INSTANCE:" & $INSTANCE_CHAR & "]") $LVL[$i] = ControlGetText($HANDLE, "", "[CLASS:" & $LABELCLASS & ";INSTANCE:" & $INSTANCE_LVL & "]") $GOLD[$i] = ControlGetText($HANDLE, "", "[CLASS:" & $LABELCLASS & ";INSTANCE:" & $INSTANCE_GOLD & "]") [...] Right, my problem is, when running the script, I get this error: E:\Development\WebStatistics.au3 (66) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $CHAR[$i] = ControlGetText($HANDLE, "", "[CLASS:" & $LABELCLASS & ";INSTANCE:" & $INSTANCE_CHAR & "]") ^ ERROR >Exit code: 1 Time: 1.618 I already read about the error, the array is somehow invalid dimensioned, but why? I don't get it :/ Thanks in advance Link to comment Share on other sites More sharing options...
JohnOne Posted January 23, 2011 Share Posted January 23, 2011 Say $iBotList[0][0] = 5 then $CHAR[$iBotList[0][0]] == $CHAR[5], so 0-4 elements This line For $i = 1 to $iBotList[0][0] Trys to access $CHAR[5] It dosent exist. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted January 23, 2011 Share Posted January 23, 2011 Try For $i = 1 to $iBotList[0][0] -1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted January 23, 2011 Share Posted January 23, 2011 Oh and by the way, I'd leave it at that because your code is clearly game bot related, I just never seen it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Esamu Posted January 23, 2011 Author Share Posted January 23, 2011 It's a program to make a web statistic of a game bot, not to automate a game I read the rules. And your solution worked, thanks. 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