Jefferds44 Posted January 25, 2009 Posted January 25, 2009 Hi guys, I'm getting the following error: D:\test6.au3 (53) : ==> Subscript used with non-Array variable.: I think I might not be using array variables correctly. My intention is to get the pixel color of different locations on my screens. If the pixel color is a specifc color, I want to attribute if that window slot is available in an array variable. The practical application I'm trying to build is a tool that will lay out different poker tables on my screens. Here is my code: Global $SlotTournamentID; Array variable with the Tournament ID# Global $AvailableSlots; Array variable with True False for each slot Global Const $MultiTables = 2; Set number of tables to open at the same time Global $SlotPosX ; Horizontal (X) position of Tournament Window Global $SlotPosY ; Vertical (Y) position of Tournament Window Global Const $FrogPixelLocationX = 239; Horizontal (X) pixel location of frog Global Const $FrogPixelLocationy = 278; Vertical (Y) pixel location of frog Global $PlayMoneyTitle = "Play Money" Global Const $FTPBuyIn = "250"; Set Buy-In amount. "250", "2,000", "10,000", "100,000", "500,000", "1,000,000" CheckAvailableSlots ($AvailableSlots) Func CheckAvailableSlots (ByRef $ASlots); Closes busted-out tables and frees up the slotIDs. Verifies if the "Frog" is not present in one of the slots For $SlotNum = 0 To $MultiTables - 1 Step +1 If $ASlots[$SlotNum] = PixelGetColor ( $SlotPosX [$SlotNum] + $FrogPixelLocationX, $SlotPosY [$SlotNum] + $FrogPixelLocationy) = 0x75260B Then If $FTPRealMoney = 0 Then WinWaitClose ( $FTPBuyIn & " " & $PlayMoneyTitle & " Sit & Go (" & $SlotTournamentID [$SlotNum]) $SlotTournamentID [$SlotNum] = "" Else WinWaitClose ( $FTPBuyIn & " Sit & Go (" & $SlotTournamentID [$SlotNum]) $SlotTournamentID [$SlotNum] = "" EndIf $ASlots[$SlotNum] = PixelGetColor ( $SlotPosX [$SlotNum] + $FrogPixelLocationX, $SlotPosY [$SlotNum] + $FrogPixelLocationy) <> 0x8EB34F EndIf Next Return $ASlots EndFunc Thanks for any help I can get.
Aceguy Posted January 25, 2009 Posted January 25, 2009 i think you havent declared the variable $aslots and the same with all the variables that you have a 2d array in. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Authenticity Posted January 25, 2009 Posted January 25, 2009 (edited) If $ASlots[$SlotNum] = PixelGetColor ( $SlotPosX [$SlotNum] + $FrogPixelLocationX, $SlotPosY [$SlotNum] + $FrogPixelLocationy) = 0x75260B ThenoÝ÷ Ù(hºW[y«¢+Ù%ÀÌØíM±½ÑÍlÀÌØíM±½Ñ9ÕµtôA¥á±Ñ ½±½È ÀÌØíM±½ÑA½Í`lÀÌØíM±½Ñ9Õµt¬ÀÌØíɽA¥á±1½Ñ¥½¹`°ÀÌØíM±½ÑA½ÍdlÀÌØíM±½Ñ9Õµt¬ÀÌØíɽA¥á±1½Ñ¥½¹ä¤¹|)A¥á±Ñ ½±½È ÀÌØíM±½ÑA½Í`lÀÌØíM±½Ñ9Õµt¬ÀÌØíɽA¥á±1½Ñ¥½¹`°ÀÌØíM±½ÑA½ÍdlÀÌØíM±½Ñ9Õµt¬ÀÌØíɽA¥á±1½Ñ¥½¹ä¤ôÁàÜÔÈØÁQ¡¸This is just a wrong syntax though. You should be comparing X for an X and Y for an Y.Edit: Ignore the X and Y part ^^ I though it's somehow related to GetMousePos() , rofl AutoIt code corrupted. Edited January 25, 2009 by Authenticity
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