Also, ich habe ein Problem und zwar versuche ich etwas zu Downloaden und dabei soll mir in einem TrayTip angezeigt werden, wieviele Bytes schon runtergeladen wurden. Wenn ich das Script aber testen will, kommt immer folgende Fehlermeldung:
ERROR: undefined macro
Download
-
- [ gelöst ]
-
Ineluki -
25. März 2010 um 10:50 -
Geschlossen -
Erledigt
-
-
welches script?
-
[autoit]
Case $Button1
[/autoit]
$Download = InetGet ( "http://etheria.igame-network.de/etheria/MythsOfEtheria.exe" ,"MythsOfEtheria.exe" , 1 , 1 )
While @InetGetActive
TrayTip("Download", "Bytes = " & @InetGetBytesRead, 10, 16)
Sleep(250)
Wend -
@Inetgetactive gibt es nicht mehr, stattdessen Ingetgetinfo:
Spoiler anzeigen
[autoit]Local $hDownload = InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @TempDir & "\update.dat", 1, 1)
[/autoit]
$size = InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat")
Do
Sleep(10)
$Bytes = InetGetInfo($hDownload, 0)
$info = Round($Bytes / $size, 0) * 100 & @CRLF & $Bytes & " / " & $size
TrayTip("Download", "Percent: " & $info, 1)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $aData = InetGetInfo($hDownload) ; Get all information.
InetClose($hDownload) ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $aData[0] & @CRLF & _
"Size: " & $aData[1] & @CRLF & _
"Complete?: " & $aData[2] & @CRLF & _
"Successful?: " & $aData[3] & @CRLF & _
"@error: " & $aData[4] & @CRLF & _
"@extended: " & $aData[5] & @CRLF) -
@inetGetBytesRead kennt er nicht.
Ich würde behaupten du müsstest erst über InetGetInfo() den Rückgabewert von InetGet() auswerten und das erste element im array gibt dir die aktuelle bytezahl an.
Sprich sowas:
[autoit]
[/autoit]
$DownloadInfo = InetGetInfo($Download)
TrayTip("Download", "Bytes = " & $DownloadInfo[0], 10, 16)wäre jetzt mein Vorschlag.
-
Klappt jetzt, Danke