Jump to content

Lottery Analyzer


Valuater
 Share

Recommended Posts

Good Luck!!!

#include <GUIConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <INet.au3>

Dim $Title = "Lottery Analyzer"
Dim $Progress[21], $Label[21], $_Label[21], $R[7], $L[48], $LC[48], $Plist[8], $Pwin[49], $Fpick[8], $Fwin[49]
Dim $Quick_pick, $DInput, $NInput, $QWinner, $Form, $Form_[100], $msg[100], $line[11]
Dim $Draws, $Views, $Lot, $Progress1, $Form2, $Mega = 0, $Edit, $display, $level = "", $Fnum

$My_list = GUICreate($Title & "  -  My Numbers", 350, 340, 10, 10, $WS_POPUP + $WS_CAPTION)
$display = GUICtrlCreateEdit("", 10, 10, 330, 280)
GUICtrlSetFont(-1, 9, 400)
$Print = GUICtrlCreateButton("&Print File", 70, 300, 70, 30)
$delete = GUICtrlCreateButton("&Delete File", 140, 300, 70, 30)
$closer = GUICtrlCreateButton("&Close", 210, 300, 70, 30)
Set_My_Numbers()
GUISetState(@SW_HIDE)

$Form2 = GUICreate($Title, 580, 466, 120, 100)
$B_oIE2 = ObjCreate("Shell.Explorer.2")
$Breaktime2 = GUICtrlCreateObj($B_oIE2, -185, -250, 600, 590)
$B_oIE2.navigate ("http://www.calottery.com/Games/SuperLottoPlus/WinningNumbers/")

$Edit = GUICtrlCreateList("0000 - Draw Results History", 10, 345, 300, 120)
If FileExists(@TempDir & "\Lotto.dat") Then
    Dim $aRecords
    If Not _FileReadToArray(@TempDir & "\Lotto.dat", $aRecords) Then
        MsgBox(4096, "Error", " Error reading log to Array     error:" & @error)
        Exit
    EndIf
    For $x = 1 To $aRecords[0] - 1
        If $x <= 3 Then ContinueLoop
        $text = StringStripWS($aRecords[$x], 6)
        $text = StringSplit($text, " ")
        GUICtrlSetData($Edit, $text[1] & "  " & $text[2] & "  " & $text[3] & "  " & $text[4] & "  " & $text[5] & "  " & $text[6] & "  " & $text[7] & "  " & $text[8] & "|", 1)
    Next
EndIf
GUICtrlCreateGroup("Lotto History Analysis", 430, 15, 140, 325)
$MYInput = GUICtrlCreateButton("My Numbers", 450, 45, 100, 20)
$NInput = GUICtrlCreateCombo("Top Numbers", 450, 80, 100, 20)
GUICtrlSetData(-1, "5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20")
$DInput = GUICtrlCreateCombo("# of Draws", 450, 115, 100, 20)
GUICtrlSetData(-1, "5|10|20|50|100|200|300|400|500")
$VNumbers = GUICtrlCreateButton("&View Numbers", 450, 155, 100, 30)
$VMega = GUICtrlCreateButton("&Mega Numbers", 450, 200, 100, 30)
$VHistory = GUICtrlCreateButton("&Get History", 450, 245, 100, 30)
$VWinners = GUICtrlCreateButton("Get &Winners", 450, 290, 100, 30)
$VQuick = GUICtrlCreateButton("&Quick Pick", 450, 410, 100, 30)
$QWinner = GUICtrlCreateLabel($Quick_pick, 345, 375, 200, 35)
GUICtrlSetFont(-1, 10, 700)
GUICtrlCreateGroup(" Quick Pick ", 320, 345, 250, 110)
GUISetState(@SW_SHOW)

