Jump to content
Sign in to follow this  
bobbby

Update checking with InetGetInfo()

Recommended Posts

bobbby

Why doesn't the InetGetInfo() work correctly?

When @InetGetActive was in Autoit, it worked. But now it's problem with "InetGetInfo()"

In the helpfile it says that it should be an array. But it doesn't.

How can i fix it, too work?

;Check for update

$url = "http://upit.cc/images/79807efd.png"

$sizeCompare1 = filegetsize("update.dat")
$sizeCompare2 = inetgetsize($url,1)

if $sizeCompare2 > $sizeCompare1 Then

    ProgressOn("Update Check", "Downloading", "0 %")
    $download = inetget($url,"update.dat",1)
Else
    Exit
EndIf

; I had this code before. But it doesn't work longer, because @InetGetActive is InetGetInfo()
;
;While @InetGetActive
;
;   $fuu = @InetGetBytesRead / $size * 100
;   ProgressSet( floor($fuu), floor($fuu) & " %")
;   sleep(100)
;
;Wend

do

    sleep(100)

    $Data = InetGetInfo($download)
    $fuu = $data[0] / $sizeCompare2 * 100

    ProgressSet( floor($fuu), floor($fuu) & " %")

until InetGetInfo($Download, 2)


ProgressSet(100 , "Done", "Complete")
ProgressOff()
InetClose($sizeCompare1)
InetClose($sizeCompare2)
InetClose($download)

Share this post


Link to post
Share on other sites
Fulano

Just thinking out loud, but wouldn't something like this be better than requesting the whole array:

$fuu = InetGetInfo($download) / $sizeCompare2 * 100
if @error then ConsoleWrite ("Error in download: " & InetGetInfo ($download, 4) & @LF)

Edited by Fulano

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Share this post


Link to post
Share on other sites
bobbby

Just thinking out loud, but wouldn't something like this be better than requesting the whole array:

$fuu = InetGetInfo($download) / $sizeCompare2 * 100
if @error then ConsoleWrite ("Error in download: " & InetGetInfo ($download, 4) & @LF)

Yeh, but i get nothing now. I don't know why.

Without the calculation and with.

The @InetGetBytesRead gave me x bytes readed before, and InetGetInfo() gives me nothing.

Edit:

I have fixed it now, added this instead. Works good. But not perfect.

$fuu = InetGetInfo($download, 0)

$down = floor($fuu / $sizeCompare2 * 100)

Edited by bobbby

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.