Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/29/2016 in all areas

  1. You want variants? Okay. Local $s = "<li>One<li>Inner<li>Innermost</li>rhagnagna</li>gloups</li><li>Two</li>" Local $regex = _ '(?imsx)' & _ '(?(DEFINE) (?<LiStart> <li> ) )' & _ '(?(DEFINE) (?<LiEnd> <\/li> ) )' & _ '(?(DEFINE) (?<LiBlock> (?&LiStart) (?: (?&LiBlock)* | .*? )* (?&LiEnd) ) )' & _ '(?&LiBlock)' $data = StringRegExp($s, $regex, 3) _ArrayDisplay($data) $regex = _ '(?imsx)' & _ '(?<LiBlock>' & _ ' <li>' & _ ' (?: (?&LiBlock)* | .*? )*' & _ ' <\/li>' & _ ')' $data = StringRegExp($s, $regex , 3) _ArrayDisplay($data) $regex = _ '(?imsx)' & _ '(' & _ ' <li>' & _ ' (?: (?-1)* | .*? )*' & _ ' <\/li>' & _ ')' $data = StringRegExp($s, $regex , 3) _ArrayDisplay($data) $regex = '(?ims)(<li>(?:(?-1)*|.*?)*<\/li>)' $data = StringRegExp($s, $regex , 3) _ArrayDisplay($data)
    2 points
  2. [BUGFIX VERSION] - 6 Apr 24 Fixed: UDF failed if header colours were initialised but not specifically set. New UDF in the zip below. -------------------------------------------------------------------------------------- Note: This is a new recoded and expanded version of my earlier UDF of the same name. If you move to this new version there might well be several script-breaking changes, particularly when setting which columns are to be editable. Please read the "Beginner's Guide" and look at the included example scripts to see where things have changed. -------------------------------------------------------------------------------------- This UDF allows you to do much more with ListView controls (either native or UDF created): Edit the content with plain text, combos or date-time pickers - and edit the headers too Move rows within the ListView Drag rows both within the ListView and to other ListViews in the same GUI (or not as required) Insert and delete columns and rows Sort columns by simply clicking the header Colour individual ListView items and headers Only select a single cell rather then the entire row Save and load entire ListViews For the advanced user: If you use certain Windows message handlers (In particular WM_NOTIFY) in your script, please read the function headers for the equivalent handlers within the UDF. Here is the UDF, with 6 examples and the guide, in zip format: GUIListViewEx.zip Credit to: martin (basic drag code), Array.au3 authors (array functions), KaFu and ProgAndy (font function), LarsJ (colouring code) Happy to take compliments or criticism - preferably the former! M23
    1 point
  3. Apparently the last character of the returned string is a null and that screws with the string building (well, it terminates the string). So try stripping the last character of the retrieved username (my commented line), that should do it. #include <Array.au3> $un = _GetUsername() ;~ $un = StringLeft($un, stringlen($un) - 1) ; <-- The solution For $i = 1 To StringLen($un) $char = StringMid($un, $i, 1) ConsoleWrite(Asc($char) & " : >" & $char & "<" & @CRLF) Next $thing = StringLen($un) & " - 123" & String($un) & "456" ConsoleWrite(@CRLF & $thing & @CRLF) Func _GetUsername() Local $sUsername = "" Local $aResult = DllCall("Wtsapi32.dll", "int", "WTSQuerySessionInformationW", "int", 0, "dword", -1, "int", 5, "dword*", 0, "dword*", 0) If @error Or $aResult[0] = 0 Then Return SetError(1, 0, 0) Local $sUsername = BinaryToString(DllStructGetData(DllStructCreate("byte[" & $aResult[5] & "]", $aResult[4]), 1), 2) DllCall("Wtsapi32.dll", "int", "WTSFreeMemory", "ptr", $aResult[4]) Return $sUsername EndFunc ;==>_GetUsername
    1 point
  4. Try it and you will get new ideas what to code.
    1 point
  5. Thanks, has already been fixed in the next version
    1 point
  6. Not sure if this method will work for you, but I had a similar situation and was able to solve it by using an embedded IE object. This allowed me to use INetGet to download the file under the current authorized user.
    1 point
  7. Unfortunately the solution is not sufficient. Try this: Why isn't Autoit able to click a Javascript Dialog?
    1 point
  8. The Popup-MsgBox from IE is modal and so AutoIt is blocked so se a Adlib func waiting for the popup: ; Open a browser with the basic example page, insert an ; event script into the head of the document that creates ; a JavaScript alert when someone clicks on the document #include <IE.au3> Local $oIE = _IE_Example("basic") _IEHeadInsertEventScript($oIE, "document", "onclick", "alert('Someone clicked the document!');") AdlibRegister('CloseAlert', 1000) $tdStart = TimerInit() While TimerDiff($tdStart) < 60000 Sleep(1000) WEnd _IEQuit($oIE) Func CloseAlert () Sleep(3000) ControlClick('[CLASS:#32770]', 'Someone clicked the document!', 2) EndFunc ;==>CloseAlert
    1 point
  9. 1 point
  10. I think you're going to have to compromise between speed and functionality. With networking, you usually can't have both working well, one is going to suffer if you want the other. There are a LOT of network scanners out there and they all suffer from the same thing, they take a long time to populate the list, if you're doing it dynamically. If you do a once in a while update of the list, then speed isn't an issue, but if you want real-time, you're probably not going to be able to achieve it.
    1 point
  11. It seems like it's not possible to remove the window taskbar icon. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIEx.au3> Local Const $GCL_HICONSM = -34, $GCL_HICON = -14 Local $hGUI = 0, $hIcon = 0 #region GUI $hGUI = GUICreate("MyGUI", Default, Default, -1, -1, -1, $WS_EX_DLGMODALFRAME) $hIcon = _WinAPI_GetClassLongEx($hGUI, $GCL_HICON) _WinAPI_DestroyIcon($hIcon) _WinAPI_SetClassLongEx($hGUI, $GCL_HICON, 0) _WinAPI_SetClassLongEx($hGUI, $GCL_HICONSM, 0) GUISetState(@SW_SHOW, $hGUI) #endregion While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd GUIDelete($hGUI) You will need to set a transparent icon. Br, FireFox.
    1 point
  12. Well it's not possible with _IsPressed and why the reluctance to use Functions?
    1 point
  13. I shouldn't worry Lilbert Ive asked stupider things and survived .. Still do from time to time
    1 point
  14. AdlibRegister functions, if just looking for a key press, aren't very CPU intensive. Try it, open Taskmanager and watch the CPU usage of your script, it's minimal.
    1 point
  15. it dont need to have specific loop reserved only for it Some other solutions for loop AdlibRegister as for how to get pid and close other script @AutoItPID will return running pid ProcessList will get currently running processes and their pid-s Compare one to another in loop to get the other pid or Post the script that can replicate problem with Your post of 2 scripts with 4 lines do not help to see about what are you talking about.Edit: Note that there isnt alot of things that need 2 scripts running in diffrent loops to achieve something. Mostly the problem is that other side don`t know how to organise their loop.
    1 point
×
×
  • Create New...