While 3
    $msg3 = GUIGetMsg()
    
    If $msg3 = $GUI_EVENT_CLOSE Then
        GUIDelete($Form2)
        ExitLoop
    EndIf
    If $msg3 = $VNumbers Then
        $Lot = 48
        $Mega = 0
        Show_Data()
    EndIf
    If $msg3 = $VWinners Then
        $Lot = 48
        $Mega = 0
        Pick_Winners()
    EndIf
    If $msg3 = $VMega Then
        $Lot = 28
        $Mega = 1
        Show_Data()
        $Mega = 0
    EndIf
    If $msg3 = $VHistory Then
        Get_Data()
    EndIf
    If $msg3 = $VQuick Then
        Randomize()
    EndIf
    If $msg3 = $MYInput Then
        GUISetState(@SW_SHOW, $My_list)
    EndIf
    If $msg3 = $Print Then
        _FilePrint (@ScriptDir & "\My_Numbers.dat")
    EndIf
    If $msg3 = $delete Then
        FileDelete(@ScriptDir & "\My_Numbers.dat")
        GUICtrlSetData($display, "")
        Set_My_Numbers()
    EndIf
    If $msg3 = $closer Then
        GUISetState(@SW_HIDE, $My_list)
    EndIf
WEnd

; ----------------------- Functions --------------------------

Func Get_Data()
    If FileExists(@TempDir & "\Lotto.dat") Then FileDelete(@TempDir & "\Lotto.dat")
    GUICtrlSetData($Edit, "")
    $ProgressA = ProgressOn($Title, "Downloading CA Lottery Data...", "Initializing download...")
    $Size = InetGetSize("http://www.calottery.com/Games/SuperLottoPlus/WinningNumbers/DownloadAllNumbers.htm")
    InetGet("http://www.calottery.com/Games/SuperLottoPlus/WinningNumbers/DownloadAllNumbers.htm", @TempDir & "\Lotto.dat", 0, 1)
    While 3
        ProgressSet((@InetGetBytesRead / $Size) * 100, (@InetGetBytesRead / $Size) * 100 & "% Done.")
        If @InetGetBytesRead = $Size Or @InetGetActive = 0 Then ExitLoop
    WEnd
    ProgressOff()
    Dim $aRecords
    If Not _FileReadToArray(@TempDir & "\Lotto.dat", $aRecords) Then
        MsgBox(4096, "Error", " Error reading log to Array     error:" & @error)
        Exit
    EndIf
    For $x = 1 To $aRecords[0] - 1
        If $x <= 3 Then ContinueLoop
        $text = StringStripWS($aRecords[$x], 6)
        $text = StringSplit($text, " ")
        GUICtrlSetData($Edit, $text[1] & "  " & $text[2] & "  " & $text[3] & "  " & $text[4] & "  " & $text[5] & "  " & $text[6] & "  " & $text[7] & "  " & $text[8] & "|", 1)
    Next
EndFunc   ;==>Get_Data

