walle Posted February 11, 2008 Report Posted February 11, 2008 I'm programming a small script that monitoring a specified active torrent. I have recently notice that the utorrent interface doesn't refresh whenUtorrent is minimized. It makes it very hard to read data. Is there any work around?Here is a small part of my script. As you can see, it worksperfectly except when utorrent is minimized.The script. Works with all versions of Utorrent.http://uploadfile.org/download.php?id=l1QxJ9gTPCQWb6jOZdVMIf you want to complie it yourself, Autoitscript#include <GUIConstants.au3>#include <GuiListView.au3>#include <String.au3>#include <Array.au3>#RequireAdminGUICreate("My GUI") ; will create a dialog box that when displayed is centered$LABEL4 = GUICtrlCreateLabel("Label",0,0,500)$LABEL1 = GUICtrlCreateLabel("Label",0,20,500)$LABEL5 = GUICtrlCreateLabel("Label",0,40,500)$LABEL11 = GUICtrlCreateLabel("Label",0,60,500)$Input = GUICtrlCreateInput("Torrent name",0,100,500)$button = GUICtrlCreateButton("Start Script",0,120)GUISetState (@SW_SHOW) ; will display an empty dialog boxWhile 1 $msg = GUIGetMsg() If $MSG = $button Then $Readinput = GUICtrlRead($Input) Collectdata() EndIf If $msg = $GUI_EVENT_CLOSE Then ExitLoopWendFunc Collectdata()Do$title = "[REGEXPTITLE:Torrent.\d+.*$]"$listcontrol = "[CLASSNN:SysListView321]"$hWnd = ControlGetHandle( $title, "", $listcontrol )$header_hWnd = _GUICtrlListView_GetHeader($hWnd)$FindTN = _GUICtrlListView_FindInText($HWND, $Readinput)$ccount = ControlListView("[REGEXPTITLE:Torrent.\d+.*$]", "", "SysListView321", "GetSubItemCount")$icount = ControlListView("[REGEXPTITLE:Torrent.\d+.*$]", "", "SysListView321", "GetItemCount")Dim $listarray[$ccount][$icount+1]For $c = 0 To $ccount-1 $listarray[$c][0] = _GUICtrlListView_GetItemText($header_hWnd, $c) $Countmore = $icount - $FindTN For $i = $FindTN To $icount-$Countmore $itemtext = _GUICtrlListView_GetItemText($hWnd, $i, $c) $listarray[$c][$i+1] = $itemtext NextNextFor $c = 0 To $ccount-1 ConsoleWrite($listarray[$c][0]) For $i = 0 To $icount-1 ConsoleWrite($listarray[$c][$i+1]) Next ConsoleWrite("|")NextFor $c = 0 To $ccount-1 $tmp = '' For $i = 0 To $icount-1 $tmp &= $listarray[$c][$i+1] Next Switch $c Case 0 GUICtrlSetData($LABEL4,"Torrent name:" & ' ' & $listarray[$c][0] & $tmp) Case 2 GUICtrlSetData($LABEL1,"Size:" & ' ' & $listarray[$c][0] & $tmp) Case 4 GUICtrlSetData($LABEL5,"Statusr:" & ' ' & $listarray[$c][0] & $tmp) Case 7 GUICtrlSetData($LABEL11,"Downloadspeed:" & ' ' & $listarray[$c][0] & $tmp) EndSwitchNextsleep(2000)Until $LABEL11 = 100EndFunc
jewelisheaven Posted February 11, 2008 Report Posted February 11, 2008 ... When there's no window, there's no need to update any display?? Or am I missing something.
walle Posted February 11, 2008 Author Report Posted February 11, 2008 Nvm, I will try to fetch the data via memory.
Ultima Posted February 12, 2008 Report Posted February 12, 2008 He'd have one hell of a time decoding JSON with AutoIt though. I'd know, because I wrote one before (a slow one at that) ;D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.