Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/27/2018 in all areas

  1. I once created an AD administration tool namd ADAT. It's easy to create as many tabs as you like and add one or multiple administration tasks per tab. My example scripts can be found here. Maybe this might serve as a foundation for your script. I might as well enhance ADAT with some of your functions (list of OUs in a dropbox etc.).
    2 points
  2. pixelsearch

    Script problem

    Thx a lot Francesco Well I finally started (very slowly) to study RegExp, you sure remember the day I started it lol Gladly I discovered an incredible piece of software to test RegExp expressions. There are a lot of them but that one, written by Lazycat (one of the creator of Koda) in 2006-2007 is a must to my eyes : https://www.autoitscript.com/forum/topic/27025-regexp-quick-tester Not forgetting w0uter who opened the road for others, in sept 2005 : https://www.autoitscript.com/forum/topic/16250-stringregexp-design-gui/ Then steve8tch did a great job, based on w0uter's script, in dec 2005 : https://www.autoitscript.com/forum/topic/19058-stringregexp-gui-for-testing/ I want to thank them all, even if they wrote their scripts more than 10 years ago. It's because of these guys (amongst others) that AutoIt is such a great product now. And if you got some time to spend, please don't forget to read the whole long thread (October 2006), when Jon, Valik and a few others implemented RegExp in AutoIt, it's worth the read and even touching because Jon needed help for this, recognizing it humbly. He made me laugh so much when he wrote : "I swear anyone who understands this stuff is clinically insane." https://www.autoitscript.com/forum/topic/33323-regexp-has-anyone-seen-this-library-before/?page=4&tab=comments#comment-245513
    2 points
  3. trancexx

    Time Control

    'quantum level' Time control is control (e.g. label) showing current time. Depending on your project theme it's sometimes good to have that control in your GUI. This is fairly simple task to build an maintain. Only thing that's not good is that you have either adlib it or add part of the code in script's main loop. Actually that's not bad thing . The bad thing is blocking effect of things that blocks, lol. Dialogs blocks. Other time consuming stuff blocks too. Solution could be to write main script in assembly and part that deals with time in plain AutoiIt. That way the main script could be pushed to some other thread and there would be no interference with our clock and the main script that would cause it to lag. That idea is totally and unbelievable stupid! Much smarter would be generate assembly on the fly to deal with clock/time and to push that to another thread. Like this maybe: Opt("MustDeclareVars", 1) Global $hGui = GUICreate("Time", 350, 270) Global $hLabel = GUICtrlCreateLabel("", 270, 250, 80, 20) GUICtrlSetColor(-1, 0x0000CC) GUICtrlSetFont(-1, 11.5, 600) Global $hButton = GUICtrlCreateButton("MsgBox", 125, 220, 100, 25) _ClockThisInAnotherThread($hLabel) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $hButton If MsgBox(4 + 32, "", "Is this blocking the clock?", 0, $hGui) = 6 Then MsgBox(0, Chr(0x4C) & Chr(105) & Chr(194 / 2) & Chr(0x72) & "...", BinaryToString(0x20756F79) & Chr(Sqrt(0x24C1)) & BinaryToString("0x72652E")) EndIf EndSwitch WEnd Func _ClockThisInAnotherThread($hControl) ; Get kernel32.dll handle Local $aCall = DllCall("kernel32.dll", "ptr", "GetModuleHandleW", "wstr", "kernel32.dll") If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) Local $hHandle = $aCall[0] ; Get addresses of functions from kernel32.dll. Sleep first: Local $aSleep = DllCall("kernel32.dll", "ptr", "GetProcAddress", _ "ptr", $hHandle, _ "str", "Sleep") If @error Or Not $aCall[0] Then Return SetError(2, 0, 0) Local $pSleep = $aSleep[0] ; GetTimeFormatW then: Local $aGetTimeFormatW = DllCall("kernel32.dll", "ptr", "GetProcAddress", _ "ptr", $hHandle, _ "str", "GetTimeFormatW") If @error Or Not $aCall[0] Then Return SetError(3, 0, 0) Local $pGetTimeFormatW = $aGetTimeFormatW[0] ; Get user32.dll handle $aCall = DllCall("kernel32.dll", "ptr", "GetModuleHandleW", "wstr", "user32.dll") If @error Or Not $aCall[0] Then Return SetError(4, 0, 0) $hHandle = $aCall[0] ; Get address of function from user32.dll, SendMessageW: Local $aSendMessageW = DllCall("kernel32.dll", "ptr", "GetProcAddress", _ "ptr", $hHandle, _ "str", "SendMessageW") If @error Or Not $aCall[0] Then Return SetError(5, 0, 0) Local $pSendMessageW = $aSendMessageW[0] ; Allocate enough memory with PAGE_EXECUTE_READWRITE for code to run $aCall = DllCall("kernel32.dll", "ptr", "VirtualAlloc", _ "ptr", 0, _ "dword", 36 + 256, _ ; 36 bytes for strings + 256 bytes for code "dword", 4096, _ ; MEM_COMMIT "dword", 64) ; PAGE_EXECUTE_READWRITE If @error Or Not $aCall[0] Then Return SetError(6, 0, 0) Local $pRemoteCode = $aCall[0] ; Make structure in reserved space Local $CodeBuffer = DllStructCreate("byte[256]", $pRemoteCode) ; Arrange strings in reserved space Local $tSpace = DllStructCreate("wchar Format[9];wchar Result[9]", $pRemoteCode + DllStructGetSize($CodeBuffer)) DllStructSetData($tSpace, "Format", "hh:mm:ss") If @AutoItX64 Then DllStructSetData($CodeBuffer, 1, _ "0x" & _ "4883EC" & SwapEndian(72, 1) & _ "C7442428" & SwapEndian(9, 4) & _ "48BF" & SwapEndian(DllStructGetPtr($tSpace, "Result")) & _ "48897C2420" & _ "49B9" & SwapEndian(DllStructGetPtr($tSpace, "Format")) & _ "49C7C0" & SwapEndian(0, 4) & _ "BA" & SwapEndian(4, 4) & _ "B9" & SwapEndian(0, 4) & _ "48B8" & SwapEndian($pGetTimeFormatW) & _ "FFD0" & _ "49B9" & SwapEndian(DllStructGetPtr($tSpace, "Result")) & _ "49C7C0" & SwapEndian(0, 4) & _ "BA" & SwapEndian(12, 4) & _ "48B9" & SwapEndian(GUICtrlGetHandle($hControl)) & _ "48B8" & SwapEndian($pSendMessageW) & _ "FFD0" & _ "B9" & SwapEndian(491, 4) & _ "48B8" & SwapEndian($pSleep) & _ "FFD0" & _ "4883C4" & SwapEndian(72, 1) & _ "E9" & SwapEndian(-136) & _ "C3" _ ) Else DllStructSetData($CodeBuffer, 1, _ "0x" & _ "68" & SwapEndian(9) & _ ; push output size "68" & SwapEndian(DllStructGetPtr($tSpace, "Result")) & _ ; push pointer to output container "68" & SwapEndian(DllStructGetPtr($tSpace, "Format")) & _ ; push pointer to format string "68" & SwapEndian(0) & _ ; push NULL "68" & SwapEndian(4) & _ ; push TIME_FORCE24HOURFORMAT "68" & SwapEndian(0) & _ ; push Locale "B8" & SwapEndian($pGetTimeFormatW) & _ ; mov eax, [$pGetTimeFormatW] "FFD0" & _ ; call eax "68" & SwapEndian(DllStructGetPtr($tSpace, "Result")) & _ ; push pointer to the result "68" & SwapEndian(0) & _ ; push wParam "68" & SwapEndian(12) & _ ; push WM_SETTEXT "68" & SwapEndian(GUICtrlGetHandle($hControl)) & _ ; push HANDLE "B8" & SwapEndian($pSendMessageW) & _ ; mov eax, [$pSendMessageW] "FFD0" & _ ; call eax "68" & SwapEndian(491) & _ ; push Milliseconds "B8" & SwapEndian($pSleep) & _ ; mov eax, [$pSleep] "FFD0" & _ ; call eax "E9" & SwapEndian(-81) & _ ; jump back 81 bytes (start address) "C3" _ ; Ret ) EndIf ; Create new thread to execute code in $aCall = DllCall("kernel32.dll", "ptr", "CreateThread", _ "ptr", 0, _ "dword", 0, _ "ptr", $pRemoteCode, _ "ptr", 0, _ "dword", 0, _ "dword*", 0) If @error Or Not $aCall[0] Then Return SetError(8, 0, 0) Local $hThread = $aCall[0] ; Return thread handle Return $hThread EndFunc Func SwapEndian($iValue, $iSize = @AutoItX64 ? 8 : 4) Return Hex(BinaryMid($iValue, 1, $iSize)) EndFunc This is obviously a variation on assembly/machine code/threads theme, but doesn't hurt to take advantage (or try to) of the ability a bit more.
    1 point
  4. trancexx

    Time Control

    Not until few moments ago. First post edited.
    1 point
  5. @NewBie_2018 Maybe you were asking for set more values in a ComboBox? If so, just use GUICtrlSetData() with the pipe symbol " | ", which means "new row" in your ComboBox list
    1 point
  6. 1 point
  7. It is not a problem, we can move the topic. Did my suggestion fix the issue for you?
    1 point
  8. @Abo-Mota as is always the case, there are multiple ways to skin the proverbial cat with AutoIt. If you have a large amount of text you want to add to the combobox, in addition to AutoBert's suggestion you can also add an array, like so: #include <Array.au3> #include <GUIConstantsEx.au3> Local $hGUI = GuiCreate("Test", 300, 400) Local $hCombo = GUICtrlCreateCombo("", 10, 10, 100, 40) Local $aArray[7] = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] GUICtrlSetData($hCombo, _ArrayToString($aArray, "|")) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd
    1 point
  9. @NewBie_2018 Welcome to the forum. Try changing this: MsgBox(0, "test", $Combo1) To this: MsgBox(0, "test", GUICtrlRead($Combo1)) See the help file on GUICtrlRead for more info.
    1 point
  10. I believe that you will need to switch to the tab, delete it, then restore focus to the current tab.
    1 point
  11. My 1st RegExp post ever, hope it won't be the last one To our RexExp gurus, could this be a bit of help ? #include <MsgBoxConstants.au3> Local $sInput = "hello (ed) all," & @CRLF & _ "(I) we wish you a (great) terrific moment here !" Local $sOutput = StringStripWS(StringRegExpReplace($sInput, "(?U)(\(.*\))", ""), 4) ; 4 => strip double (or more) spaces between words in function StringStripWS() MsgBox($MB_TOPMOST, "Display", _ "Before :" & @CRLF & $sInput & @CRLF & @CRLF & _ "After :" & @CRLF & $sOutput) Though I'm not totally satisfied with the fact that all double spaces between words become one only but hey, it's my 1st RegExp
    1 point
  12. Use the separator (standard = '|') to add more than one item in combo box. ; Add additional items to the combobox. GUICtrlSetData($idComboBox, "Item 2|Item 3", "Item 2") Just test the example script in help for GUICtrlCreateCombo.
    1 point
  13. mLipok

    XML support?

    BETA is because nobody helping in checking FunctionHeaders, and no one does complete check out. HelpFile >> look in FunctionHeaders. This UDF is fully done, and working well. If you find BUG or find any inconsistence in documentation (aka functionHeaders), just write new post in XML.au3 UDF support topic.
    1 point
  14. @NewShadow welcome to the forum. Can you please be a bit more clear on your request? Are you saying you want your script to delete the number 8, any periods and any commas? What do you want to delete them from, a text file, an excel spreadsheet, a GUI, etc.? Please read this post to see what kind of information we need to help you
    1 point
  15. @FrancescoDiMuro you are 100% correct, I made something of a Rube Goldberg machine there
    1 point
  16. I "solved" the Problem like this btw: - takes Hardware id - encrypt hardware id - downloade .txt from my Dropbox etc - read the .txt and check if the encrypted hardware id is in there If yay then you can pass, If nay then it will show the encrypted hardware id (and put it in the clipboard) so the user can send me his money and the encrypted hardware id and ill add it to the list then. Why i used this method even tho its less save than a php site etc? Because if someone sniffs the downloaded .txt he has to decrypt or encrypt a hardware id first with my algorithm. To get my algorithm he has to crack my program first. And if he managed to do this, he could also simply remove the whole login part anyway, thats why its pointless to try to make it more serverbase imo (maybe i forget something tho)
    1 point
  17. JRSmile

    dll call failed

    @argumentum i needed a solution that is known to be able to read the GPU framebuffer. a screenshot didn't capture all overlays in my tests. the other thing from what i undertand that the process writing to the gpu is not able to see the copy of the frame beeing leeached. and is not disturbed otherwise. i theory you could be able to get nearly realtime fps from the dxgi api at least on newer cards as the use the copy commands which are part of the gpu. i am researching KI and a quick and application independant true grab of the gpu framebuffer is key to my solution. autoit helps for POCs but i think i have to switch to python soon :-( these new tensor cores on rtx 2060+ cards are more then interresting. i was able to save a bmp, you might want to look at the original source. https://github.com/pgurenko/DXGICaptureSample/blob/master/DXGICaptureSample/DXGICaptureSample.cpp
    1 point
  18. @lokatylokacz GUICtrlSetData($youreditcontrol, "Line 1" & @CRLF, -1) GUICtrlSetData($youreditcontrol, "Line 2" & @CRLF, -1)
    1 point
  19. Subz

    INI to List

    When you use _FileReadToArray without the optional parameters, the first item in the array or $aFileList[0] returns the last row number in the array, so For $i = 1 To <End of Array> see example below: _FileReadToArray without the $sDelimiter will return a 1D array otherwise it will display a 2D array in which case you would need to use For $i = 1 To $aFileList[0][0] With regards to RTF format, no I don't believe lists support that format. #include <Array.au3> #Include <File.au3> #Include <GUIConstants.au3> Local $hGui = GUICreate("AForm1", 633, 447, 193, 115) Local $idList = GUICtrlCreateList("", 40, 40, 169, 357) GUISetState() Local $aFileList _FileReadToArray("Test.txt", $aFileList) _ArrayDisplay($aFileList) For $i = 1 To $aFileList[0] GUICtrlSetData($idList,$aFileList[$i]) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
    1 point
  20. Subz

    INI to List

    No you would have to use something like _FileReadToArray example: #Include <File.au3> #Include <GUIConstants.au3> Local $hGui = GUICreate("AForm1", 633, 447, 193, 115) Local $idList = GUICtrlCreateList("", 40, 40, 169, 357) GUISetState() Local $aFileList _FileReadToArray("Test.txt", $aFileList) For $i = 1 To $aFileList[0] GUICtrlSetData($idList,$aFileList[$i]) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
    1 point
  21. Subz

    INI to List

    $FileList[$i][0] = first column or Ini Key $FileList[$i][1] = Second column or Ini Value
    1 point
  22. careca

    INI to List

    I'd say is the easiest For $i=1 To $FileList[0][0] GUICtrlSetData($List1,$FileList[$i][1]) Next
    1 point
  23. Why so complicated code? #NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <TrayConstants.au3> #include <GuiMenu.au3> Opt("GUIOnEventMode", 1) Opt("TrayMenuMode", 3) Opt("TrayOnEventMode", 1) Global $hGui MyExample() Func MyExample() $hGui = GUICreate("") TraySetOnEvent($TRAY_EVENT_SECONDARYDOWN, "MyTrayMenu") TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu. While 1 Sleep(10) ; An idle loop. WEnd EndFunc Func MyTrayMenu() Local Enum $e_idOpen = 1000, $e_idSave, $e_idInfo, $e_idClose Local $hMenu = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_AddMenuItem($hMenu, "Open", $e_idOpen) _GUICtrlMenu_AddMenuItem($hMenu, "Save", $e_idSave) _GUICtrlMenu_AddMenuItem($hMenu, "", 0) _GUICtrlMenu_AddMenuItem($hMenu, "Info", $e_idInfo) _GUICtrlMenu_AddMenuItem($hMenu, "", 0) _GUICtrlMenu_AddMenuItem($hMenu, "Close", $e_idClose) Switch _GUICtrlMenu_TrackPopupMenu( $hMenu, $hGui, -1, -1, 1, 1, 2 ) Case $e_idOpen ConsoleWrite( "Open" & @CRLF ) Case $e_idSave ConsoleWrite( "Save" & @CRLF ) Case $e_idInfo ConsoleWrite( "Info" & @CRLF ) Case $e_idClose ConsoleWrite( "Close" & @CRLF ) Exit EndSwitch _GUICtrlMenu_DestroyMenu($hMenu) EndFunc
    1 point
  24. You might directly go for a 2D array #include <Array.au3> Local $sTimeInput = "190" $aTimeInput = StringSplit($sTimeInput, "") $a = $aTimeInput[$aTimeInput[0] - 1] +10 $b = $aTimeInput[$aTimeInput[0]] + 10 Local $aResults[4][10] For $j = 0 to 9 $aResults[0][$j] = $j & Mod($a-1, 10) & Mod($b-1, 10) $aResults[1][$j] = $j & Mod($a+1, 10) & Mod($b+1, 10) $aResults[2][$j] = $j & Mod($a-1, 10) & Mod($b+1, 10) $aResults[3][$j] = $j & Mod($a+1, 10) & Mod($b-1, 10) Next _ArrayDisplay($aResults) FileWrite(@ScriptDir & "\Tracking.txt", _ArrayToString($aResults, @crlf))
    1 point
  25. I searched this forum for long to find any suitable dark theme, but in the end stitched mine. check.if.already.open=0 ## Debug Output Options (to permanent change your selection copy them to SciTEUser.Properties and change it there # Debug MessageBox Option 2="All" 1="No @extended" 0="No @extended & @error". debug.msgbox.option=0 # Debug Console Option 3="All" 2="No SystemTime" 1="No SystemTime & Return" 0="No SystemTime, Return & Error". debug.console.option=0 # Debug Trace Option 3="All" 2="No SystemTime" 1="No SystemTime & Return" 0="No SystemTime, Return & Error". debug.trace.option=2 title.full.path=1 ;Chooses how the file name is displayed in the title bar. When 0 (default) the file name is displayed. When 1 the full path is displayed. When 2 the window title displays "filename in directory". font.base=font:Consolas,size:10,$(font.override) font.monospace=font:Consolas,size:10 backup.files=0 proper.case=0 error.inline=1 highlight.current.word=1 highlight.current.word.by.style=0 ;Allows highlight in comments also highlight.current.word.autoselectword=0 ;Force enable only after minlenght highlight.current.word.wholeword=0 highlight.current.word.matchcase=0 highlight.current.word.minlength=3 ;How many chars before higlight use.tabs=1 indent.size=4 indent.size.*.au3=4 tabsize=4 style.*.32=fore:#009999,back:#003F3F,$(font.base) ; 32 is the default style and its features will be inherited by all other styles unless overridden. caret.line.back=#101010 caret.line.back.alpha=50 selection.fore=#FFFFFF selection.alpha=60 selection.back=#78A878 selection.multipaste=1 style.error.1=fore:#FF0000,back:#24221C style.error.2=fore:#FF0000,back:#000000 highlight.current.word.colour=#FF0000 ;Color of highlighht indicators.alpha=63 calltips.set.above=0 style.au3.38=fore:#AAA6DB,back:#505050 calltips.color.highlight=#FF0000 visible.policy.strict=1 visible.policy.lines=0 style.*.34=fore:#FFFFFF,back:#000000 ; 34 and 35 are used to display matching and non-matching braces respectively. style.*.35=fore:#FF0000,back:#FF0000 ; 34 and 35 are used to display matching and non-matching braces respectively. style.au3.0=fore:#DC4050 0X White space72ADC0 UserDefined Functions and their calls: Terminate(),back:#1F1F1F style.au3.1=fore:#71AE71,back:#1F1F1F style.au3.2=fore:#71AE71,back:#1F1F1F style.au3.3=fore:#A7A8B9 0X Number,back:#1F1F1F style.au3.4=fore:#AAA6DB 0X Function Run(),back:#1F1F1F style.au3.5=fore:#0080FF 0X Keyword,back:#1F1F1F style.au3.6=fore:#FF46FF 0X Macro @error,back:#1F1F1F style.au3.7=fore:#A7A8B9 0X String,back:#1F1F1F style.au3.8=fore:#FF6060 0X Operator,back:#1F1F1F style.au3.9=fore:#D29A6C 0X Variable,back:#1F1F1F style.au3.10=fore:#EA9515,back:#1F1F1F style.au3.11=fore:#F000FF 0X Pre-Processor,back:#1F1F1F style.au3.12=fore:#0080C0 0X Special,back:#1F1F1F style.au3.13=fore:#7D8AE6,back:#1F1F1F style.au3.14=fore:#0080FF,back:#1F1F1F style.au3.15=fore:#72ADC0 0X Standard UDFs,back:#1F1F1F style.au3.16=fore:#0080FF,back:#1F1F1F command.name.7.*= command.name.19.*= command.name.33.*= openpath.$(au3)=$(SciteDefaultHome)\..\include check.updates.scite4autoit3=0 style.*.33=fore:#008A8A,back:#000C0C,$(font.base) ; 33 is used to display line numbers in the margin. style.*.37=fore:#8A8A8A,back:#0C0C0C whitespace.fore=#999999 ;Sets the colours used for displaying all visible whitespace, overriding any styling applied by the lexer. whitespace.back=#3F3F3F ;Sets the colours used for displaying all visible whitespace, overriding any styling applied by the lexer. bookmark.fore=#000000 ;The colours used to display bookmarks in the margin. If bookmark.fore is empty then a blue sphere is used. When the margin is turned off, bookmarks are shown by a change in the background colour of the line with the translucency set with bookmark.alpha. bookmark.back=#71AE71 ;The colours used to display bookmarks in the margin. If bookmark.fore is empty then a blue sphere is used. When the margin is turned off, bookmarks are shown by a change in the background colour of the line with the translucency set with bookmark.alpha. style.*.32=fore:#009999,back:#003F3F,$(font.base) ; 32 is the default style and its features will be inherited by all other styles unless overridden. style.batch.0=fore:#999999 # Default (SCE_BAT_DEFAULT) style.batch.1=fore:#71AE71 # Comment (rem or ::) (SCE_BAT_COMMENT) style.batch.2=fore:#009FFF,bold # Keywords (SCE_BAT_WORD) style.batch.3=fore:#C8C800,back:#000000 # Label (line beginning with ':') (SCE_BAT_LABEL) style.batch.4=fore:#FF46FF,bold # Hide command character ('@') (SCE_BAT_HIDE) style.batch.5=fore:#AAA6DB,bold # External commands (SCE_BAT_COMMAND) style.batch.6=fore:#D39D72,bold # Variable: %%x (x is almost whatever, except space and %), %n (n in ) (SCE_BAT_IDENTIFIER) style.batch.7=fore:#FF8080 # Operator: * ? < > | (SCE_BAT_OPERATOR) style.batch.8=fore:#D39D72,bold # Variable: %EnvironmentVar% (SCE_BAT_ENVIRONMENT) style.batch.9=fore:#D39D72,bold # Variable: !EnvironmentVar! (SCE_BAT_EXPANSION) style.batch.10=fore:#448489,bold # Label in text (SCE_BAT_CLABEL) comment.block.batch=:: braces.batch.style=7 # Braces are only matched in operator style style.*.32=fore:#009999,back:#003F3F,$(font.base) ; 32 is the default style and its features will be inherited by all other styles unless overridden. style.*.34=fore:#FFFFFF,back:#000000 ; 34 and 35 are used to display matching and non-matching braces respectively. style.*.35=fore:#FF0000,back:#FF0000 ; 34 and 35 are used to display matching and non-matching braces respectively. style.*.33=fore:#008A8A,back:#000C0C,$(font.base) ; 33 is used to display line numbers in the margin. style.au3.37=fore:#8A8A8A,back:#0C0C0C line.margin.width=1+ fold.margin.colour=#1F1F1F ;checkerboard pixel patter color 1 around fold trees fold.margin.highlight.colour=#1F1F1F ;checkerboard pixel patter color 2 around fold trees caret.fore=#8FAF9F edge.colour=#8A8A8A edge.mode=0 style.*.32=fore:#009999,back:#003F3F,$(font.base) ; 32 is the default style and its features will be inherited by all other styles unless overridden. style.errorlist.0=fore:#F9F9F9 # ; Actual consoleWrite output style.errorlist.2=fore:#C738B9 style.errorlist.3=fore:#71AE71 # ; >@@ DEBUG (15) : Actual Console output style.errorlist.4=fore:#AAA6DB # ; >Error code: 0 style.errorlist.5=fore:#000000 style.errorlist.11=fore:#EA9515 # ; +>10:21:37 Starting AutoIt3Wrapper v.16.306.1237.......... style.errorlist.12=fore:#AF20C0 # ; --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop style.errorlist.21=fore:#c0c000 error.marker.fore=fore:#505050,back:#3F3F3F colour.error=fore:#ff0000,back:#FF8080 style.css.0=fore:#DCDCCC style.css.1=fore:#AAA6DB style.css.2=fore:#0080FF style.css.3=fore:#61AFAF style.css.4=fore:#CEDF99 style.css.5=fore:#FF8080 style.css.6=fore:#D29A6C style.css.7=fore:#DCDCCC style.css.8=fore:#8296AE style.css.9=fore:#71AE71 style.css.10=fore:#CEDF99 style.css.11=fore:#BFCAA9 style.css.12=fore:#CEDF99 style.css.13=fore:#b5b5b5 style.css.14=fore:#b5b5b5 style.props.0=fore:#A7A7A7 # Default style.props.1=fore:#71AE71 # Comment style.props.2=fore:#4A88D2 # Section style.props.3=fore:#FF8080 # Assignment operator style.props.4=fore:#FF8380 # Default value (@) style.props.5=fore:#A7A7A7 # Key style.props.6=fore:#A7A7A7 # Keys Set 0 style.props.8=fore:#A7A7A7 # Keys Set 2 style.hypertext.0=fore:#999999 # Text style.hypertext.1=fore:#0080FF # Tags style.hypertext.2=fore:#EDD6ED # Unknown Tags style.hypertext.3=fore:#FF8080 # Attributes style.hypertext.4=fore:#DFDFDF # Unknown Attributes style.hypertext.5=fore:#FF00FF # Numbers style.hypertext.6=fore:#CC9393 # Double quoted strings style.hypertext.7=fore:#6860D2 # Single quoted strings style.hypertext.8=fore:#B5B5B5 # Other inside tag style.hypertext.9=fore:#71AE71 # Comment style.hypertext.10=fore:#CDD04A,back:#555555 # Entities style.hypertext.11=fore:#E3CEAB # XML style tag ends '/>' style.hypertext.17=fore:#C89191 # CDATA style.hypertext.19=fore:#FF8000 # Unquoted values style.hypertext.21=fore:#DFDFDF # SGML tags <! ... > style.xml.0=fore:#999999 # Default style.xml.1=fore:#AAA6DB # Tags style.xml.2=fore:#EDD6ED # Unknown Tags style.xml.3=fore:#CC7975 # Attributes style.xml.4=fore:#CC7975 # Unknown Attributes style.xml.5=fore:#8CD0D3 # Numbers style.xml.6=fore:#8296AE # Double quoted strings style.xml.7=fore:#8296AE # Single quoted strings style.xml.8=fore:#B5B5B5 # Other inside tag style.xml.9=fore:#71AE71 # Comment style.xml.11=fore:#AAA6DB # XML style tag ends '/>' style.xml.12=fore:#7F9F7F # XML identifier start '<?' style.xml.13=fore:#7F9F7F # XML identifier end '?>' style.xml.17=fore:#6860D2 # CDATA style.xml.21=fore:#CC7975 # SGML tags <! ... > ; style.xml.1=fore:#0080FF ; style.xml.3=fore:#FF8080 ; style.xml.4=fore:#FF8080 ; style.xml.6=fore:#6860D2 ; style.xml.7=fore:#6860D2 ; style.xml.11=fore:#0080FF ; style.xml.21=fore:#FF8080 ; colour.comment=fore:#008000 ; colour.code.comment.doc=$(colour.comment),back:#FEFEFE ; colour.embedded.comment=back:#E0EEFF ; colour.number=fore:#C738B9 ; colour.keyword=fore:#0080FF ; colour.string=fore:#999999 ; colour.char=$(colour.string) ; colour.operator=fore:#FF8080 ; colour.preproc=fore:#F000FF ; colour.error=fore:#ff0000,back:#FF8080 ; colour.whitespace=fore:#72ADC0 style.vb.0=fore:#FF8080 # Default, White space - @ style.vb.1=fore:#71AE71,italics # Comment style.vb.2=fore:#DC57EB # Number style.vb.3=fore:#0080FF # Keyword1 style.vb.4=fore:#999999 # String style.vb.5=fore:#D997DE # Preprocessor (directives) style.vb.6=fore:#FF8080 # Operator style.vb.7=fore:#C0AD72 # Identifier style.vb.10=fore:#0080FF # Keyword2 style.vb.11=fore:#0080FF # Keyword3 style.vb.12=fore:#0080FF # Keyword4 style.cpp.0=fore:#72ADC0 # White space style.cpp.1=fore:#71AE71,italics # Comment line style.cpp.2=fore:#71AE71,italics # Comment block style.cpp.3=fore:#AAA6DB # style.cpp.4=fore:#C738B9 # Number style.cpp.5=fore:#0080FF # Keyword style.cpp.6=fore:#999999 # String style.cpp.7=fore:#9999AA # style.cpp.8=fore:#FF8080 # style.cpp.9=fore:#F000FF # Pre-Processor style.cpp.10=fore:#FF8080 # Operator style.cpp.11=fore:#D29A6C # Variable style.cpp.12=fore:#0080C0 # Special style.cpp.13=fore:#7D8AE6,bold # Abbrev-Expand style.cpp.14=fore:#0080FF,bold # Com Objects style.cpp.15=fore:#72ADC0 # Standard UDFs edge.column=5000 line.margin.visible=1 caret.width=1 fold.compact=0 ;Turning this option on leads to blank lines following the end of an element folding with that element. Defaults to on. fold.colour=#606060 ;Not highlighted color of line connecting lines fold.highlight.colour=#0060Af # ;Highlited font.base=font:Consolas,size:10,$(font.override) blank.margin.right=0 blank.margin.left=6 fold=1 fold.on.open=0 ;To automatically fold files as much as possible when loaded, set fold.on.open to 1. fold.preprocessor=0 fold.comment=1 fold.flags=0 fold.symbols=3 ;The fold.symbols setting chooses between four ways of showing folding. Set to 0 (the default) for macOS style arrows to indicate contracted (facing right) and expanded (facing down); 1 to display contracted folds with "+" and expanded with "-"; 2 for a flattened tree control with round headers and rounded joins; 3 for a flattened tree control with square headers. fold.highlight=1 ;Set to 1 to enable highlight for current folding block (smallest one that contains the caret). By default, its disable. Note : The highlight is enabled only when fold.symbols equals to 2 (round headers) or 3 (square headers). fold.margin.width=16 style.*.33=fore:#008A8A,back:#000C0C,$(font.base) ; 33 is used to display line numbers in the margin. font.base=font:Consolas,size:10,$(font.override) font.base=font:Consolas,size:10,$(font.override) ; style.au3.32=style.*.32=$(font.base),back:#3F3F3F # Background (??? ??? ????) ; style.au3.34=fore:#FFFFFF,back:301030 # Brace highlight ; style.au3.35=fore:#FF1010,back:B03030 # Brace incomplete highlight ;style.au3.33=fore:#8A8A8A,back:#0C0C0C,$(font.base) ;style.au3.37=fore:#8A8A8A,back:#0C0C0C fold.fore=#505050 ;Color of symbol Fore color fold.back=#202020 ;Color of symbol fill style.*.32=fore:#009999,back:#003F3F,$(font.base) ; 32 is the default style and its features will be inherited by all other styles unless overridden. style.errorlist.32=back:#3F3F3F,$(font.monospace) style.au3.32=style.*.32=$(font.base),back:#1F1F1F style.au3.34=fore:#0080FF 0X Keyword,back:#1F1F1F style.au3.35=fore:#71AE71,back:#1F1F1F highlight.current.word.indicator=style:fullbox,colour:#FFFF80,outlinealpha:200,fillalpha:80 import au3.UserUdfs import au3.keywords.user.abbreviations style.error.0=fore:#ff0000,back:#F0F0F0 Dark.SciTEConfig
    1 point
  26. Trong

    read cmd output

    Function for CMD: ;~ #RequireAdmin #include <File.au3> If @OSArch = "X64" And Not @AutoItX64 Then _Wow64FsRedirection(0) Local $output= _RunCmd_GetOutput("qwinsta") ;~ Local $output=_StreamCMD("ping 8.8.8.8") Local $username=StringStripWS(StringMid($output,StringinStr($output,"console")+18,20),3) MsgBox(0, "", $username) Func _RunCmd_GetOutput($sCommand) ConsoleWrite("+Execute: " & $sCommand & @CRLF) Local $sOutput = '', $iPID = Run('"' & @ComSpec & '" /c ' & $sCommand, '', @SW_HIDE, 0x6) Do $sOutput &= StdoutRead($iPID) Until @error Do $sOutput &= StderrRead($iPID) Until @error ConsoleWrite($sOutput&@CRLF) Return $sOutput EndFunc ;==>_RunCmd Func _StreamCMD($sCMD, $sCallBackFunction = Default, $WorkingDir = Default, $iStreamType = Default, $iShowFlag = Default, $iDelay = Default) If StringStripWS($sCMD, 8) = "" Then Return "" If $sCallBackFunction = Default Then $sCallBackFunction = "ConsoleWrite" ;~ If $WorkingDir = Default Then $WorkingDir = @SystemDir ;@WindowsDir & '\System32' If $WorkingDir = Default Then $WorkingDir = @WindowsDir & '\System32' If $iStreamType = Default Then $iStreamType = $STDERR_CHILD + $STDOUT_CHILD If $iShowFlag = Default Then $iShowFlag = False If $iDelay = Default Then $iDelay = 250 ConsoleWrite("! Execute: " & $sCMD & @CRLF) Local $sTMP = '', $sSTD = '', $sCOM = '"' & @WindowsDir & '\System32\cmd.exe"' & ' /c ' & $sCMD ;~ Local $sTMP = '', $sSTD = '', $sCOM = @ComSpec & ' /c ' & $sCMD Local $iWin = $iShowFlag ? @SW_SHOW : @SW_HIDE Local $iPID = Run($sCOM, $WorkingDir, $iWin, $iStreamType) While 1 $sTMP = StdoutRead($iPID, False, False) If @error Then ExitLoop If $sTMP <> "" Then $sTMP = StringReplace($sTMP, @CR & @CR, '') $sSTD &= $sTMP Call($sCallBackFunction,$sTMP) ;~ ConsoleWrite($sTMP) Sleep($iDelay) EndIf WEnd While 1 $sTMP = StderrRead($iPID, False, False) If @error Then ExitLoop If $sTMP <> "" Then $sTMP = StringReplace($sTMP, @CR & @CR, '') $sSTD &= $sTMP Call($sCallBackFunction,$sTMP) ;~ ConsoleWrite($sTMP) Sleep($iDelay) EndIf WEnd ;~ If $sSTD <> "" Then ConsoleWrite(@CRLF) Return SetError(@error, @extended, $sSTD) EndFunc ;==>_StreamCMD ; * -----:| Dao Van Trong - TRONG.WIN Func _Wow64FsRedirection($state) If @OSArch = "X64" Then If $state Then ;DllCall("kernel32.dll", "int", "Wow64EnableWow64FsRedirection", "int", 1) DllCall("kernel32.dll", "int", "Wow64RevertWow64FsRedirection", "int", 0) Else ;DllCall('kernel32.dll', 'boolean', 'Wow64EnableWow64FsRedirection', 'boolean', False) DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 0) EndIf If @error Then Return SetError(1, 0, 0) Return 1 EndIf EndFunc ;==>_Wow64FsRedirection
    1 point
×
×
  • Create New...