Func Show_Data()
    If Not FileExists(@TempDir & "\Lotto.dat") Then
        MsgBox(262208, "History Error", ' Please Press "Get History" First   ', 5)
        Return
    EndIf
    GUISetState(@SW_SHOW, $My_list)
    Dim $Draws = GUICtrlRead($DInput)
    Dim $Views = GUICtrlRead($NInput)
    Dim $Tadd = 450 / $Views
    Dim $Top = 10
    $tl = 0
    If $Draws = "" Or $Views = "" Then Return
    If $Views < 5 Or $Views > 20 Then
        MsgBox(262208, "Top Numbers", " 5 Minimum and 20 Maximum   ", 5)
        Return
    EndIf
    If $Draws < 5 Or $Draws > 500 Then
        MsgBox(262208, "Draw History", " 5 Minimum and 500 Maximum   ", 5)
        Return
    EndIf
    $Progress1 = ProgressOn($Title, "Analizing CA Lottery Data...", "Initializing...")
    $Form = $Form + 1
    $Form_3 = GUICreate($Title & "  -     Draws = " & $Draws & "     Top Numbers = " & $Views, 654, 500, 250, 180)
    For $x = 1 To $Views
        $Label[$x] = GUICtrlCreateLabel("Number", 10, $Top, 40, 20)
        $Progress[$x] = GUICtrlCreateProgress(60, $Top + 3, 500, 10)
        GUICtrlSetData(-1, $x)
        $_Label[$x] = GUICtrlCreateLabel($x & " %", 570, $Top, 60, 20)
        $Top = $Top + $Tadd
    Next
    If $Mega = 1 Then
        AnalyzeM()
    Else
        Analyze()
    EndIf
    $LInpit = GUICtrlCreateInput('Click "#" to Add Numbers', 70, 463, 200, 20)
    $LAdd = GUICtrlCreateButton(" Add Numbers to My Numbers", 320, 460, 200, 25)
    GUISetState(@SW_SHOW)
    While 4
        $msg12 = GUIGetMsg()
        If $msg12 = $GUI_EVENT_CLOSE Then
            GUIDelete($Form_3)
            ExitLoop
        EndIf
        If $msg12 = $LAdd Then
            _FileWriteLog(@ScriptDir & "\My_Numbers.dat", GUICtrlRead($LInpit) & @CRLF)
            Set_My_Numbers()
            If $Mega = 1 Then
                _FileWriteLog(@ScriptDir & "\My_Numbers.dat", " ")
                _FileWriteLog(@ScriptDir & "\My_Numbers.dat", " *** " & $Title & " ***")
                _FileWriteLog(@ScriptDir & "\My_Numbers.dat", " ")
            EndIf
        EndIf
        For $z = 1 To $Views
            If $msg12 = $Label[$z] Then
                If $tl = "" Then
                    GUICtrlSetData($LInpit, "")
                    $tl = 1
                EndIf
                $Ltext = GUICtrlRead($LInpit)
                If $Mega = 1 Then
                    GUICtrlSetData($LInpit, $Ltext & "Mega = " & (GUICtrlRead($Label[$z])) & " ")
                Else
                    GUICtrlSetData($LInpit, $Ltext & (GUICtrlRead($Label[$z])) & " ")
                EndIf
                
            EndIf
        Next
    WEnd
EndFunc   ;==>Show_Data

Func Randomize()
    $R[1] = Random(1, 47, 1)
    $R[2] = Random(1, 47, 1)
    $R[3] = Random(1, 47, 1)
    $R[4] = Random(1, 47, 1)
    $R[5] = Random(1, 47, 1)
    $R[6] = Random(1, 27, 1)
    If $R[1] = $R[2] Or $R[1] = $R[3] Or $R[1] = $R[4] Or $R[1] = $R[5] Then Randomize()
    If $R[2] = $R[3] Or $R[2] = $R[4] Or $R[2] = $R[5] Then Randomize()
    If $R[3] = $R[4] Or $R[3] = $R[5] Then Randomize()
    If $R[4] = $R[5] Then Randomize()
    _ArraySort($R, 0, 1, 5)
    GUICtrlSetData($QWinner, "Quick Pick =  " & $R[1] & " " & $R[2] & " " & $R[3] & " " & $R[4] & " " & $R[5] & @CRLF & "Mega = " & $R[6] & " ")
EndFunc   ;==>Randomize

