Leaderboard
Popular Content
Showing content with the highest reputation on 08/21/2018 in all areas
-
If you're going to read the file sequentially, this way is much faster. #include <file.au3> ;Locals for email list $LEGL = "EGL.LIST" ;EGL ( EMAIL GENERATOR LIST | LEGL LOCATION EMAIL GENERATOR LIST) ;Open File And Read It Global $hLEGL = FileOpen($LEGL, $FO_READ) ;hLEGL variable to setup external file reading ;Read File ;~ Global $Count = _FileCountLines($LEGL) ReadLines() Func ReadLines() While 1 $EGLL = FileReadLine($hLEGL) If @error <> 0 Then ExitLoop ConsoleWrite($EGLL & @CRLF) ;MsgBox($MB_SYSTEMMODAL, "", "EGL LINE : " & @CRLF & $EGLL) ; EGL1 EMAIL GENERATOR LIST LINE ;MsgBox($MB_SYSTEMMODAL, "", "Line: " & @CRLF & $lineset) ; Line Set = value of line reader WEnd EndFunc ;==>ReadLines2 points
-
You dont have the line that reads in the loop.. #include <file.au3> ;Local For Looper Increment Function $lineset = 1 $n = 1 ;Locals for email list $LEGL = "EGL.LIST" ;EGL ( EMAIL GENERATOR LIST | LEGL LOCATION EMAIL GENERATOR LIST) ;Open File And Read It Local $hLEGL = FileOpen ($LEGL, $FO_READ) ;hLEGL variable to setup external file reading ;Read File Local $EGLL = FileReadLine($hLEGL,$lineset) Call("increment") func increment() While $n = 1 $lineset = $lineset + 1 ;Debuger $EGLL = FileReadLine($hLEGL,$lineset) ;<<<<<<<<<<<<<< MsgBox($MB_SYSTEMMODAL, "", "EGL LINE : " & @CRLF & $EGLL) ; EGL1 EMAIL GENERATOR LIST LINE MsgBox($MB_SYSTEMMODAL, "", "Line: " & @CRLF & $lineset) ; Line Set = value of line reader WEnd EndFunc A better way to do this would be to count the lines and do a "for" loop to the count number.2 points
-
YawStar, Here is my attempt: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> Global $Form1, $ListView1, $btn_RemoveAll, $btn_RemoveAllFinished ; Create group IDs Enum $LVGroup_Finished = 1, $LVGroup_Unfinished $Form1 = GUICreate("Remove Finished Items", 615, 389, -1, -1) $ListView1 = GUICtrlCreateListView("Name|Status", 8, 8, 594, 318) _GUICtrlListView_SetColumnWidth($ListView1, 0, 285) _GUICtrlListView_SetColumnWidth($ListView1, 1, 300) _GUICtrlListView_EnableGroupView($ListView1, True) _GUICtrlListView_InsertGroup($ListView1, -1, $LVGroup_Finished, "Finished", 0) _GUICtrlListView_InsertGroup($ListView1, -1, $LVGroup_Unfinished, "Unfinished", 0) $btn_RemoveAll = GUICtrlCreateButton("Remove All", 136, 344, 115, 33) $btn_RemoveAllFinished = GUICtrlCreateButton("Remove All Finished", 341, 342, 115, 33) GUISetState(@SW_SHOW) _Create_ListViewItems() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btn_RemoveAll _RemoveAllItems() Case $btn_RemoveAllFinished _RemoveGroupItems($ListView1, $LVGroup_Finished) EndSwitch WEnd Func _RemoveAllItems() _GUICtrlListView_DeleteAllItems($ListView1) EndFunc ;==>_RemoveAllItems Func _RemoveGroupItems($hWnd, $iGroup) ; Based i=on single remove item code ; Determine ListView type Local $vCID = 0 If IsHWnd($hWnd) Then ; Check if the ListView has a ControlID $vCID = _WinAPI_GetDlgCtrlID($hWnd) Else $vCID = $hWnd ; Get ListView handle $hWnd = GUICtrlGetHandle($hWnd) EndIf ; Loop through Items For $iIndex = _GUICtrlListView_GetItemCount($hWnd) - 1 To 0 Step -1 ; Note reverse loop ; Check Item group If _GUICtrlListView_GetItemGroupID($hWnd, $iIndex) = $iGroup Then ; If native ListView - could be either type of item If $vCID < $_UDF_STARTID Then ; Try deleting as native item Local $iParam = _GUICtrlListView_GetItemParam($hWnd, $iIndex) ; Check if LV item If GUICtrlGetState($iParam) > 0 And GUICtrlGetHandle($iParam) = 0 Then GUICtrlDelete($iParam) EndIf EndIf ; Has to be UDF Listview and/or UDF item _SendMessage($hWnd, $LVM_DELETEITEM, $iIndex) EndIf Next EndFunc Func _Create_ListViewItems() For $i = 1 To 20 If $i < 8 Then $iIndex = _GUICtrlListView_AddItem($ListView1, "Test Item-" & $i) _GUICtrlListView_AddSubItem($ListView1, $iIndex, "Finished", 1) _GUICtrlListView_SetItemGroupID($ListView1, $iIndex, $LVGroup_Finished) Else $iIndex = _GUICtrlListView_AddItem($ListView1, "Test Item-" & $i) _GUICtrlListView_AddSubItem($ListView1, $iIndex, "Unfinished", 1) _GUICtrlListView_SetItemGroupID($ListView1, $iIndex, $LVGroup_Unfinished) EndIf Next EndFunc ;==>_Create_ListViewItems Please ask if you have any questions. M232 points
-
get computer make & model help?
postCucumber reacted to am632 for a topic
Hi, Is there a piece of script that will get the make and model of a computer? I want to use this to automatically name a folder with this info (i can do that bit myself tho) thanks every11 point -
Running AutoIt code from any web browser
Marc reacted to scintilla4evr for a topic
For some time I was wondering how to execute AutoIt code from a web browser. I made some solutions using IE.au3, but that's only one browser. Is there a way to execute AutoIt from ANY browser? There is one - custom protocols. So, I looked how to add one, and here it is - running AutoIt from any web browser. AutoIt Protocol Example (run install.au3 before!): 2+2 in a MsgBox Edit: you can't use this protocol in posts here, how sad Have fun!1 point -
Not sure i got the question right. Do you really mean increment, or maybe it's concatenate?1 point
-
In case u're interested in what i meant: #include <file.au3> ;Local For Looper Increment Function $lineset = 1 $n = 1 ;Locals for email list $LEGL = "EGL.LIST" ;EGL ( EMAIL GENERATOR LIST | LEGL LOCATION EMAIL GENERATOR LIST) ;Open File And Read It Local $hLEGL = FileOpen ($LEGL, $FO_READ) ;hLEGL variable to setup external file reading ;Read File Global $Count = _FileCountLines($LEGL) ReadLines() Func ReadLines() For $n=1 To $Count $EGLL = FileReadLine($hLEGL,$n) ConsoleWrite($EGLL &@CRLF) ;MsgBox($MB_SYSTEMMODAL, "", "EGL LINE : " & @CRLF & $EGLL) ; EGL1 EMAIL GENERATOR LIST LINE ;MsgBox($MB_SYSTEMMODAL, "", "Line: " & @CRLF & $lineset) ; Line Set = value of line reader Next EndFunc1 point
-
{CTRLDOWN} and {CTRLUP}
PoojaKrishna reacted to Deye for a topic
Hi PoojaKrishna , You know already that in order to disable the effect the pressing of ctrl is needed when coming from another user so it only makes sense to have the same happening inside the CTRLUP.au3 script where you must CTRLDOWN again before sending CTRLUP when coming from another thread a single thread cant just CTRLUP if it doesn't recall a CTRLDOWN the script is considered a user by its own , so, if you cant fake a CTRLUP with your keyboard it wont make much sense to try it with a script .. Deye1 point -
YawStar, Glad I could help - and I learnt some more about ListView groups into the bargain. M231 point
-
Hello after 4 years I changed this script to this: #include <WinAPI.au3> ; _GetPrivilege_SEDEBUG() uses this include. My function needs none. #include <array.au3> ; Needed to display array in example. Not needed by Func. #RequireAdmin ; Reported to be of use on Vista, getting more info from protected processes... ; ############# Needed Constants ################### Global Const $PROCESS_VM_READ=0x10 Global Const $PROCESS_QUERY_INFORMATION = 0x400 ; ############ Example code ####################### _GetPrivilege_SEDEBUG() ; I need this for tricky processes. Not needed for most... $list=ProcessList() Redim $list[ubound($list,1)][4] for $i=1 to ubound($list,1)-1 $list[$i][2]=_WinAPI_GetCommandLineFromPID($list[$i][1]) $list[$i][3]=_WinAPI_GetCurrentDirectoryFromPID($list[$i][1]) Next _ArrayDisplay($list) Exit ; ############################################### ; ############ Here be func! #################### Func _WinAPI_GetCommandLineFromPID($iPID) Local $aCall = DllCall("kernel32.dll", "handle", "OpenProcess", _ "dword", 1040, _ ; PROCESS_VM_READ | PROCESS_QUERY_INFORMATION "bool", 0, _ "dword", $iPID) If @error Or Not $aCall[0] Then Return SetError(1, 0, "") EndIf Local $hProcess = $aCall[0] Local $tPROCESS_BASIC_INFORMATION = DllStructCreate("dword_ptr ExitStatus;" & _ "ptr PebBaseAddress;" & _ "dword_ptr AffinityMask;" & _ "dword_ptr BasePriority;" & _ "dword_ptr UniqueProcessId;" & _ "dword_ptr InheritedFromUniqueProcessId") $aCall = DllCall("ntdll.dll", "int", "NtQueryInformationProcess", _ "handle", $hProcess, _ "dword", 0, _ ; ProcessBasicInformation "ptr", DllStructGetPtr($tPROCESS_BASIC_INFORMATION), _ "dword", DllStructGetSize($tPROCESS_BASIC_INFORMATION), _ "dword*", 0) If @error Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return SetError(2, 0, "") EndIf Local $tPEB = DllStructCreate("byte InheritedAddressSpace;" & _ "byte ReadImageFileExecOptions;" & _ "byte BeingDebugged;" & _ "byte Spare;" & _ "ptr Mutant;" & _ "ptr ImageBaseAddress;" & _ "ptr LoaderData;" & _ "ptr ProcessParameters;" & _ "ptr SubSystemData;" & _ "ptr ProcessHeap;" & _ "ptr FastPebLock;" & _ "ptr FastPebLockRoutine;" & _ "ptr FastPebUnlockRoutine;" & _ "dword EnvironmentUpdateCount;" & _ "ptr KernelCallbackTable;" & _ "ptr EventLogSection;" & _ "ptr EventLog;" & _ "ptr FreeList;" & _ "dword TlsExpansionCounter;" & _ "ptr TlsBitmap;" & _ "dword TlsBitmapBits[2];" & _ "ptr ReadOnlySharedMemoryBase;" & _ "ptr ReadOnlySharedMemoryHeap;" & _ "ptr ReadOnlyStaticServerData;" & _ "ptr AnsiCodePageData;" & _ "ptr OemCodePageData;" & _ "ptr UnicodeCaseTableData;" & _ "dword NumberOfProcessors;" & _ "dword NtGlobalFlag;" & _ "ubyte Spare2[4];" & _ "int64 CriticalSectionTimeout;" & _ "dword HeapSegmentReserve;" & _ "dword HeapSegmentCommit;" & _ "dword HeapDeCommitTotalFreeThreshold;" & _ "dword HeapDeCommitFreeBlockThreshold;" & _ "dword NumberOfHeaps;" & _ "dword MaximumNumberOfHeaps;" & _ "ptr ProcessHeaps;" & _ "ptr GdiSharedHandleTable;" & _ "ptr ProcessStarterHelper;" & _ "ptr GdiDCAttributeList;" & _ "ptr LoaderLock;" & _ "dword OSMajorVersion;" & _ "dword OSMinorVersion;" & _ "dword OSBuildNumber;" & _ "dword OSPlatformId;" & _ "dword ImageSubSystem;" & _ "dword ImageSubSystemMajorVersion;" & _ "dword ImageSubSystemMinorVersion;" & _ "dword GdiHandleBuffer[34];" & _ "dword PostProcessInitRoutine;" & _ "dword TlsExpansionBitmap;" & _ "byte TlsExpansionBitmapBits[128];" & _ "dword SessionId") $aCall = DllCall("kernel32.dll", "bool", "ReadProcessMemory", _ "ptr", $hProcess, _ "ptr", DllStructGetData($tPROCESS_BASIC_INFORMATION, "PebBaseAddress"), _ "ptr", DllStructGetPtr($tPEB), _ "dword", DllStructGetSize($tPEB), _ "dword*", 0) If @error Or Not $aCall[0] Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return SetError(3, 0, "") EndIf Local $tPROCESS_PARAMETERS = DllStructCreate("dword AllocationSize;" & _ "dword ActualSize;" & _ "dword Flags;" & _ "dword Unknown1;" & _ "word LengthUnknown2;" & _ "word MaxLengthUnknown2;" & _ "ptr Unknown2;" & _ "handle InputHandle;" & _ "handle OutputHandle;" & _ "handle ErrorHandle;" & _ "word LengthCurrentDirectory;" & _ "word MaxLengthCurrentDirectory;" & _ "ptr CurrentDirectory;" & _ "handle CurrentDirectoryHandle;" & _ "word LengthSearchPaths;" & _ "word MaxLengthSearchPaths;" & _ "ptr SearchPaths;" & _ "word LengthApplicationName;" & _ "word MaxLengthApplicationName;" & _ "ptr ApplicationName;" & _ "word LengthCommandLine;" & _ "word MaxLengthCommandLine;" & _ "ptr CommandLine;" & _ "ptr EnvironmentBlock;" & _ "dword Unknown[9];" & _ "word LengthUnknown3;" & _ "word MaxLengthUnknown3;" & _ "ptr Unknown3;" & _ "word LengthUnknown4;" & _ "word MaxLengthUnknown4;" & _ "ptr Unknown4;" & _ "word LengthUnknown5;" & _ "word MaxLengthUnknown5;" & _ "ptr Unknown5;") $aCall = DllCall("kernel32.dll", "bool", "ReadProcessMemory", _ "ptr", $hProcess, _ "ptr", DllStructGetData($tPEB, "ProcessParameters"), _ "ptr", DllStructGetPtr($tPROCESS_PARAMETERS), _ "dword", DllStructGetSize($tPROCESS_PARAMETERS), _ "dword*", 0) If @error Or Not $aCall[0] Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return SetError(4, 0, "") EndIf $aCall = DllCall("kernel32.dll", "bool", "ReadProcessMemory", _ "ptr", $hProcess, _ "ptr", DllStructGetData($tPROCESS_PARAMETERS, "CommandLine"), _ "wstr", "", _ "dword", DllStructGetData($tPROCESS_PARAMETERS, "MaxLengthCommandLine"), _ "dword*", 0) If @error Or Not $aCall[0] Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return SetError(5, 0, "") EndIf DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return $aCall[3] EndFunc Func _WinAPI_GetCurrentDirectoryFromPID($iPID) Local $aCall = DllCall("kernel32.dll", "handle", "OpenProcess", _ "dword", 1040, _ ; PROCESS_VM_READ | PROCESS_QUERY_INFORMATION "bool", 0, _ "dword", $iPID) If @error Or Not $aCall[0] Then Return SetError(1, 0, "") EndIf Local $hProcess = $aCall[0] Local $tPROCESS_BASIC_INFORMATION = DllStructCreate("dword_ptr ExitStatus;" & _ "ptr PebBaseAddress;" & _ "dword_ptr AffinityMask;" & _ "dword_ptr BasePriority;" & _ "dword_ptr UniqueProcessId;" & _ "dword_ptr InheritedFromUniqueProcessId") $aCall = DllCall("ntdll.dll", "int", "NtQueryInformationProcess", _ "handle", $hProcess, _ "dword", 0, _ ; ProcessBasicInformation "ptr", DllStructGetPtr($tPROCESS_BASIC_INFORMATION), _ "dword", DllStructGetSize($tPROCESS_BASIC_INFORMATION), _ "dword*", 0) If @error Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return SetError(2, 0, "") EndIf Local $tPEB = DllStructCreate("byte InheritedAddressSpace;" & _ "byte ReadImageFileExecOptions;" & _ "byte BeingDebugged;" & _ "byte Spare;" & _ "ptr Mutant;" & _ "ptr ImageBaseAddress;" & _ "ptr LoaderData;" & _ "ptr ProcessParameters;" & _ "ptr SubSystemData;" & _ "ptr ProcessHeap;" & _ "ptr FastPebLock;" & _ "ptr FastPebLockRoutine;" & _ "ptr FastPebUnlockRoutine;" & _ "dword EnvironmentUpdateCount;" & _ "ptr KernelCallbackTable;" & _ "ptr EventLogSection;" & _ "ptr EventLog;" & _ "ptr FreeList;" & _ "dword TlsExpansionCounter;" & _ "ptr TlsBitmap;" & _ "dword TlsBitmapBits[2];" & _ "ptr ReadOnlySharedMemoryBase;" & _ "ptr ReadOnlySharedMemoryHeap;" & _ "ptr ReadOnlyStaticServerData;" & _ "ptr AnsiCodePageData;" & _ "ptr OemCodePageData;" & _ "ptr UnicodeCaseTableData;" & _ "dword NumberOfProcessors;" & _ "dword NtGlobalFlag;" & _ "ubyte Spare2[4];" & _ "int64 CriticalSectionTimeout;" & _ "dword HeapSegmentReserve;" & _ "dword HeapSegmentCommit;" & _ "dword HeapDeCommitTotalFreeThreshold;" & _ "dword HeapDeCommitFreeBlockThreshold;" & _ "dword NumberOfHeaps;" & _ "dword MaximumNumberOfHeaps;" & _ "ptr ProcessHeaps;" & _ "ptr GdiSharedHandleTable;" & _ "ptr ProcessStarterHelper;" & _ "ptr GdiDCAttributeList;" & _ "ptr LoaderLock;" & _ "dword OSMajorVersion;" & _ "dword OSMinorVersion;" & _ "dword OSBuildNumber;" & _ "dword OSPlatformId;" & _ "dword ImageSubSystem;" & _ "dword ImageSubSystemMajorVersion;" & _ "dword ImageSubSystemMinorVersion;" & _ "dword GdiHandleBuffer[34];" & _ "dword PostProcessInitRoutine;" & _ "dword TlsExpansionBitmap;" & _ "byte TlsExpansionBitmapBits[128];" & _ "dword SessionId") $aCall = DllCall("kernel32.dll", "bool", "ReadProcessMemory", _ "ptr", $hProcess, _ "ptr", DllStructGetData($tPROCESS_BASIC_INFORMATION, "PebBaseAddress"), _ "ptr", DllStructGetPtr($tPEB), _ "dword", DllStructGetSize($tPEB), _ "dword*", 0) If @error Or Not $aCall[0] Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return SetError(3, 0, "") EndIf Local $tPROCESS_PARAMETERS = DllStructCreate("dword AllocationSize;" & _ "dword ActualSize;" & _ "dword Flags;" & _ "dword Unknown1;" & _ "word LengthUnknown2;" & _ "word MaxLengthUnknown2;" & _ "ptr Unknown2;" & _ "handle InputHandle;" & _ "handle OutputHandle;" & _ "handle ErrorHandle;" & _ "word LengthCurrentDirectory;" & _ "word MaxLengthCurrentDirectory;" & _ "ptr CurrentDirectory;" & _ "handle CurrentDirectoryHandle;" & _ "word LengthSearchPaths;" & _ "word MaxLengthSearchPaths;" & _ "ptr SearchPaths;" & _ "word LengthApplicationName;" & _ "word MaxLengthApplicationName;" & _ "ptr ApplicationName;" & _ "word LengthCommandLine;" & _ "word MaxLengthCommandLine;" & _ "ptr CommandLine;" & _ "ptr EnvironmentBlock;" & _ "dword Unknown[9];" & _ "word LengthUnknown3;" & _ "word MaxLengthUnknown3;" & _ "ptr Unknown3;" & _ "word LengthUnknown4;" & _ "word MaxLengthUnknown4;" & _ "ptr Unknown4;" & _ "word LengthUnknown5;" & _ "word MaxLengthUnknown5;" & _ "ptr Unknown5;") $aCall = DllCall("kernel32.dll", "bool", "ReadProcessMemory", _ "ptr", $hProcess, _ "ptr", DllStructGetData($tPEB, "ProcessParameters"), _ "ptr", DllStructGetPtr($tPROCESS_PARAMETERS), _ "dword", DllStructGetSize($tPROCESS_PARAMETERS), _ "dword*", 0) If @error Or Not $aCall[0] Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return SetError(4, 0, "") EndIf $aCall = DllCall("kernel32.dll", "bool", "ReadProcessMemory", _ "ptr", $hProcess, _ "ptr", DllStructGetData($tPROCESS_PARAMETERS, "CurrentDirectory"), _ "wstr", "", _ "dword", DllStructGetData($tPROCESS_PARAMETERS, "MaxLengthCurrentDirectory"), _ "dword*", 0) If @error Or Not $aCall[0] Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return SetError(5, 0, "") EndIf DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess) Return $aCall[3] EndFunc ; ####################### Below Func is Part of example - Needed to get commandline from more processes. ############ ; ####################### Thanks for this function, wraithdu! (Didn't know it was your.) :) ######################### Func _GetPrivilege_SEDEBUG() Local $tagLUIDANDATTRIB = "int64 Luid;dword Attributes" Local $count = 1 Local $tagTOKENPRIVILEGES = "dword PrivilegeCount;byte LUIDandATTRIB[" & $count * 12 & "]" ; count of LUID structs * sizeof LUID struct Local $TOKEN_ADJUST_PRIVILEGES = 0x20 Local $call = DllCall("advapi32.dll", "int", "OpenProcessToken", "ptr", _WinAPI_GetCurrentProcess(), "dword", $TOKEN_ADJUST_PRIVILEGES, "ptr*", "") Local $hToken = $call[3] $call = DllCall("advapi32.dll", "int", "LookupPrivilegeValue", "str", Chr(0), "str", "SeDebugPrivilege", "int64*", "") ;msgbox(0,"",$call[3] & " " & _WinAPI_GetLastErrorMessage()) Local $iLuid = $call[3] Local $TP = DllStructCreate($tagTOKENPRIVILEGES) Local $LUID = DllStructCreate($tagLUIDANDATTRIB, DllStructGetPtr($TP, "LUIDandATTRIB")) DllStructSetData($TP, "PrivilegeCount", $count) DllStructSetData($LUID, "Luid", $iLuid) DllStructSetData($LUID, "Attributes", $SE_PRIVILEGE_ENABLED) $call = DllCall("advapi32.dll", "int", "AdjustTokenPrivileges", "ptr", $hToken, "int", 0, "ptr", DllStructGetPtr($TP), "dword", 0, "ptr", Chr(0), "ptr", Chr(0)) Return ($call[0] <> 0) ; $call[0] <> 0 is success EndFunc ;==>_GetPrivilege_SEDEBUG Hope this helps1 point
-
DriveMapAdd don't work
behdadsoft reacted to jdelaney for a topic
The map is there, just not available to regular users. if you open a console as admin, you will see it.1 point -
Forum Rules
edenwheeler reacted to Jon for a topic
We want the forum to be a pleasant place for everyone to discuss AutoIt scripting, and we also want to protect the reputation of AutoIt. So we ask you to respect these simple rules while you are here: Forum Posting 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc. Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc. Automation of software/sites contrary to their EULA (see Reporting bullet below). Launching, automation or script interaction with games or game servers, regardless of the game. Running or injecting any code (in any form) intended to alter the original functionality of another process. Decompilation of AutoIt scripts or details of decompiler software. This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum. 2. Do not post material that could be considered pornographic, violent or explicit - or express personal opinions that would not be acceptable in a civilized society. Do not post any copyrighted material unless the copyright is owned by you or by this site. 3. To protect this community, any files posted by you are subject to checks to ensure that they do not contain malware. This includes, but is not limited to, decompilation and reverse engineering. 4. Do not flame or insult other members - and just report the thread to a Moderator (see below) if you are so attacked. 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. 6. Do not create multiple accounts - if you inadvertently created multiple accounts then contact a Moderator to close the unwanted ones. 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. 8. Do not delete your posts, nor completely remove their content, if doing so will interrupt the flow of the thread. 9. Do not post in a thread while the Moderating team are actively trying to determine whether it is legal. The Moderation team will do their best to act in fair and reasonable manner. Sanctions will only be applied as a last resort and any action taken will be explained in the relevant thread. If moderation action is taken, you will need to acknowledge this through a dialog or you will be unable to post further in the forum. Please note that this dialog is not an agreement that the warning was justified - it is only there so that members are aware that moderation action has been taken and that they may have certain restrictions applied to their account. If you feel that you have been unfairly moderated then contact the Moderator concerned - using a PM or the "Report" button is preferable to opening a new thread (although new members may have to do this). But do be aware that the Moderation team has the final word - the rules are set out by the site owner and you are only welcome here if you respect his wishes. Signatures and Avatars There is no formal policy for the use of signatures but if a moderator thinks it is too big and/or distracting then you may be asked to tone it down. No-one likes wading through signatures that are a page high. Similarly for avatars, expect distracting flashing and animated gifs to be removed. Reporting If you feel a post needs Moderator attention, please use the "Report" button next to the post date at the top. You can then enter details of why you have reported the post - but there is no need to include the content of the post as that is done automatically. The Moderating team will be alerted to the post and will deal with it as soon as they can. If you suspect a EULA violation, do not expect the Moderating team to do all the work - please provide some evidence in the report such as a copy of (or link to) the EULA in question, as well as the section you believe has been violated. Finally, please do not enter into an argument with the original poster - that is why we have Moderators. Spam Please do not react to spam in any way other than reporting it. Multiple reports are combined by the forum software, so there is no need to announce that you have reported the spam - in fact doing so only increases the work for the Moderator who deals with it. Interacting with this website Anyone found abusing the website is subject to harsh punishment without warning. A non-exhaustive list of potential abuses include: Automated forum registration or login. Automated posting or sending messages on the forum. Automated manipulation of polls, user reputation or other forum features. Automated creation or comments on issue tracker tickets. Automated creation or editing of wiki pages. Other abuses which are either examples of excessive bandwidth usage or automation of the site. Use common sense. If you do not have common sense, don't do anything. Do not automate the forum, wiki or issue tracker in any way at all. Scripts which automatically update AutoIt such as AutoUpdateIt are acceptable as long as they are not abused and do not generate excessive bandwidth usage.1 point -
List all the unique variables in an Au3 script. #include <Array.au3> Example() Func Example() ; Au3 Script. Local Const $sFilePath = @ScriptFullPath ; Read the filepath. Local $sData = FileRead($sFilePath) Local $aVariables = _GetUniqueVariableNames($sData) ; Get a list of unique variables used in the Au3 script. _ArrayDisplay($aVariables) EndFunc ;==>Example #Obfuscator_Off Func _AssociativeArray_Startup(ByRef $aArray, $fIsCaseSensitive = False) ; Idea from MilesAhead. Local $fReturn = False $aArray = ObjCreate('Scripting.Dictionary') ObjEvent('AutoIt.Error', '__AssociativeArray_Error') If IsObj($aArray) Then $aArray.CompareMode = Int(Not $fIsCaseSensitive) $fReturn = True EndIf Return $fReturn EndFunc ;==>_AssociativeArray_Startup #Obfuscator_On Func _GetUniqueVariableNames($sData, $fIsCount = Default) ; Return zeroth index with count. _StripStringLiterals($sData) ; Strip string literals, so they don't display possible variables matches. Local $aVariables = StringRegExp($sData, '(\$\w+)', 3), $hVariables = 0 _AssociativeArray_Startup($hVariables) If $fIsCount Then $hVariables('Count') = 'Count' For $i = 0 To UBound($aVariables) - 1 $hVariables($aVariables[$i]) = $aVariables[$i] Next $aVariables = $hVariables.Items() If $fIsCount Then $aVariables[0] = UBound($aVariables) - 1 Return $aVariables EndFunc ;==>_GetUniqueVariableNames Func _StripStringLiterals(ByRef $sData) $sData = StringRegExpReplace($sData, '([''"])\V*?\1', '') ; Strip string literals. By PhoenixXL & guinness. EndFunc ;==>_StripStringLiterals1 point