Jump to content

--


Recommended Posts

Stringbetween returns an ARRAY :) so:

$PercentCompleted = _StringBetween($readstream, ". ", "% ")

$PercentCompleted = $PercentCompleted [0]

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

If $VelocidadDeDescarga[0] = 0 Then

??

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Try for debugging a func like this

$sWGetDir = @TempDir
$sDestDir = 'C:\Downloads'
$urlVideo = 'http://dl.video/watchme.avi'


$pidWGet = Run($sWGetDir & '\wget.exe -c -P"' & $sDestDir & '" "' & $urlVideo & '"')

$sReadOutput = StreamRead($pidWGet)
If $sReadOutput Then
    $RemainingTime = _StringBetween($readstream, 'K ', 's')
    GUICtrlSetData($TextoTiempoRestante, $RemainingTime & " sec")
   
    $DownloadSpeed = _StringBetween($readstream, '%  ', 'K ')
    GUICtrlSetData($TextoVelocidad, $DownloadSpeed & " Kb/s")
   
    $PercentCompleted = _StringBetween($readstream, ". ", "%  ")
    GUICtrlSetData($TextoPorcientoCompletado, $PercentCompleted & "%")
    GUICtrlSetData($DownloadProgressBar, $PercentCompleted)
EndIf

    

Func StreamRead($PID)
    
    While True
        
        $line = StdoutRead($PID)
        If @error Then ExitLoop
        ConsoleWrite('StdoutRead: ' & $line)
        
    WEnd
    
    While True
        
        $line = StderrRead($PID)
        If @error Then ExitLoop
        ConsoleWrite('StderrRead: ' & $line)
        
    WEnd
    
    Return $line
    
EndFunc

and look what you get from the stream, I will try it also, but a liitle bit later, today.

Maybe at today's evening I can tell you more ... :)

Greetz

Greenhorn

Link to comment
Share on other sites

  • 4 months later...

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...