Func Pick_Winners()
    
    Dim $Draws = 5
    Dim $Views = 10
    Dim $Tadd = 250 / $Views
    Dim $Top = 10
    $tl = 0
    $level = 1
    $Progress1 = ProgressOn($Title, "Analizing ...Pick Winners...", "Initializing...")
    $Form = $Form + 1
    $Form_4 = GUICreate($Title & "  -     Pick Winners  Draws = # and picked  Winners = # ", 654, 500, 250, 180)
    For $x = 1 To 7
        $Line[$x] = "" 
        Analyze()
        $Label[$x] = GUICtrlCreateLabel("Draws = " & $Draws & "    " & $line[$x], 10, $Top , 640, 20)
        $Top = $Top + $Tadd
        If $Draws >= 50 Then $Draws = 100
        If $Draws >= 20 And $Draws <= 90 Then $Draws = $Draws + 10
        If $Draws <= 15 Then $Draws = $Draws + 5
        
        $level = $level + 1
    Next
    $Label_F = GUICtrlCreateLabel(" Winners = " & $Fnum , 7, 185, 640, 50, $SS_SUNKEN)
    GUICtrlCreateLabel(" Mega Numbers", 10, 250, 200, 50)
    GUICtrlSetFont(-1, 9, 400)
    $Top = 280
    $level = 1
    $Draws = 5
    $Fnum = ""
    For $x = 1 To 5
        
        $Line[$x] = "" 
        AnalyzeM()
        $Label[$x] = GUICtrlCreateLabel("Draws = " & $Draws & "    " & $line[$x], 10, $Top , 640, 20)
        $Top = $Top + $Tadd
        If $Draws >= 50 Then $Draws = 100
        If $Draws >= 20 And $Draws <= 90 Then $Draws = $Draws + 10
        If $Draws <= 15 Then $Draws = $Draws + 5
        
        $level = $level + 1
    Next
    $Label_F = GUICtrlCreateLabel(" Winners = " & $Fnum , 7, $Top, 640, 30, $SS_SUNKEN)
    
    
    $PInpit = GUICtrlCreateInput('Click "#" to Add Numbers', 70, 463, 200, 20)
    $PAdd = GUICtrlCreateButton(" Add Numbers to My Numbers", 320, 460, 200, 25)
    ProgressOff()
    GUISetState(@SW_SHOW)
    While 5
        $msg14 = GUIGetMsg()
        If $msg14 = $GUI_EVENT_CLOSE Then
            GUIDelete($Form_4)
            $level = ""
            ExitLoop
        EndIf
    WEnd
    #cs
        If $msg14 = $PAdd Then
            _FileWriteLog(@ScriptDir & "\My_Numbers.dat", GUICtrlRead($PInpit) & @CRLF)
            Set_My_Numbers()
        EndIf
        For $z = 1 To $Views
            If $msg14 = $Label[$z] Then
                If $tl = "" Then
                    GUICtrlSetData($PInpit, "")
                    $tl = 1
                EndIf
                $Ltext = GUICtrlRead($PInpit)
                If $Mega = 1 Then
                    GUICtrlSetData($PInpit, $Ltext & "Mega = " & (GUICtrlRead($Label[$z])) & " ")
                Else
                    GUICtrlSetData($PInpit, $Ltext & (GUICtrlRead($Label[$z])) & " ")
                EndIf
                
            EndIf
        Next
    WEnd
    #ce
EndFunc


