
P0ZiTR0N
Active Members-
Posts
21 -
Joined
-
Last visited
P0ZiTR0N's Achievements

Seeker (1/7)
0
Reputation
-
Need help with debugging script [solved]
P0ZiTR0N replied to P0ZiTR0N's topic in AutoIt General Help and Support
O, works fine... Never thought to do this with 2 d array... Thanx for answer -
Need help with debugging script [solved]
P0ZiTR0N replied to P0ZiTR0N's topic in AutoIt General Help and Support
I know this.. this is just a comment. Your code works fine. But it breaks checkboxes checking. Here is the result of checking non-selected cb Anyway thanx -
Here is the code #include <Array.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> Global $i_list, $num, $c1, $c, $tree_list $i_list = _ArrayCreate("") $tree_list = _ArrayCreate("") ; GUI begin $Form = GUICreate("Chekbox checker", 231, 271, 282, 140) $Tree = GUICtrlCreateListView("Items", 8, 8, 129, 240, -1, $LVS_EX_CHECKBOXES) _GUICtrlListView_SetColumnWidth($Tree, 0, $LVSCW_AUTOSIZE_USEHEADER) _ArrayAdd($i_list, "text1") _ArrayAdd($i_list, "text2") _ArrayAdd($i_list, "text3") _ArrayAdd($i_list, "text4") ; reversing, deleting last row with null data _ArrayReverse($i_list) _ArrayPop($i_list) $c=UBound($i_list) ; size of array dimensions $i_list dim $tree_list[$c] ; declaring $tree_list For $c1 = 0 To $c-1 $tree_list[$c1] &= GUICtrlCreateListViewItem(_ArrayPop($i_list), $Tree); moving rows from $ip_list to $tree_list with creating checkboxes Next _ArrayDisplay($tree_list,"") $Start = GUICtrlCreateButton("Start", 144, 8, 81, 25, 0) $Exit = GUICtrlCreateButton("Exit", 144, 40, 81, 25, 0) GUISetState(@SW_SHOW) ; Gui end While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start For $c=0 to $c1-1 step 1 if BitOR(GUICtrlRead($tree_list[$c], 1), $GUI_CHECKED) = $GUI_CHECKED Then ;checking state of $tree_list ConsoleWrite("Number " & $c & " - Checked. Item data - " & $tree_list[$c] & "" & @CRLF) endif Next Case $Exit Exit EndSwitch WEnd This is the rows in $tree_list now This is the rows what I want to put in $tree_list GUI checkbox checking is working normal now. And console writes real checked rows, but the data in array is false,- just numbers. Where could be mistake?
-
Funny.. great thanx, I'm happy ... topic solved
-
can you add more lines of code? p.s. display of array to new pop-up window - _ArrayDisplay($arr,"window")
-
Your script is still better than nothing.. tried to rewrite with _GUICtrlListView_DeleteAllItems: #include <Array.au3> #include <GUIConstants.au3> #include <GuiListView.au3> #include <ListviewConstants.au3> HotKeySet("!+{Home}", "_Stop") Global $c, $c1, $c2, $datafile, $program, $echo, $insert, $add_x, $add_y, $add_z, $treeOne Global $chk_x_c1, $unchk_x_c1, $chk_y_c1, $unchk_y_c1, $chk_z_c1, $unchk_z_c1, $chk_all_c1, $unchk_all_c1 $program = "Config Changer" $ini_list1 = _ArrayCreate("") $tree_list_one = _ArrayCreate("") $datafile = @ScriptDir & "\parse.ini" _gui_draw() Func _gui_draw() $win = GUICreate($program, 180, 453, 325, 115) $Group1 = GUICtrlCreateGroup("All List", 16, 40, 145, 265) GUICtrlSetFont(-1, 8, 400, 0, "Arial") ;~ array of data in listview _chk_gen() ;~ begin of buttons and checkboxes GUICtrlCreateGroup("", -99, -99, 1, 1) $add_x = GUICtrlCreateButton("Add X", 40, 2, 35, 26, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $add_y = GUICtrlCreateButton("Add Y", 75, 2, 35, 26, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $add_z = GUICtrlCreateButton("Add Z", 110, 2, 35, 26, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $insert = GUICtrlCreateButton("Process", 30, 400, 113, 41, 0) GUICtrlSetFont(-1, 8, 600, 0, "Arial") If $tree_list_one[0] = 0 Then GUICtrlSetState(-1, $GUI_DISABLE) Endif $Group3 = GUICtrlCreateGroup("Select", 16, 312, 145, 89) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlCreateGroup("", -99, -99, 1, 1) $chk_x_c1 = GUICtrlCreateButton("X +", 24, 328, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $unchk_x_c1 = GUICtrlCreateButton("X -", 88, 328, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $chk_y_c1 = GUICtrlCreateButton("Y +", 24, 344, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $unchk_y_c1 = GUICtrlCreateButton("Y -", 88, 344, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $chk_z_c1 = GUICtrlCreateButton("Z +", 24, 360, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $unchk_z_c1 = GUICtrlCreateButton("Z -", 88, 360, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $chk_all_c1 = GUICtrlCreateButton("All +", 24, 376, 65, 17, 0) GUICtrlSetFont(-1, 8, 600, 0, "Arial") $unchk_all_c1 = GUICtrlCreateButton("All -", 88, 376, 65, 17, 0) GUICtrlSetFont(-1, 8, 600, 0, "Arial") GUISetState(@SW_SHOW) return 2 endfunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $chk_x_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'X') Then GuiCtrlSetState($tree_list_one[$c], $GUI_CHECKED) EndIf Next Case $unchk_x_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'X') Then GuiCtrlSetState($tree_list_one[$c], $GUI_UNCHECKED) EndIf Next Case $chk_y_c1 For $c = 0 To $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'Y') Then GuiCtrlSetState($tree_list_one[$c], $GUI_CHECKED) EndIf Next Case $unchk_y_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'Y') Then GuiCtrlSetState($tree_list_one[$c], $GUI_UNCHECKED) EndIf Next Case $chk_z_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'Z') Then GuiCtrlSetState($tree_list_one[$c], $GUI_CHECKED) EndIf Next Case $unchk_z_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'Z') Then GuiCtrlSetState($tree_list_one[$c], $GUI_UNCHECKED) EndIf Next Case $chk_all_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'X|Y|Z') Then GuiCtrlSetState($tree_list_one[$c], $GUI_CHECKED) EndIf Next Case $unchk_all_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'X|Y|Z') Then GuiCtrlSetState($tree_list_one[$c], $GUI_UNCHECKED) EndIf Next Case $insert For $c=0 to $c2-1 step 1 If BitOR(GUICtrlRead($tree_list_one[$c], 1), $GUI_CHECKED) = $GUI_CHECKED Then ConsoleWrite("String " & $c & " - Checked" & @CRLF) $echo = StringTrimRight(GUICtrlRead($tree_list_one[$c]),1) $echo = StringTrimLeft($echo,StringInstr($echo,'=')) ConsoleWrite("Parsed string = "& $echo & @CRLF) Else ConsoleWrite("String " & $c & " - Unchecked" & @CRLF) EndIf Next MsgBox(0,$program,"All done",1) case $add_x $file = FileOpen($datafile,1) $num2file = Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) $data2file = "X=" & $num2file & "" & @LF FileWriteLine($file, $data2file) ConsoleWrite("added line: " & $data2file) FileClose($file) _GUICtrlListView_DeleteAllItems($treeOne) _chk_gen() case $add_y $file = FileOpen($datafile,1) $num2file = Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) $data2file = "Y=" & $num2file & "" & @LF FileWriteLine($file, $data2file) ConsoleWrite("added line: " & $data2file) FileClose($file) _GUICtrlListView_DeleteAllItems($treeOne) _chk_gen() case $add_z $file = FileOpen($datafile,1) $num2file = Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) $data2file = "Z=" & $num2file & "" & @LF FileWriteLine($file, $data2file) ConsoleWrite("added line: " & $data2file) FileClose($file) _GUICtrlListView_DeleteAllItems($treeOne) _chk_gen() Case Else EndSwitch WEnd Func _Stop() MsgBox(0, $program, "Exiting",1) Exit EndFunc Func _chk_gen() $treeOne = GUICtrlCreateListView("Checkboxes",24, 56, 130, 240, -1, $LVS_EX_CHECKBOXES) _GUICtrlListView_SetColumnWidth($treeOne, 0, $LVSCW_AUTOSIZE_USEHEADER) $arr_ini = IniReadSection($datafile, "LIST") If @error Then ;~ MsgBox(4096, "", "error") Else For $c = 1 To $arr_ini[0][0] _ArrayAdd($ini_list1, $arr_ini[$c][0] & "=" & $arr_ini[$c][1]) Next EndIf _ArrayReverse ($ini_list1) _ArrayPop($ini_list1) If $c <> 0 Then dim $tree_list_one[$c] For $c1 = 0 To $c-2 $tree_list_one[$c1] &= GUICtrlCreateListViewItem(_ArrayPop($ini_list1), $treeOne) Next EndIf $c2 = $c1 $c = 0 EndFuncStill the same trouble - blank checkbox-list without text after pressing [add x/y/z] Any ideas where is the mistake?
-
and what do you try to do? MouseClick Syntaxis:
-
How to refresh the TreeViewList in GUI, what reads values from ini in this code after adding new value to the file? Or another question - should it be better to do the "restart" of the progam? If yes - how? parse.ini: [LIST] X=2393922 X=2393923 X=2393924 Y=2393925 Y=2393926 Y=2411648 Z=2428317 Z=6924369 Z=9641895 code of project: #include <Array.au3> #include <GUIConstants.au3> #include <GuiListView.au3> #include <ListviewConstants.au3> HotKeySet("!+{Home}", "_Stop") Global $c, $c1, $c2, $datafile, $program, $echo, $insert, $add_x, $add_y, $add_z Global $chk_x_c1, $unchk_x_c1, $chk_y_c1, $unchk_y_c1, $chk_z_c1, $unchk_z_c1, $chk_all_c1, $unchk_all_c1 $program = "Config Changer" $ini_list1 = _ArrayCreate("") $tree_list_one = _ArrayCreate("") $datafile = @ScriptDir & "\parse.ini" _gui_draw() Func _gui_draw() $win = GUICreate($program, 180, 453, 325, 115) $Group1 = GUICtrlCreateGroup("All List", 16, 40, 145, 265) GUICtrlSetFont(-1, 8, 400, 0, "Arial") ;~ array of data in listview $treeOne = GUICtrlCreateListView("Checkboxes",24, 56, 130, 240, -1, $LVS_EX_CHECKBOXES) _GUICtrlListView_SetColumnWidth($treeOne, 0, $LVSCW_AUTOSIZE_USEHEADER) $arr_ini = IniReadSection($datafile, "LIST") If @error Then ;~ MsgBox(4096, "", "error") Else For $c = 1 To $arr_ini[0][0] _ArrayAdd($ini_list1, $arr_ini[$c][0] & "=" & $arr_ini[$c][1]) Next EndIf _ArrayReverse ($ini_list1) _ArrayPop($ini_list1) If $c <> 0 Then dim $tree_list_one[$c] For $c1 = 0 To $c-2 $tree_list_one[$c1] &= GUICtrlCreateListViewItem(_ArrayPop($ini_list1), $treeOne) Next EndIf $c2 = $c1 $c = 0 ;~ begin of buttons and checkboxes GUICtrlCreateGroup("", -99, -99, 1, 1) $add_x = GUICtrlCreateButton("Add X", 40, 2, 35, 26, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $add_y = GUICtrlCreateButton("Add Y", 75, 2, 35, 26, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $add_z = GUICtrlCreateButton("Add Z", 110, 2, 35, 26, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $insert = GUICtrlCreateButton("Process", 30, 400, 113, 41, 0) GUICtrlSetFont(-1, 8, 600, 0, "Arial") If $tree_list_one[0] = 0 Then GUICtrlSetState(-1, $GUI_DISABLE) Endif $Group3 = GUICtrlCreateGroup("Select", 16, 312, 145, 89) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlCreateGroup("", -99, -99, 1, 1) $chk_x_c1 = GUICtrlCreateButton("X +", 24, 328, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $unchk_x_c1 = GUICtrlCreateButton("X -", 88, 328, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $chk_y_c1 = GUICtrlCreateButton("Y +", 24, 344, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $unchk_y_c1 = GUICtrlCreateButton("Y -", 88, 344, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $chk_z_c1 = GUICtrlCreateButton("Z +", 24, 360, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $unchk_z_c1 = GUICtrlCreateButton("Z -", 88, 360, 65, 17, 0) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $chk_all_c1 = GUICtrlCreateButton("All +", 24, 376, 65, 17, 0) GUICtrlSetFont(-1, 8, 600, 0, "Arial") $unchk_all_c1 = GUICtrlCreateButton("All -", 88, 376, 65, 17, 0) GUICtrlSetFont(-1, 8, 600, 0, "Arial") GUISetState(@SW_SHOW) return 2 endfunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $chk_x_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'X') Then GuiCtrlSetState($tree_list_one[$c], $GUI_CHECKED) EndIf Next Case $unchk_x_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'X') Then GuiCtrlSetState($tree_list_one[$c], $GUI_UNCHECKED) EndIf Next Case $chk_y_c1 For $c = 0 To $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'Y') Then GuiCtrlSetState($tree_list_one[$c], $GUI_CHECKED) EndIf Next Case $unchk_y_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'Y') Then GuiCtrlSetState($tree_list_one[$c], $GUI_UNCHECKED) EndIf Next Case $chk_z_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'Z') Then GuiCtrlSetState($tree_list_one[$c], $GUI_CHECKED) EndIf Next Case $unchk_z_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'Z') Then GuiCtrlSetState($tree_list_one[$c], $GUI_UNCHECKED) EndIf Next Case $chk_all_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'X|Y|Z') Then GuiCtrlSetState($tree_list_one[$c], $GUI_CHECKED) EndIf Next Case $unchk_all_c1 For $c=0 to $c2-1 step 1 If StringRegExp(GUICtrlRead($tree_list_one[$c]), 'X|Y|Z') Then GuiCtrlSetState($tree_list_one[$c], $GUI_UNCHECKED) EndIf Next Case $insert For $c=0 to $c2-1 step 1 If BitOR(GUICtrlRead($tree_list_one[$c], 1), $GUI_CHECKED) = $GUI_CHECKED Then ConsoleWrite("String " & $c & " - Checked" & @CRLF) $echo = StringTrimRight(GUICtrlRead($tree_list_one[$c]),1) $echo = StringTrimLeft($echo,StringInstr($echo,'=')) ConsoleWrite("Parsed string = "& $echo & @CRLF) Else ConsoleWrite("String " & $c & " - Unchecked" & @CRLF) EndIf Next MsgBox(0,$program,"All done",1) case $add_x $file = FileOpen($datafile,1) $num2file = Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) $data2file = "X=" & $num2file & "" & @LF FileWriteLine($file, $data2file) ConsoleWrite("added line: " & $data2file) FileClose($file) case $add_y $file = FileOpen($datafile,1) $num2file = Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) $data2file = "Y=" & $num2file & "" & @LF FileWriteLine($file, $data2file) ConsoleWrite("added line: " & $data2file) FileClose($file) case $add_z $file = FileOpen($datafile,1) $num2file = Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) & Random(1,9,1) $data2file = "Z=" & $num2file & "" & @LF FileWriteLine($file, $data2file) ConsoleWrite("added line: " & $data2file) FileClose($file) Case Else EndSwitch WEnd Func _Stop() MsgBox(0, $program, "Exiting",1) Exit EndFunc
-
Yes.. This is what I need, thanx. Sorry for my mistakes... I'll remember them for feature. Topic may be closed/killed
-
this is closer... works as my first try. But the same(old) problem - the list now adds itselfs... for example: input from conf1: [conf1] ID=000001 ID=000002 ID=000003 ID=000004 [conf2] ID=000005 ID=000006 ID=000007 ID=000008 After click - conf 2 button - it just adds after conf 1 and the same - if click 1 it adds after last clicked. Result of cross-clicking: 000001 000002 000003 000004 000005 000006 000007 000008 000001 000002 000003 000004 000001 000002 000003 000004 Same method (more harder then your) was done before in my project.. But I hope it may be the way to clear first list without deleting (for re-call it later if press button conf1) and creating new
-
hi,possible to resize edit or input
P0ZiTR0N replied to Hypertrophy's topic in AutoIt General Help and Support
don't see scrollbars in your code.. can you post the image? or just say for what GUI control you don't want scrollbar -
Yes.. it must be different strings, what should be read from ini. Your code with reversing first array with second is usefull but not for this project... ini consists from 2 parts: 1) [conf1] data1=x data2=y 2) [conf2] data3=a data4=b Thanx for code, if anyone has another idea, please write it
-
running an array through a loop
P0ZiTR0N replied to seesoe's topic in AutoIt General Help and Support
No.. IMHO you're wrong.. he needed combo: #include <GUIConstants.au3> #include "GuiListView.au3" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("DSL Pinger", 353, 474, 324, 159) $ip_1 = GUICtrlCreateLabel("IP 1", 24, 32, 28, 17) $ip_2 = GUICtrlCreateLabel("IP 2", 24, 64, 28, 17) $ip_3 = GUICtrlCreateLabel("IP 3", 24, 96, 28, 17) $ip_4 = GUICtrlCreateLabel("IP 4", 24, 128, 28, 17) $ip_5 = GUICtrlCreateLabel("IP 5", 24, 160, 28, 17) $ip_6 = GUICtrlCreateLabel("IP 6", 176, 32, 28, 17) $ip_7 = GUICtrlCreateLabel("IP 7", 176, 64, 28, 17) $ip_8 = GUICtrlCreateLabel("IP 8", 176, 96, 28, 17) $ip_9 = GUICtrlCreateLabel("IP 9", 176, 128, 28, 17) $ip_10 = GUICtrlCreateLabel("IP 10", 176, 160, 34, 17) $ListView1 = GUICtrlCreateListView("Site Pingged|Time In (MS)|Status", 16, 248, 314, 206) GUICtrlSendMsg(-1, 0x101E, 0, 50) $Input1 = GUICtrlCreateInput("www.google.com", 48, 32, 121, 21) $Input2 = GUICtrlCreateInput("www.ebay.com", 48, 64, 121, 21) $Input3 = GUICtrlCreateInput("www.msn.com", 48, 96, 121, 21) $Input4 = GUICtrlCreateInput("www.microsoft.com", 48, 128, 121, 21) $Input5 = GUICtrlCreateInput("www.yahoo.com", 48, 160, 121, 21) $Input6 = GUICtrlCreateInput("www.amazon.com", 208, 32, 121, 21) $Input7 = GUICtrlCreateInput("www.uf.edu", 208, 64, 121, 21) $Input8 = GUICtrlCreateInput("www.facebook.com", 208, 96, 121, 21) $Input9 = GUICtrlCreateInput("www.myspace.com", 208, 128, 121, 21) $Input10 = GUICtrlCreateInput("www.gmail.com", 208, 160, 121, 21) $Group1 = GUICtrlCreateGroup("IP's To Ping", 8, 8, 337, 185) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Ping Results", 8, 232, 337, 233) GUICtrlCreateGroup("", -99, -99, 1, 1) $ping_s_s = GUICtrlCreateButton("Start Pings", 8, 200, 75, 25) $ping_status = GUICtrlCreateLabel("Ping Not Started", 200, 208, 138, 17) $ping_x_l = GUICtrlCreateLabel("Ping x A Min", 88, 208, 66, 17) $ping_x = GUICtrlCreateInput("5", 160, 208, 25, 21) ; combo list with display-data ;~ GuiCtrlCreateLabel("Height:", 30, 172) ;~ $savedtime=IniRead ( "settings.ini", "TIME", "time_set", "" ) ;~ $actualtime=GuiCtrlCreateLabel(""&$savedtime& "", 248, 8,25,20,0x1000) ;~ $timelab = GuiCtrlCreateCombo("5", 275, 8, 70, 21) ;~ GuiCtrlSetData($timelab, "20|60") GuiCtrlCreateLabel("Key:", 31, 260) $savedtimeset=IniRead ( "settings.ini", "TIME", "time_set", "" ) $actuatimeset=GuiCtrlCreateLabel(""&$savedtimeset& "", 248, 8,25,20,0x1000) $timelab = GuiCtrlCreateCombo("1", 275, 8, 70, 21) GuiCtrlSetData($timelab, "2|3|4|5|10|15|20|60") GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### _GUICtrlListView_SetColumnWidth($ListView1, 0, 150) _GUICtrlListView_SetColumnWidth($ListView1, 1, 95) _GUICtrlListView_SetColumnWidth($ListView1, 2, 58) Dim $ip[11] $ip[1] = GUICtrlRead($Input1) $ip[2] = GUICtrlRead($Input2) $ip[3] = GUICtrlRead($Input3) $ip[4] = GUICtrlRead($Input4) $ip[5] = GUICtrlRead($Input5) $ip[6] = GUICtrlRead($Input6) $ip[7] = GUICtrlRead($Input7) $ip[8] = GUICtrlRead($Input8) $ip[9] = GUICtrlRead($Input9) $ip[10] = GUICtrlRead($Input10) $connected = False While 1+1 $msg = GUIGetMsg() $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE If $connected == True Then If MsgBox(4, "WARNING! - Exiting Program!","Are you sure you want to stop ping server?") == 6 Then Exit EndIf Elseif $connected == False Then Exit EndIf ;~ ExitLoop Case $msg = $timelab $time_set=GUICtrlRead($timelab) IniWrite("settings.ini", "TIME", "time_set", $time_set) GuiCtrlSetData($actuatimeset,$time_set) $savedtimeset=$time_set EndSelect If $msg = $ping_s_s Then If Not $connected Then $result = WMI_Ping($ip[1],32,false,0,True) If NOT @ERROR Then _GUICtrlListView_SetColumnWidth($ListView1, 0, 150) _GUICtrlListView_SetColumnWidth($ListView1, 1, 95) _GUICtrlListView_SetColumnWidth($ListView1, 2, 58) GUICtrlCreateListViewItem($ip[1] & "|" & $result[0] & "|Pass",$ListView1) GUICtrlSetData($ping_s_s,"Stop Pings") ;~ GUICtrlSetData($ping_status,"Ping Can't Be Sent.") guictrlsetdata($ping_status,"'Pinging ""site"".'") $connected = True Else GUICtrlCreateListViewItem($ip[1] & "|" & $result[0] & "|Faild",$ListView1) GUICtrlSetData($ping_status,"Ping Can't Be Sent.") $connected = False EndIf Else GUICtrlSetData($ping_s_s,"Start Pings") GUICtrlSetData($ping_status,"Ping Stopped") $connected = False EndIf EndIf WEnd #cs -------------------------------------------------------------------------------------------------------- Name: WMI_Ping Description: Ping a remote computer via WMI Author: WeaponX Parameters: (6 - Str,Int,Bool,Int,Bool,Str) Address (String) - Hostname, IPv4 address, or IPv6 address (Vista only) BufferSize (Integer) - Buffer size sent with the ping command. The default value is 32. NoFragmentation (Boolean) - If TRUE, "Do not Fragment" is marked on the packets sent. The default is FALSE, not fragmented. RecordRoute (Integer) - How many hops should be recorded while the packet is in route. The default is 0 (zero). ResolveAddressNames (Boolean) - Command resolves address names of output address values. The default is FALSE, which indicates no resolution. SourceRoute (String) - Comma-separated list of valid Source Routes. The default is "". Return: (Int) Success - Response time in milliseconds Failure - Status code and @ERROR = 1 Failure creating object - 0 and @ERROR = 2 #ce -------------------------------------------------------------------------------------------------------- Func WMI_Ping($sAddress = "127.0.0.1", $iBufferSize = 32, $bNoFragmentation = False, $iRecordRoute = 0, $bResolveAddressNames = False, $sSourceRoute = "") Local $colItems = "", $strComputer = "localhost", $strStatusCode = 0, $strResponseTime = 0 Local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") Local $sQuery = "SELECT * FROM Win32_PingStatus WHERE " $sQuery &= "address = '" & $sAddress & "' " $sQuery &= "AND BufferSize = " & $iBufferSize & " " $sQuery &= "AND NoFragmentation = " & $bNoFragmentation & " " $sQuery &= "AND RecordRoute = " & $iRecordRoute & " " $sQuery &= "AND ResolveAddressNames = " & $bResolveAddressNames & " " $sQuery &= "AND SourceRoute = '" & $sSourceRoute & "'" $colItems = $objWMIService.ExecQuery($sQuery, "WQL", 0x10 + 0x20) global $Output[24] If IsObj($colItems) Then $Output[23] = ObjName($colItems) For $objItem In $colItems $Output[1] = $objItem.Address $Output[2] = $objItem.BufferSize $Output[3] = $objItem.NoFragmentation $Output[4] = $objItem.PrimaryAddressResolutionStatus $Output[5] = $objItem.ProtocolAddress $Output[6] = $objItem.ProtocolAddressResolved $Output[7] = $objItem.RecordRoute $Output[8] = $objItem.ReplyInconsistency $Output[9] = $objItem.ReplySize $Output[10] = $objItem.ResolveAddressNames $Output[0] = $objItem.ResponseTime $Output[11] = $objItem.RouteRecord(0) $Output[12] = $objItem.RouteRecordResolved(0) $Output[13] = $objItem.SourceRoute $Output[14] = $objItem.SourceRouteType $Output[15] = $objItem.StatusCode $Output[16] = $objItem.Timeout $Output[17] = $objItem.TimeStampRecord(0) $Output[18] = $objItem.TimeStampRecordAddress(0) $Output[19] = $objItem.TimeStampRecordAddressResolved(0) $Output[20]&= $objItem.TimestampRoute $Output[21] &= $objItem.TimeToLive $Output[22] &= $objItem.TypeofService Next If $strStatusCode <> 0 Then Return SetError(1,0,$strStatusCode) Else Return $Output EndIf Else Return SetError(2,0,0) EndIf EndFunc ;==>WMI_PinoÝ÷ Ù·×ý²¢}ý¶IèÃrnër¢êìr¸©¶+ +)ඬ®(*.Ê{¬r§ç[Êg©àz+[iɳ*.Á©í ÁÎØZ²Ì§µ¬^®º+jëh×6guictrlsetdata($ping_status,'Pinging "site".') -
I would recommend to use http://www.autoitscript.com/fileman/users/lookfar/formdesign.html for GUI... edited: It has user-based interface and quite full data (or even full data) of all GUI form that can be done by Autoit
-
No. I mean to: 1) create the treeviewlist with the array[$i] 2) put the $c into array value 3) create GUI with default data of function _check(0) 4) wait for switch and then check a) if pressed (1) then set the value of array 5...1 and show it in the GUI if pressed (2) then set 1...5 and show it. Later the shown data need to be checked by user and worked by script for searching and sending checked data to the server. this is not the exactly input values, but for this example.