butterfly Posted April 10, 2014 Share Posted April 10, 2014 Hello all, the code works as intended although it took me 25 min to figure this method out ha ha (yeah,yeah i am the slowest and crappiest coder) here is my code and I wonder if there are better methods then this so i can learn from it..... #include <Array.au3> $ansRarity = "B,Any Rarity;N,Mythic;F,Mythic;A,Rare;A,Uncommon;F,Common;N,Common" $ansFormats = "All cards Online;Standard;Extended;Classic;Legacy;Modern;Pauper;Theros Block;Return to Ravnica Block;Core Sets;Masters Edition;Special Sets;Promotional;Modern Masters" $arrayRarity = StringSplit($ansRarity, ";") $arrayFormats = StringSplit($ansFormats, ";") _ArrayDisplay($arrayRarity) _ArrayDisplay($arrayFormats) $n = $arrayFormats[0] * $arrayRarity[0] Dim $RarityFormatSearch[$n + 1][2] $RarityFormatSearch[0][0] = $n $x = 0 For $z = 1 To $arrayFormats[0] for $y = 1 To $arrayRarity[0] $x = $x + 1 $RarityFormatSearch[$x][1] = $arrayRarity[$y] Next Next $x = 0 For $z = 1 To $arrayFormats[0] for $y = 1 To $arrayRarity[0] $x = $x + 1 $RarityFormatSearch[$x][0] = $arrayFormats[$z] Next Next _ArrayDisplay($RarityFormatSearch) Link to comment Share on other sites More sharing options...
JohnOne Posted April 10, 2014 Share Posted April 10, 2014 Explain what it does. 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...
butterfly Posted April 10, 2014 Author Share Posted April 10, 2014 (edited) Well it works as intended (resultwise) my end result is perfect as shown _ArrayDisplay($RarityFormatSearch) it is a function that creates a array of how I am going to search for something as example I have 3 rooms: bathroom livingroom and kitchen and each room has stuff in it like Lamp, seat and sink because I want to search things in order i am searching in 1 room at a time for 3 things bathroom > Lamp bathroom > seat bathroom > sink livingroom >Lamp livingroom >seat livingroom >sink kitchen>Lamp kitchen>seat kitchen>sink and voila my array is in order and this will be the quickest way of searching I was just wondering if there is an lightly smarter or much smarter ways of doing this then my code Edited April 10, 2014 by butterfly Link to comment Share on other sites More sharing options...
Solution jdelaney Posted April 10, 2014 Solution Share Posted April 10, 2014 The second loop is redundant: #include <Array.au3> $ansRarity = "B,Any Rarity;N,Mythic;F,Mythic;A,Rare;A,Uncommon;F,Common;N,Common" $ansFormats = "All cards Online;Standard;Extended;Classic;Legacy;Modern;Pauper;Theros Block;Return to Ravnica Block;Core Sets;Masters Edition;Special Sets;Promotional;Modern Masters" $arrayRarity = StringSplit($ansRarity, ";") $arrayFormats = StringSplit($ansFormats, ";") _ArrayDisplay($arrayRarity) _ArrayDisplay($arrayFormats) $n = $arrayFormats[0] * $arrayRarity[0] Dim $RarityFormatSearch[$n + 1][2] $RarityFormatSearch[0][0] = $n $x = 0 For $z = 1 To $arrayFormats[0] for $y = 1 To $arrayRarity[0] $x = $x + 1 $RarityFormatSearch[$x][0] = $arrayFormats[$z] $RarityFormatSearch[$x][1] = $arrayRarity[$y] Next Next _ArrayDisplay($RarityFormatSearch) IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
butterfly Posted April 12, 2014 Author Share Posted April 12, 2014 Thank you jdelaney your contribution. Could not Figure it myself proper 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