Func Analyze()
    ProgressSet(20, "20 percent")
    Dim $bRecords
    If Not _FileReadToArray(@TempDir & "\Lotto.dat", $bRecords) Then
        MsgBox(4096, "Error", " Error reading log to Array     error:" & @error)
        Exit
    EndIf
    For $x = 1 To $Draws + 3
        If $x <= 3 Then ContinueLoop
        $text = StringStripWS($bRecords[$x], 6)
        $text = StringSplit($text, " ")
        If 4 * $x = $Draws Then ProgressSet(40, "40 percent")
        If 2 * $x = $Draws Then ProgressSet(60, "60 percent")
        For $t = 1 To $Lot - 1
            $L[$t] = $t
            If $L[$t] = $text[3] Or $L[$t] = $text[4] Or $L[$t] = $text[5] Or $L[$t] = $text[6] Or $L[$t] = $text[7] Then $LC[$t] = $LC[$t] + 1
        Next
    Next
    ProgressSet(80, "80 percent")
    For $j = 1 To $Lot - 1
        $LC[$j] = $LC[$j] & "," & $L[$j]
    Next
    ArraySortNum($LC, 0)
    If $level = "" Then
    For $k = 1 To $Views
        $post = StringSplit($LC[$k], ",")
        GUICtrlSetData($Label[$k], "# " & $post[2])
        GUICtrlSetData($Progress[$k], $post[1])
        GUICtrlSetData($_Label[$k], $post[1] & " Times")
        If $post[1] >= 25 Then GUICtrlSetColor($_Label[$k], 0x8080ff)    ; Blue
        If $post[1] >= 50 Then GUICtrlSetColor($_Label[$k], 0xff0000)    ; Red
    Next
    EndIf
    If $level >= 1 Then
    $it = "#"
    $Plist[$level] = ""
    For $k = 1 To $Views -3
        If $k >= 6 Then $it = "X-"  
        $post = StringSplit($LC[$k], ",")
        $Line[$level] = $Line[$level] & @TAB & $it & $post[2] & "(" & $post[1] & ")" & @TAB 
        If $level = 1 Then $Plist[$level] = $Plist[$level] & $post[1] * 100 & "," & $post[2] & "," 
        If $level = 2 Then $Plist[$level] = $Plist[$level] & $post[1] * 50 & "," & $post[2] & "," 
        If $level = 3 Then $Plist[$level] = $Plist[$level] & $post[1] * 25 & "," & $post[2] & ","  
        If $level = 4 Then $Plist[$level] = $Plist[$level] & $post[1] * 15 & "," & $post[2] & ","   
        If $level = 5 Then $Plist[$level] = $Plist[$level] & $post[1] * 10 & "," & $post[2] & "," 
        If $level = 6 Then $Plist[$level] = $Plist[$level] & $post[1] * 5 & "," & $post[2] & ","  
        If $level = 7 Then $Plist[$level] = $Plist[$level] & $post[1] & "," & $post[2] & "," 
        If $level = 1 Then $Fpick[$level] = $Fpick[$level] & $post[1] & "," & $post[2] & "," 
        If $level = 2 Then $Fpick[$level] = $Fpick[$level] & $post[1] & "," & $post[2] & "," 
        If $level = 3 Then $Fpick[$level] = $Fpick[$level] & $post[1] & "," & $post[2] & ","  
        If $level = 4 Then $Fpick[$level] = $Fpick[$level] & $post[1] & "," & $post[2] & ","   
        If $level = 5 Then $Fpick[$level] = $Fpick[$level] & $post[1] & "," & $post[2] & "," 
        If $level = 6 Then $Fpick[$level] = $Fpick[$level] & $post[1] & "," & $post[2] & ","  
        If $level = 7 Then $Fpick[$level] = $Fpick[$level] & $post[1] & "," & $post[2] & "," 
        
    Next
EndIf
    If $level = 7 Then
        for $r = 1 to 7
        $post = StringSplit($Plist[$r], ",")
        for $x = 2 to 14 step 2
        for $t = 1 to 48
            If $t = $post[$x] Then $Pwin[$t] = $Pwin[$t] + $post[$x -1]  
            Next
        Next
        Next
    $TP = ""
    for $x = 1 to 48
        If $Pwin[$x] <> "" Then $Pwin[$x] = $pwin[$x] & "," & $x
    Next
    ArraySortNum($Pwin, 0)
    $it = "# "
    $Fnum = ""
    for $x = 1 to 10
            If $x = 6 Then $it = "X- "  
            If $x = 6 Then $Fnum = $Fnum & @CRLF & " Extras = "
            $post = StringSplit($Pwin[$x], ",")
            $Fnum = $Fnum & @TAB & $it & $post[2] & " (" & $post[1] & ") " &  @TAB 
    Next
        
    EndIf            
    For $m = 1 To $Lot - 1
        $LC[$m] = ""
    Next
    If $level = "" Then ProgressSet(100, "Done", "Complete")
    If $level <> "" Then ProgressSet(100, "Done", "Level " & $level &" of 14 is Complete")
    Sleep(500)
    If $level = "" Then ProgressOff()
EndFunc   ;==>Analyze

