walle Posted February 10, 2008 Posted February 10, 2008 (edited) Basically, this code grabs information from a specified torrent in Utorrent and then writes the data to a stream(consolewrite). Everything works great, except the last part where I'm trying to split the data into arrays and then post it in labels. Can anyone lend a hand? expandcollapse popup#include <GuiListView.au3> #include <String.au3> #include <Array.au3> #RequireAdmin $title = "[REGEXPTITLE:Torrent.\d+.*$]" $listcontrol = "[CLASSNN:SysListView321]" $hWnd = ControlGetHandle( $title, "", $listcontrol ) $header_hWnd = _GUICtrlListView_GetHeader($hWnd) $Torrentname = "AUTOIT.2008" $FindTN = _GUICtrlListView_FindInText($HWND, $READRSS) $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 Next Next For $c = 0 To $ccount-1 ConsoleWrite($listarray[$c][0]) For $i = 0 To $icount-1 ConsoleWrite($listarray[$c][$i+1]) Next ConsoleWrite("|") Next $myArray = StringSplit($?, "|") ; This part and down GUICtrlSetData($LABEL4,"Torrent name:" & ' ' & $myArray [?]) GUICtrlSetData($LABEL1,"Size:" & ' ' & $myArray [?]) GUICtrlSetData($LABEL5,"Statusr:" & ' ' & $myArray [?]) GUICtrlSetData($LABEL11,"Downloadspeed:" & ' ' & $myArray [?]) The output AUTOIT.2008|3|4.38 GB|0.4 %|Downloading|24 (425)|1 (74)|915.7 kB/s|0.9 kB/s|2h 19m|0.0 kB|0.000|24.034||2008-02-10 16:20:20|| Edited February 10, 2008 by walle
Bowmore Posted February 10, 2008 Posted February 10, 2008 Basically, this code grabs information from a specified torrent in Utorrent and then writes the data to a stream(consolewrite). Everything works great, except the last part where I'm trying to split the data into arrays and then post it in labels. Can anyone lend a hand? expandcollapse popup#include <GuiListView.au3> #include <String.au3> #include <Array.au3> #RequireAdmin $title = "[REGEXPTITLE:Torrent.\d+.*$]" $listcontrol = "[CLASSNN:SysListView321]" $hWnd = ControlGetHandle( $title, "", $listcontrol ) $header_hWnd = _GUICtrlListView_GetHeader($hWnd) $Torrentname = "AUTOIT.2008" $FindTN = _GUICtrlListView_FindInText($HWND, $READRSS) $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 Next Next For $c = 0 To $ccount-1 ConsoleWrite($listarray[$c][0]) For $i = 0 To $icount-1 ConsoleWrite($listarray[$c][$i+1]) Next ConsoleWrite("|") Next $myArray = StringSplit($?, "|") ; This part and down GUICtrlSetData($LABEL4,"Torrent name:" & ' ' & $myArray [?]) GUICtrlSetData($LABEL1,"Size:" & ' ' & $myArray [?]) GUICtrlSetData($LABEL5,"Statusr:" & ' ' & $myArray [?]) GUICtrlSetData($LABEL11,"Downloadspeed:" & ' ' & $myArray [?])oÝ÷ Ù8^¢ëiº×(uàLâÛM "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now