abaddon7734
Members-
Posts
18 -
Joined
abaddon7734's Achievements
Seeker (1/7)
1
Reputation
-
GoogleGonnaSaveUs reacted to a post in a topic: GUICtrlCreateLabel or GUICtrlSetData: Word wrap even with no white spaces?
-
detecting network inactivity
abaddon7734 replied to abaddon7734's topic in AutoIt General Help and Support
I tried the udf in the link and the Perfcounters udf of the same author. But, i got some basic doubts, if you dont mind : In general, the "bytes received and sent" of any monitoring program output like netstat -e, keep adding up (even when disconnected) right? So how can i find out if there is actual internet usage happening: from simple browsing to huge downloads, excluding hidden background usage? I believe this has something to do with bytes and time. For example: If there is significant change in bytes in a second or so, there is internet activity going on. If there is insignificant change in bytes per second or so, no activity is on, internet connection is idle. Is this the right approach? In simple terms, im trying to make a program that will check if internet is connected but idle or in use. Please give your ideas.- 3 replies
-
- internet idlenetwork idle
- inactivity
- (and 5 more)
-
Is it possible to detect network or internet inactivity, that is, if a user is not uploading or downloading anything. For example, if you want to automatically disconnect the internet or close a program if there are no active downloads?
- 3 replies
-
- internet idlenetwork idle
- inactivity
- (and 5 more)
-
This is exactly what i was afraid of! This script is working for system with single Hard drive. An output of RunWait(@ComSpec & " /c " & 'wmic diskdrive get PNPDeviceID, size /format:csv | find /v "USBSTOR" > wmic.txt', @ScriptDir, @SW_HIDE) will yield output like: Node,PNPDeviceID,Size X-7068F8D674B94,IDE\DISKST500DM002-1BD142_______________________KC44____\5&2BEE401B&0&0.0.0,500105249280 from which we have to get the size part: 500105249280 But assuming there is a second internal hard drive, output will be like: Node,PNPDeviceID,Size X-7068F8D674B94,IDE\DISKST500DM002-1BD142_______________________KC44____\5&2BEE401B&0&0.0.0,500105249280 X-7068F8D674B94,IDE\DISKST500DM002-1BD142_______________________KC44____\5&2BEE401B&0&0.0.0,1000194048000 from which we will have to get 500105249280 + 1000194048000 Hmmmm
- 12 replies
-
- External hard drives
- Fixed
-
(and 5 more)
Tagged with:
-
abaddon7734 reacted to a post in a topic: Detecting External Hard Drives
-
abaddon7734 reacted to a post in a topic: Detecting External Hard Drives
-
@wakillon Ah! Stdout and Pid! No more garbage output! @careca Its not working? What is your OS and is wmic enabled and working in your system? And tried the code posted by wakillon ?
- 12 replies
-
- External hard drives
- Fixed
-
(and 5 more)
Tagged with:
-
! Is there any way to test if wmi is enabled and working?Thanks, your UDF is cool!
- 12 replies
-
- External hard drives
- Fixed
-
(and 5 more)
Tagged with:
-
abaddon7734 reacted to a post in a topic: Detecting External Hard Drives
-
abaddon7734 reacted to a post in a topic: Detecting External Hard Drives
-
abaddon7734 reacted to a post in a topic: Detecting External Hard Drives
-
I had problem differentiating drives of system and External drives as they're both of same type - "FIXED" when using DriveGetDrive and DriveGetType, so managed to make a small script to detect External ones. Im a newb, so you may will find silly, unnecessary code which could have been done better with smart work instead of hard work, if you know what i mean #include <Array.au3> Local $drivelist = DriveGetDrive("FIXED"), $addspace = 0, $getspace, $systemdrives, $externaldrives ;~ _ArrayDisplay($drivelist) findexthdd() Func findexthdd() RunWait(@ComSpec & " /c " & 'wmic diskdrive get PNPDeviceID, size /format:csv | find /v "USBSTOR" > wmic.txt', @ScriptDir, @SW_HIDE) $file = FileOpen("wmic.txt") $readfile = FileRead($file) $readfile = StringSplit($readfile, ",") ;~ _ArrayDisplay($readfile) $last = $readfile[0] $totalsize = $readfile[$last] $totalsize = $totalsize / 1024 / 1024 / 1024 ;MB Do Local $c = 1 $totalsize = StringTrimRight($totalsize, $c) $c = $c + 1 $return = StringInStr($totalsize, ".") Until $return = 0 $return = 1 For $w = 1 To UBound($drivelist) - 1 $getspace = DriveSpaceTotal($drivelist[$w]) / 1024 Do Local $z = 1 $getspace = StringTrimRight($getspace, $z) $z = $z + 1 $return = StringInStr($getspace, ".") Until $return = 0 $addspace += $getspace If $addspace <= $totalsize Then ;463 vs 465 $systemdrives &= $drivelist[$w] & "," Else ;~ MsgBox(0, "", $drivelist[$w] & " is the f****** external hard drive!") $externaldrives &= $drivelist[$w] & "," EndIf Next $systemdrives = StringTrimRight($systemdrives, 1) $systemdrives = StringSplit($systemdrives, ",") _ArrayDisplay($systemdrives, "SYSTEM DRIVES LIST") $externaldrives = StringTrimRight($externaldrives, 1) $externaldrives = StringSplit($externaldrives, ",") _ArrayDisplay($externaldrives, "EXTERNAL DRIVES LIST") EndFunc ;==>findexthdd
- 12 replies
-
- External hard drives
- Fixed
-
(and 5 more)
Tagged with:
-
Fade With WallPaper Changer
abaddon7734 replied to PhoenixXL's topic in AutoIt General Help and Support
Not sure if this will work but here's an idea: There's a wallpaper slideshow feature in windows 7 right? http://www.withinwindows.com/2008/11/03/windows-7-to-let-users-create-a-desktop-slideshow-from-files-rss-feeds/ Make/Get a pitch black image. For the fade in effect, get the current wallpaper to fade in to the black image, via desktop slideshow. Current image to black image. For the fade out effect, set slideshow from black image to new wallpaper image. Finally Disable slideshow.I think the minimum interval of change is 10 seconds, but if it isnt smooth, you can try the different slideshow transition durations to see which AnimationDuration is smooth for the fade: http://www.winhelponline.com/blog/windows7-desktop-slideshow-animation-duration/ Also note that if the user has disabled Visual effect: Animate controls and elements inside windows in System Properties > Advanced tab > Performance Options, the fade wont work! Dont have win7 so culdnt try myself -
abaddon7734 reacted to a post in a topic: GUICtrlCreateLabel or GUICtrlSetData: Word wrap even with no white spaces?
-
abaddon7734 reacted to a post in a topic: GUICtrlCreateLabel or GUICtrlSetData: Word wrap even with no white spaces?
-
roman, The GuiCtrlCreateLabel can have width and height parameters (kind of like invisible borders) . So if you set it with a width less than the main window's width, it will automatically wrap fit. Also you have to set appropriate height so that when the text wrap falls into new lines, it shows. If you want to manually make a new line from anywhere in the text, use the @LF line feed macro. See this example: #include <Constants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> GUICreate("Window size: 300x300", 300, 300) GUISetState() GUICtrlCreateLabel("Label with width more than window: 500", 20, 20, 250) GUICtrlSetFont(-1, 8.5, 600) GUICtrlCreateLabel("", 20, 40, 500, 400) GUICtrlSetData(-1, "C:Documents and SettingsusernameApplication DataNokiaPCSyncSynchDataBackups1232012") GUICtrlCreateLabel("Label with small width less than window: 260", 20, 100, 260) GUICtrlSetFont(-1, 8.5, 600) GUICtrlCreateLabel("", 20, 120, 260, 500) GUICtrlSetData(-1, "C:Documents and SettingsusernameApplication DataNokiaPCSyncSynchDataBackups1232012") GUICtrlCreateLabel('Label with manual line feed "@LF" ', 20, 180, 250) GUICtrlSetFont(-1, 8.5, 600) GUICtrlCreateLabel("", 20, 200, 500, 500) GUICtrlSetData(-1, "C:Documents and Settingsusername" & @LF & "Application DataNokiaPCSync" & @LF & "SynchDataBackups1232012") While 1 $msg=GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd You can also create different styles of actual frames for labels and also align and justify text with labels. See http://www.autoitscript.com/autoit3/docs/appendix/GUIStyles.htm#Label for more info
-
Melba, You are awesome! Thanks a lot for this one! One doubt, what does Direct mode of parsing do?
-
hello au3pros, regarding this topic in wiki: Adding UDFs to AutoIt and SciTE http://www.autoitscript.com/wiki/Adding_UDFs_to_AutoIt_and_SciTE One has to do some procedures each time for each udf right? Is there a udf installer kind of thing out there that can create necessary files with data, scan functions and their explanations out of udfs and set the required paths for autoit and scite? I think this is something close to what im talking about: http://www.autoit.de/index.php?page=Thread&threadID=16954 But its a different language interface PS: not that im being too lazy or something, i just think it'll be cool if there was something like this
-
Listview dependant filters
abaddon7734 replied to abaddon7734's topic in AutoIt General Help and Support
Sorry for not posting code. In essence its a "range filter". But Now I almost got it working. Forgot that parentheses are required to group And in If. However there's one little problem. #include <ComboConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ListviewConstants.au3> #include <StaticConstants.au3> #include <Guilistview.au3> #include <ButtonConstants.au3> #include <Array.au3> GUICreate("") GUISetState() Global $items = " |1|2|3|4|5|6|7" Global $lv, $rowdata $lv = GUICtrlCreateListView("digits", 50, 50, 49, 140, -1, $LVS_EX_GRIDLINES) GUICtrlCreateLabel("Min: ", 134, 58, 25) GUICtrlCreateLabel("Max: ", 224, 58) $clear = GUICtrlCreateButton(" clear ", 320, 53) $filter_min = GUICtrlCreateCombo("", 168, 55, 40) $filter_max = GUICtrlCreateCombo("", 258, 55, 40) GUICtrlSetData($filter_min, $items) GUICtrlSetData($filter_max, $items) For $i = 1 To 7 GUICtrlCreateListViewItem($i, $lv) Next Local $itemcount = _GUICtrlListView_GetItemCount($lv) For $z = 0 To $itemcount - 1 $rowdata &= _GUICtrlListView_GetItemText($lv, $z, 0) & "|" Next $rowdata = StringSplit($rowdata, "|") _ArrayPop($rowdata) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $filter_min, $filter_max filter() Case $clear clear() EndSwitch WEnd Func filter() Local $min = GUICtrlRead($filter_min), $max = GUICtrlRead($filter_max) _GUICtrlListView_DeleteAllItems($lv) For $q = 1 To $rowdata[0] - 1 If ($min <> ' ' And $rowdata[$q] < $min) Then ContinueLoop If ($max <> ' ' And $rowdata[$q] > $max) Then ContinueLoop GUICtrlCreateListViewItem($rowdata[$q], $lv) Next EndFunc ;==>filter Func clear() _GUICtrlListView_DeleteAllItems($lv) For $i = 1 To 7 GUICtrlCreateListViewItem($i, $lv) Next GUICtrlSetData($filter_min, "") GUICtrlSetData($filter_max, "") GUICtrlSetData($filter_min, $items) GUICtrlSetData($filter_max, $items) EndFunc ;==>clear At first run, If you choose empty field (no number) in any combo filter, listview data disappears. But after, if you choose digits, its working. I think there is a conflict with empty data '' and space ' ' in combo filter. I had to add a first space to Global $items = " |1|2|3|4|5|6|7" to show an empty value in combo list. Also inside filter(), i tested with empty and space in If ($min <> ' ' And $rowdata[$q]... Confused -
Listview dependant filters
abaddon7734 replied to abaddon7734's topic in AutoIt General Help and Support
@Zedna I added some more filters but confused on how to validate them in the Filter function. Suppose there is a listview column containing digits from 1 to 7 and for which there are two combo filters "Min" and "Max", having the same numbers in both of them. Now what i want to do is that if i choose 3 in Min, the listview should display numbers from 3 to 7. Then if i choose 5 in Max, listview should display numbers from 3 to 5. Also the other way round by first choosing Max If $col[4] is an array of the number values from the listview and $min is the data in Min combo and $max is the one in Max combo filter, what should the testing condition in filter() function be? Func filter() _GUICtrlListView_DeleteAllItems($lv) For $i = 1 To $rowdata[0] - 1 $col = StringSplit($rowdata[$i], '|') If ($min <> '' And $col[4] < $min) And ($max <> '' And $col[4] > $max) Then ContinueLoop ; <----- This line is not working :( GUICtrlCreateListViewItem($rowdata[$i], $lv) Next Endfunc The testing condition does not work properly. Can you help me on this? Thanks -
Listview dependant filters
abaddon7734 replied to abaddon7734's topic in AutoIt General Help and Support
Thankyou very much BrewManNH and Zedna! Both work perfectly! However Zedna's is the better one. Thanks a lot you guys, now i can complete that old project! Finally an easy way to make listview filters! -
Hi, Im trying to filter out items and subitems in a listview with combos. However each filter should depend on the other filter when it is not empty. Here is an example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GuiListView.au3> #include <GuiComboBox.au3> GUICreate("filter testing") GUISetState() $lv = GUICtrlCreateListView("", 20, 80, 355) _GUICtrlListView_AddColumn($lv, "column 1", 80) _GUICtrlListView_AddColumn($lv, "column 2", 80) loadlist() Func loadlist() _GUICtrlListView_DeleteAllItems($lv) GUICtrlCreateListViewItem("red|circle", $lv) GUICtrlCreateListViewItem("blue|circle", $lv) GUICtrlCreateListViewItem("black|square", $lv) GUICtrlCreateListViewItem("black|triangle", $lv) EndFunc GUICtrlCreateLabel("Color", 20, 248, -1, 14) $combo1 = GUICtrlCreateCombo("", 20, 265, 120) GUICtrlCreateLabel("Shape", 160, 248, -1, 14) $combo2 = GUICtrlCreateCombo("", 160, 265, 120) putdata() Func putdata() GUICtrlSetData($combo1, " |red|blue|black") GUICtrlSetData($combo2, " |circle|square|triangle") EndFunc $button = GUICtrlCreateButton(" Clear ", 320, 263) While 1 $msg = GuiGetmsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button GUICtrlSetData($combo1, "") GUICtrlSetData($combo2, "") putdata() loadlist() Case $combo1, $combo2 Filter(GUICtrlRead($combo1), GUICtrlRead($combo2)) EndSwitch WEnd Func Filter($c1, $c2) _GUICtrlListView_DeleteAllItems($lv) loadlist() $itemcount = _GUICtrlListView_GetItemCount($lv) For $z = $itemcount - 1 To 0 Step -1 $item = _GUICtrlListView_GetItemText($lv, $z) $subitem = _GUICtrlListView_GetItemText($lv, $z, 1) If ($item = "" Or $item = $c1) Or ($subitem = "" Or $subitem = $c2) Then ContinueLoop Else _GUICtrlListView_DeleteItem($lv, $z) EndIf Next EndFunc When i choose "black" it lists the two items containg black correctly, but when i choose square next, it isnt working. Also how do it do it the other way round, if i choose "circle" first and then "red" to work? Please help Ive been trying to solve this from many weeks. Can this be done in a simple way without using that complicated $WM_COMMAND and all?