Func AnalyzeM()
    ProgressSet(20, "20 percent")
    Dim $bRecords
    If Not _FileReadToArray(@TempDir & "\Lotto.dat", $bRecords) Then
        MsgBox(4096, "Error", " Error reading log to Array     error:" & @error)
        Exit
    EndIf
    For $x = 1 To $Draws + 3
        If $x <= 3 Then ContinueLoop
        $text = StringStripWS($bRecords[$x], 6)
        $text = StringSplit($text, " ")
        If 4 * $x = $Draws Then ProgressSet(40, "40 percent")
        If 2 * $x = $Draws Then ProgressSet(60, "60 percent")
        For $t = 1 To $Lot - 1
            
            $L[$t] = $t
            If $L[$t] = $text[8] Then $LC[$t] = $LC[$t] + 1
            
            
        Next
    Next
    ProgressSet(80, "80 percent")
    For $j = 1 To $Lot - 1
        ;If StringLen($LC[$j]) = 1 Then $LC[$j] = 0 & $LC[$j]
        $LC[$j] = $LC[$j] & "," & $L[$j]
        
    Next
    ArraySortNum($LC, 0)
    If $level = "" Then
    For $k = 1 To $Views
        $post = StringSplit($LC[$k], ",")
        GUICtrlSetData($Label[$k], "# " & $post[2])
        GUICtrlSetData($Progress[$k], $post[1])
        GUICtrlSetData($_Label[$k], $post[1] & " Times")
        If $post[1] >= 25 Then GUICtrlSetColor($_Label[$k], 0x8080ff)    ; Blue
        If $post[1] >= 50 Then GUICtrlSetColor($_Label[$k], 0xff0000)    ; Red
        
    Next
    EndIf
    If $level >= 1 Then
    $it = "#"
    $Plist[$level] = ""
    For $k = 1 To $Views -3
        If $k >= 6 Then $it = "X-"  
        $post = StringSplit($LC[$k], ",")
        $Line[$level] = $Line[$level] & @TAB & $it & $post[2] & "(" & $post[1] & ")" & @TAB 
        If $level = 1 Then $Plist[$level] = $Plist[$level] & $post[1] * 100 & "," & $post[2] & "," 
        If $level = 2 Then $Plist[$level] = $Plist[$level] & $post[1] * 50 & "," & $post[2] & "," 
        If $level = 3 Then $Plist[$level] = $Plist[$level] & $post[1] * 25 & "," & $post[2] & ","  
        If $level = 4 Then $Plist[$level] = $Plist[$level] & $post[1] * 15 & "," & $post[2] & ","   
        If $level = 5 Then $Plist[$level] = $Plist[$level] & $post[1] * 10 & "," & $post[2] & "," 
        If $level = 6 Then $Plist[$level] = $Plist[$level] & $post[1] * 5 & "," & $post[2] & ","  
        If $level = 7 Then $Plist[$level] = $Plist[$level] & $post[1] & "," & $post[2] & "," 
        
    Next
EndIf
    If $level = 5 Then
        for $a = 1 to 28
            $Pwin[$a] = ""
        Next
        for $z = 1 to 6
        $post = StringSplit($Plist[$z], ",")
        $post2 = StringSplit($Plist[$z+1], ",")
        For $r =  2 to 14 Step 2
        For $y =  2 to 14 Step 2
        for $a = 1 to 27
            If $post[$r] = $a And $post2[$y] = $a Then
                If $Pwin[$a] = "" Then
                    $Pwin[$a] = $Pwin[$a] + $post[$r -1] + $post2[$y -1]
                Else
                    $Pwin[$a] = $Pwin[$a] + $post2[$y -1]
                EndIf
            EndIf
        Next
        Next
    Next
    Next
        $post = StringSplit($Plist[1], ",")
        for $x = 2 to 14 step 2
        for $t = 1 to 28
            If $Pwin[$t] = "" And $t = $post[$x] Then $Pwin[$t] = $post[$x -1]  
            Next
        Next
    $TP = ""
    for $x = 1 to 28
        If $Pwin[$x] <> "" Then $Pwin[$x] = $pwin[$x] & "," & $x
    Next
    ArraySortNum($Pwin, 0)
    $it = "# "
    $Fnum = ""
    for $x = 1 to 5
            If $x = 6 Then $it = "X- "  
            If $x = 6 Then $Fnum = $Fnum & @CRLF & " Extras = "
            $post = StringSplit($Pwin[$x], ",")
            $Fnum = $Fnum & @TAB & $it & $post[2] & " (" & $post[1] & ") " &  @TAB 
    Next
        
    EndIf            
    If $level = "" Then ProgressSet(100, "Done", "Complete")
    If $level <> "" Then ProgressSet(100, "Done", "Level " & $level &" of 14 is Complete")
    Sleep(500)
    If $level = "" Then ProgressOff()
    For $m = 1 To $Lot - 1
        $LC[$m] = ""
    Next
