Ruud0209 Posted May 21, 2008 Posted May 21, 2008 Hello, I think the title says it all. Is it possible to check an array for double values or did I miss something, anyway I don't know how to achieve this... regards, Ruud
someone Posted May 21, 2008 Posted May 21, 2008 (edited) Check out the script in the first post Click me Edited May 21, 2008 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
monoceres Posted May 21, 2008 Posted May 21, 2008 The above post will work fine, but here's a more optimized version dim $array[69]=[3,4,5,2,3,5] dim $array2[1] For $i=0 To UBound($array)-1 For $j=0 To Ubound($array2)-1 If $array[$i]=$array2[$j] Then ContinueLoop 2 Next ReDim $array2[Ubound($array2)+1] $array2[Ubound($array2)-1]=$array[$i] Next Broken link? PM me and I'll send you the file!
Moderators SmOke_N Posted May 21, 2008 Moderators Posted May 21, 2008 http://www.autoitscript.com/forum/index.ph...mp;#entry245675 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Ruud0209 Posted May 21, 2008 Author Posted May 21, 2008 Hello again I'm not quite sure how to use this i'm afraid. Well I know a littlebit how to use it but i dont get the array2 error i'm getting C:\Program Files\AutoIt3\Projects\gofish\gofish2.au3 (39) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: If $players[$i]=$array2[$j] Then ContinueLoop 2 If $players[$i]=^ ERROR Since you know my previous script (it has all the players in an array) but i want them unique now, so I can create a listbox with it. expandcollapse popup#include <File.Au3> #include <array.au3> AutoItSetOption("trayicondebug",1) Dim $players[1]=[0] $files=_FileListToArray("C:\Program Files\PokerStars\HandHistory\Exclusive\","*",1) Dim $latest, $latestdate=-1 For $i=1 To UBound($files)-1 $temp=FileGetTime("C:\Program Files\PokerStars\HandHistory\Exclusive\" & $files[$i],1,1) ;Msgbox(1,"info",$temp & " - : - " & $files[$i]) If $latestdate=-1 Or $temp>$latestdate Then $latest=$files[$i] $latestdate=$temp ; MsgBox(1,"info","Latest = " & $latest & " latestdate = " & $temp & " - : - " & $latestdate ) EndIf Next MsgBox(1,"File is",$latest ) $handle=FileOpen("C:\Program Files\PokerStars\HandHistory\Exclusive\" & $latest,0) If @error Then MsgBox(1,"Error","") Do $temp=FileReadline($handle) ;Msgbox(1,"Error",@error) If @error = -1 Then ExitLoop If StringLeft($temp,4)="seat" Then ReDim $players[Ubound($players)+1] ;MsgBox("1","info",$players) $data=StringMid($temp,StringInStr($temp,":")+2,StringInstr(StringTrimLeft($temp,6),")")) $players[UBound($players)-1]=StringLeft($data,StringInStr($data," ")-1) EndIf Until False ;_ArrayReverse($players) ;dim $array[69]=[3,4,5,2,3,5] dim $array2[1] For $i=0 To UBound($players)-1 For $j=0 To Ubound($players)-1 If $players[$i]=$array2[$j] Then ContinueLoop 2 Next ReDim $array2[Ubound($array2)+1] $array2[Ubound($array2)-1]=$players[$i] Next _ArrayDisplay($array2)
monoceres Posted May 21, 2008 Posted May 21, 2008 Change $Player to $array2 in the Ubound() func in the second for loop Broken link? PM me and I'll send you the file!
Ruud0209 Posted May 21, 2008 Author Posted May 21, 2008 Brilliant ! kudos for you man. Change $Player to $array2 in the Ubound() func in the second for loop
Ruud0209 Posted May 24, 2008 Author Posted May 24, 2008 Script has been added to the example scripts forumthingy as its kind of OK now thanks for all your help !http://www.autoitscript.com/forum/index.php?showtopic=71978
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