i have checkboxes and each checkbox that checked, i put in array.
now, im stuck on how to loop the checked array and store in in one variable. what i can do now, is only write the result into a text file.
below is the code:
#include <GUIConstantsEx.au3> ;~ #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <Array.au3> Global $Count = 3 Global $CheckBoxP[$Count] Global $step[$Count] global $array1 Global $ExitResult $hGUI = GUICreate("Summary Steps", 500, 400) GUISetFont(12, 400, "Tahoma") GUICtrlCreateLabel( "Please Select the Summary Steps for Script Check", 70, 20) GUISetFont(10, 400, "Tahoma") Global $array_Pstep = ["fix2","fix1","fix3"] global $step = ["2","3","4"] $Spacing = 50 For $i = 0 To UBound($array_Pstep) - 1 $CheckBoxP[$i] = GUICtrlCreateCheckbox($array_Pstep[$i], 80, $Spacing + (20 * $i), 65, 17) Next $submit = GUICtrlCreateButton("Submit",180, 280, 80, 30) $exit = GUICtrlCreateButton("Exit",180, 320, 80, 30) GUISetState() While 1 $Msg = GUIGetMsg() Select case $Msg=$submit For $i = 0 To $Count - 1 If GUICtrlRead($CheckBoxP[$i]) = $GUI_CHECKED Then _ArrayAdd($array1, $step[$i]) EndIf Next Global $logfilerray = @WorkingDir & "\checkedlist.txt" FileDelete ($logfilerray) Global $readlogfile = FileOpen($logfilerray,1) for $a = 1 to UBound($array1) - 1 ;~ $var=$array1[$a] FileWriteLine($readlogfile,$array1[$a]) Next FileClose($readlogfile) Exit case $Msg=$exit $ExitResult = MsgBox(1,"Summary Step", "Continue to Exit ?") if $ExitResult = 1 Then ;ok Exit EndIf Exit EndSelect WEnd
I've been checking the logging UDFs in the wiki, mostly Log4a and Loga and I wanted to ask which one would you recommend for a script that will be executed remotely through PSExec. My main question is where the logs are located in that situation and if I can change that location to a custom one., because I need to retrieve them at the end of execution.
So in a rough description the process is
Send compiled AutoIT script to remote machine
Copy logs from the remote to the local machine.
How do you perform a nested loop function with a multidimensional array from 2 lists.
for i in list1
(open file) extract variable
while open for i in list 2
(open file2) extract variable
var1 + var2 = (search term)
The list sizes will more than likely consist of different lengths.
What is the best approach to accomplishing this method?
I'm writing a little applet that basically tells you when Windows was installed. There is a REG_DWORD in Windows that gives you this. It's basically a value that is the # of seconds from 1970.
The location is: "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate"
So if I run this in AutoIT, I should get the value displayed within the msgbox:
MsgBox($MB_SYSTEMMODAL, "InstallDate Test", RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallDate"))
However, what happens is it always returns a value of "0" I tried this on several machines (Windows 8, Windows 8.1 and Windows 10).
Am I missing something? If I manually view this REG_DWORD with RegEdit, it shows me the HEX value, or I can view the Decimal value. I don't care which value AutoIT reads, as I can always convert back and forth, but I just don't see why it can't read a value from this REG_DWORD. As a test, I've read other REG_DWORD values, and with most it doesn't return any value, not even a 0.
Please, even if you guys have some other (perhaps better) way to read the Windows install date, I would still like to find a resolution to this problem, because I want to understand why I am having so much difficulty with reading REG_DWORD values from the Windows Registry with AutoIT.
Thanks for any help!
I am working on a function that I am just getting lost on. The goal is a multiple nested loop.
Here are the steps:
Contents of file1.txt::
[topic] var1=Name var2=OtherName var3=SomeotheName Contents of file2.txt::
[subTopic] top=sub1 top2=sub2 top3=sub3 The Shell I am working from::
#include <file.au3> $file = "c:\yourfile.txt" FileOpen($file, 0) For $i = 1 to _FileCountLines($file) $line = FileReadLine($file, $i) msgbox(0,'','the line ' & $i & ' is ' & $line) Next FileClose($file) Understanding however that the "msgbox" needs to then become a variable. in example the following::
$file = "c:\yourfile.txt" FileOpen($file, 0) While true( prog.exe is running && "WinName" is open) do For $i = 1 to _FileCountLines($file) $line = FileReadLine($file, $i) ;Open File to log "current location of file 1" FileWriteLine ("filename", $i & ' is ' & $line) var = $line Next $file2 = "c:\yourfile.txt" FileOpen($file, 0) For $i = 1 to _FileCountLines($file) $line = FileReadLine($file, $i) ; OpenFile to log "Current location of file 2" FileWriteLine ("filename", $i & ' is ' & $line) Next FileClose($file2) FileClose($file) The goal in written form is the following ::
While in "OpenWindow"
read from file 1 starting at line 1 until end of file.
file 1 is a list of names to be searched.
With $line selected, add this element to the element in file 2.
The search of a variables in list 1 and list 2 differ on the amount of posts that day. (This is not a web based platform, it is a game) I need to search 2 names and take a screenshot of the out put. The sizes of the names list depend on the activity of names at the time of search.
This loop continues until all the names from both lists have been searched. Mostly in the format of::
Item + Vendor ( Capture screen, scroll) -- Not sure how to detect if I need to scroll)
Thank you for your help and support!