Makalele Posted March 29, 2010 Posted March 29, 2010 Hi! I got a basic issue with array. Dunno what's wrong here: Dim $pixeldata[100][4] $pixelcount=0 func PixelDataErase() for $q1=0 to 99 for $q2=0 to 3 $pixeldata[$q1][$q2]=0 next next $pixelcount=0 endfunc And there's an error: D:\Dokumenty\AutoIt\DrognanShopBot\drognan_sb.au3 (451) : ==> Expected a "=" operator in assignment statement.: $pixeldata[$q1][$q2]=0 $pixeldata^ ERROR PLZ Help. Thanks a lot
water Posted March 29, 2010 Posted March 29, 2010 The code snippet you provided runns fine here (Autoit 3.3.6.0). Your script seems to be much larger - did you redefine $pixeldata somewhere? What version of AutoIt do you run? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
KaFu Posted March 29, 2010 Posted March 29, 2010 How about this? Func PixelDataErase() Dim $pixeldata[UBound($pixeldata)][UBound($pixeldata,2)] EndFunc ;==>PixelDataErase OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Makalele Posted March 29, 2010 Author Posted March 29, 2010 The code snippet you provided runns fine here (Autoit 3.3.6.0). Your script seems to be much larger - did you redefine $pixeldata somewhere? What version of AutoIt do you run? Yep, my script is much longer but this is just new thing used in only one function: expandcollapse popupFunc Scan2() $Wand = 2187742 $Staff = 6535754 $Scepter = 16766810 $ItemBlock = 5394861 PixelDataErase() for $sy=$ShopScanY1 to $ShopScanY2 for $sx=$ShopScanX1 to $ShopScanX2 If ToScan($sx,$sy) Then $pixel = PixelGetColor($sx,$sy) If ($pixel=$Wand OR $pixel=$Staff OR $pixel=$Scepter) Then $pixeldata[$pixelcount][0]=$sx $pixeldata[$pixelcount][1]=$sy $px=$sx $py=$sy While PixelGetColor($px,$sy)=$pixel $px+=1 WEnd While PixelGetColor($sx,$py)=$pixel $py+=1 WEnd $pixeldata[$pixelcount][2]=$px-$sx $pixeldata[$pixelcount][3]=$py-$sy $pixelcount+=1 EndIf endif next next EndFunc How about this? Func PixelDataErase() Dim $pixeldata[UBound($pixeldata)][UBound($pixeldata,2)] EndFunc ;==>PixelDataErase doesn't work :/ D:\Dokumenty\AutoIt\DrognanShopBot\drognan_sb.au3 (455) : ==> Array variable subscript badly formatted.: Dim $pixeldata[UBound($pixeldata)][UBound($pixeldata,2)] Dim $pixeldata[^ ERROR
Nurav Posted March 29, 2010 Posted March 29, 2010 it is running perfectly fine here array.au3 is included? I am just guessing - reinstallation of autoit will help?
KaFu Posted March 29, 2010 Posted March 29, 2010 Hard to say without seeing the rest... try this... expandcollapse popupFunc Scan2() $Wand = 2187742 $Staff = 6535754 $Scepter = 16766810 $ItemBlock = 5394861 $pixelcount = 0 Local $pixeldata[($ShopScanY2-$ShopScanY1)*($ShopScanX2-$ShopScanX1)][4] For $sy = $ShopScanY1 To $ShopScanY2 For $sx = $ShopScanX1 To $ShopScanX2 If ToScan($sx, $sy) Then $pixel = PixelGetColor($sx, $sy) If ($pixel = $Wand Or $pixel = $Staff Or $pixel = $Scepter) Then $pixeldata[$pixelcount][0] = $sx $pixeldata[$pixelcount][1] = $sy $px = $sx $py = $sy While PixelGetColor($px, $sy) = $pixel $px += 1 WEnd While PixelGetColor($sx, $py) = $pixel $py += 1 WEnd $pixeldata[$pixelcount][2] = $px - $sx $pixeldata[$pixelcount][3] = $py - $sy $pixelcount += 1 EndIf EndIf Next Next Return $pixeldata EndFunc ;==>Scan2 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Makalele Posted March 29, 2010 Author Posted March 29, 2010 Rotfl i found it Dim can't be inside code. It has to be on start Thank you anyway. Topic can be closed
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