EndFunc   ;==>AnalyzeM

Func Set_My_Numbers()
    GUICtrlSetData($display, "")
    If Not FileExists(@ScriptDir & "\My_Numbers.dat") Then
        _FileWriteLog(@ScriptDir & "\My_Numbers.dat", " *** " & $Title & " ***")
        _FileWriteLog(@ScriptDir & "\My_Numbers.dat", " ")
    EndIf
    Dim $cRecords
    If Not _FileReadToArray(@ScriptDir & "\My_Numbers.dat", $cRecords) Then
        MsgBox(4096, "Error", " Error reading log to Array     error:" & @error)
        Exit
    EndIf
    For $x = 1 To $cRecords[0]
        GUICtrlSetData($display, $cRecords[$x] & @CRLF, 1)
    Next
EndFunc   ;==>Set_My_Numbers

Func ArraySortNum(ByRef $nArray, $Ascending = 0, $Start = 1)
    For $i = $Start To UBound($nArray) - 2
        Local $SE = $i
        If $Ascending = 0 Then
            For $x = $i To UBound($nArray) - 1
                If Number($nArray[$SE]) < Number($nArray[$x]) Then $SE = $x
            Next
        Else
            For $x = $i To UBound($nArray) - 1
                If Number($nArray[$SE]) > Number($nArray[$x]) Then $SE = $x
            Next
        EndIf
        Local $HLD = $nArray[$i]
        $nArray[$i] = $nArray[$SE]
        $nArray[$SE] = $HLD
    Next
EndFunc
Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

The Proof is in the Pudding!!!!!

lottery Results Saturday Feb 11, 2006

4 12 20 32 36 Mega = 10

per my program

top5 Numbers of last 20 draws

#4 #20 #3 #43 #36 .... no favorite mega number due to 1 time each in last 20 draws

number of times drawn

6- 6- 5- 4- 4-

$1 bet

$10.00 winner

8)

NEWHeader1.png

Link to comment
Share on other sites

  • 6 months later...
  • 2 weeks later...

I modified the script to work for the Mega Millions..

Winning Numbers:

10,12,22,44,48 Mega Ball = 16

My Numbers:

36, 14, 27, 31, 7 Mega Ball = 20

Yes, the proof is in the pudding. Maybe i was doing something wrong, no?

Care to share your script?

Thanks

Link to comment
Share on other sites

  • 2 years later...

Oh crap, sorry about bumping such an old post!

Thats okay. @valuater won't mind. He's already made is multi-millions and moved on.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • 3 months later...

I get error running this:

*****\lotto.au3 (11) : ==> Variable used without being declared.:

$My_list = GUICreate($Title & " - My Numbers", 350, 340, 10, 10, $WS_POPUP + $WS_CAPTION)

$My_list = GUICreate($Title & " - My Numbers", 350, 340, 10, 10, ^ ERROR

Link to comment
Share on other sites

Add the following to the top of the script:

#include <WindowsConstants.au3>
#include <StaticConstants.au3>

WBD

Link to comment
Share on other sites

  • 11 years later...
  • Developers

mmm..  posting a "make me a script" request in a 14 years old topic?
What have you tried that isn't working?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...