|
Ciao Gam, questo è lo script che avevo fatto alcuni anni fa. E' particolarmente INDICATO PER I VECCHI PCche non sono in grado di gestire il protocollo https. Permette di AGGIORNARE ed allineare l' ARCHIVIO LOTTOe gli archivi paralleli anche quando mancano MOLTE ESTRAZIONI. Option Explicit Sub Main 'Script By Joe 'https://lottogam.forumfree.it/?t=78437103 Dim sFileLoc Dim nEstrTot,sDataLastEstr,k,r,e Dim sDataEstr,nNumEstr,nSalvate Dim b Dim sFileBd Dim sLink Dim Ia,N,sVV,x Dim CfrData sLink = "http://www.lottogam.it/ArchivioTelevideo1945test.txt" b = False : N = False nSalvate = 0 sFileBd = GetDirectoryAppData & "BaseDati.dat" sFileLoc = GetDirectoryAppData & "temp\" If CreaDirectory(sFileLoc) Then sFileLoc = sFileLoc & "Estrazioni.txt" If DownloadFromWeb(sLink,sFileLoc) Then nEstrTot = EstrazioniArchivio sDataLastEstr = DataEstrazione(nEstrTot,,,"/") Ia = IndiceAnnuale(nEstrTot) ReDim aRighe(0) Call LeggiRigheFileDiTesto(sFileLoc,aRighe) For k = 0 To UBound(aRighe) ReDim aV(0) Call SplitByChar(aRighe(k),"-",aV) If Len(aRighe(k)) = 120 Then If UBound(aV) = 2 Then sDataEstr = Replace(Left(aRighe(k),10),"-","/") sVV = Right(aRighe(k),110) If b Then If N = False And(Right(sDataEstr,4) <> Right(sDataLastEstr,4)) Then Ia = 0 : N = True If Left(sDataEstr,4) <> Left(sDataLastEstr,4) Then Ia = Ia + 1 nNumEstr =(Ia) If nNumEstr > 0 And IsDate(sDataEstr) Then ReDim aEstr(11,5) r = 1 : e = 0 For x = 1 To 110 Step 2 e = e + 1 aEstr(r,e) = Mid(sVV,x,2) If e = 5 Then r = r + 1 : e = 0 Next If CfrData <> Left(sDataEstr,5) Then If SalvaEstrazione(aEstr,sDataEstr,nNumEstr,sFileBd) Then CfrData = Left(sDataEstr,5) nSalvate = nSalvate + 1 Call Messaggio(nSalvate) End If Else ColoreTesto 2 Scrivi "ATTENZIONE " & sDataEstr & " ESTRAZIONE DUPLICATA",True ColoreTesto 0 End If End If End If End If If sDataEstr = sDataLastEstr Then b = True End If End If Next If nSalvate > 0 Then AllineaArchivi Else MsgBox "Errore download verificare il link con il browser" End If Call Scrivi("Sono state aggiunte " & nSalvate & " estrazioni") Call Scrivi("") Call Scrivi("Estrazioni totali " & QuantitaEstrazioniInFile(sFileBd)) Call Scrivi("") Call Scrivi("Utilizzato archivio del sito " & Left(sLink,23)) Call Scrivi("") End If End Sub
|