Leaderboard
Popular Content
Showing content with the highest reputation on 05/09/2023 in all areas
-
RegExpQuickTester 2.5r
CYCho reacted to pixelsearch for a topic
Hi everybody Here is the script I use to test RegEx patterns offline, it's handy. Credits go to Lazycat, who scripted it initially many years ago and thanked "w0uter for ideas and parts of code". I added some modifications (listed in next post) and would like to thank @jchd @mLipok @mikell @Nine @mistersquirrle @taurus905 and @ioa747 for their contribution. Below are the match text & patterns corresponding to the pic above. For a start, you can copy and paste them in their respective edit control. After you choose the corresponding RegExp mode from the ComboBox at the bottom of the screen (mode 3 = return array of global matches) then you'll have the same results as displayed in the pic above. Match Text : blabla...blabla... blabla..."https://media.pic1.jpg"blabla..."https://media.pic2.png"... blabla..."https://media.pic3.jpg"blabla..."https://media.pic4.png"... blabla...blabla... Pattern : (?i)"([^"]+?\.(?:jpg|png))" When you end the script, 2 files will be created in the same directory of the script. Assuming your script is named "RegExpQuickTester 2.5p.au3", the 2 files created will be : * "RegExpQuickTester 2.5p.txt" which contains the saved Match Text that will be reused when you run the script. * "RegExpQuickTester 2.5p.ini" which contains the saved options that will be reused when you run the script. A right click while hovering over the Edit control of the Search Pattern will display a helpful context menu, with possibility to paste something from the menu inside the Search Pattern. Personally I nearly don't paste anything from the context menu but as this feature was created by the original scripter... Instead I like to consult this context menu as a RegExp syntax reminder ! Anyway, just experiment it and choose what's best for you. 99% of the time, the Search Pattern Tab will be on top. If you notice another colored Tab (except the Personal Tab which will never be highlited), then it means that there is something written in this other tab : the color is here only to remind you that there IS something in this other tab, in case you had forgotten. Even a space or a blank line would color the Tab. YJ This particular design (due to original scripter) won't allow you to type "" in the Replace Pattern Tab (mikell frowned, concerning this missing feature). Gladly I found that typing a non existing group, for example $99 will have the same effect as "" so it's a workaround that seems to do the job. The "Code" button allows you to generate the corresponding AutoIt code, which will be copied to the Clipboard Don't hesitate to ask if you have questions. Our RegExp gurus (that's not me) just love RegExp questions Edit: I forgot. You can drag a text file (or htm etc...) inside the Match Text edit control (it's a droppable zone) . There shouldn't be a 32Kb file size limit anymore as I added code to override this limit. There are probably a couple of other functionalities I'm not thinking of now, you'll easily find what you need if you look at the code. And if you want to modify something in the code, don't hesitate. Just share here your modifications in case other users find them useful too, thanks. Updates are detailed in next post Download last version 11 nov 2024 : RegExpQuickTester 2.5r.au31 point -
You can use ROT objects to share your object between processes. In any case, I wonder how you would recreate the object out of a pointer.1 point
-
TLDR: process A allocates virtual memory region A at base offset A_base, and creates structs/objects therein with address ptr (ptr minus A_base) is the relative address rel_ptr of target struct/object within region A process B needs to remap region A into its own virtual memory with base offset B_base given A_base's (relative) virtual address within B_base, add rel_ptr to access A's shared struct/object from process B for this to work, A needs to first parse to B A_base's absolute address, the rel_ptr, and the struct/object size (and layout) NB if both processes may write to the same region, you'll need a mutex to negotiate access and avoid race conditions Check out my HighMem UDF, in particular the test example scripts and functions: _HighMem_PID2BaseOffset( PID ) _HighMem_MapExternalMemory(PID) _HighMem_OffsetAbsolute2Relative (offset,PID) / _HighMem_OffsetRelative2Absolute(offset,PID) _HighMem_AllocateExternal(offset, size, unit)1 point
-
1 point
-
1 point
-
New to AutoIt
mistersquirrle reacted to rsn for a topic
Task Schedule is fairly robust and running bat and cmd files from it is pretty straight forward. Coder or not (I'm not either but I stumble along well enough), AutoIt is easy to learn and the community here is welcoming and helpful. Try a few lines like what @mistersquirrle advised and see how you like it. Post it here and the community will help you improve it.1 point -
Txt split to ini file
mucitbey reacted to pixelsearch for a topic
@mucitbey If you choose the reusable template way, then this part of code will not work anymore : #cs If IniRead(@ScriptDir & "\" & $sDate & ".ini", $user, "Value03", "Non-existing key") = "Non-existing key" Then IniWrite(@ScriptDir & "\" & $sDate & ".ini", $user, "Value01", $aTemp[1]) IniWrite(@ScriptDir & "\" & $sDate & ".ini", $user, "Value02", $aTemp[3]) IniWrite(@ScriptDir & "\" & $sDate & ".ini", $user, "Value03", $aTemp[4]) Else ; key already exists IniWrite(@ScriptDir & "\" & $sDate & ".ini", $user, "Value04", $aTemp[4]) EndIf #ce It should be replaced with the following code, which seems to do the job nicely (ok, but there is better code in my next post +++) If $user = "" Or $user = "Undefined ID" Then $user = $aTemp[1] ; username becomes ID (this should never happen, according to mucitbey) $sKey = IniRead(@ScriptDir & "\" & $sDate & ".ini", $user, "Value03", "Undefined ID") ; $sKey has now 3 meanings : ; 1) "null" means we need to update "Value03" (1st entry for this user in Datalar.txt for this day) ; 2) "07:01:00" (for example) means we need to update "Value04" (2nd entry for this user in Datalar.txt for this day) ; 3) "Undefined ID" means... what it says (sabotage in Users.txt) then we add a new section like this, for example if ID 00000059 : ; [00000059] ; Value01=Undefined ID ; Value02=13.04.2023 ; Value03=07:01:00 ; Value04=null Select Case $sKey = "null" IniWrite(@ScriptDir &"\" & $sDate & ".ini", $user, "Value03", $aTemp[4]) ; in-time Case StringRegExp($sKey, '\d\d:\d\d:\d\d') ; ex. '07:01:00' IniWrite(@ScriptDir & "\" & $sDate & ".ini", $user, "Value04", $aTemp[4]) ; out-time Case Else ; $sKey = "Undefined ID" IniWrite(@ScriptDir & "\" & $sDate& ".ini", $aTemp[1], "Value01", "Undefined ID") IniWrite(@ScriptDir & "\" & $sDate& ".ini", $aTemp[1], "Value02", $sDate) IniWrite(@ScriptDir & "\" & $sDate& ".ini", $aTemp[1], "Value03", $aTemp[4]) IniWrite(@ScriptDir & "\" & $sDate& ".ini", $aTemp[1], "Value04", "null") EndSelect1 point -
1 point
-
Here an example to switch in/out full screen with F11 version 0.2 ; https://www.autoitscript.com/forum/topic/210078-full-screen-gui/?do=findComment&comment=1516762 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region (=== GUI generated by GuiBuilderPlus 1.0.0-beta4 ===) Global $hGUI = GUICreate("MyGUI", 400, 350, 760, 365, -1, -1) Global $idFullScreen = GUICtrlCreateDummy() #EndRegion (=== GUI generated by GuiBuilderPlus 1.0.0-beta4 ===) _main() ;------------------------------------------------------------------------------ ; Title...........: _main ; Description.....: run the main program loop ;------------------------------------------------------------------------------ Func _main() GUISetState(@SW_SHOW) Local $aAccelKeys[1][2] = [["{F11}", $idFullScreen]] GUISetAccelerators($aAccelKeys) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idFullScreen _FullScreen() Case Else ; EndSwitch Sleep(10) WEnd EndFunc ;==>_main ;------------------------------------------------------------------------------ Func _FullScreen() Local Static $aWPos, $aGUIStyle = GUIGetStyle($hGUI), $iFullScreen = 0 If $iFullScreen = 0 Then $aWPos = WinGetPos($hGUI) WinMove($hGUI, "", 0, 0, @DesktopWidth, @DesktopHeight) GUISetStyle(BitOR($WS_POPUP, $WS_EX_TOPMOST), -1) $iFullScreen = 1 Else WinMove($hGUI, "", $aWPos[0], $aWPos[1], $aWPos[2], $aWPos[3]) GUISetStyle($aGUIStyle[0], $aGUIStyle[1]) $iFullScreen = 0 EndIf EndFunc ;==>_FullScreen ;------------------------------------------------------------------------------ Please, leave your comments and experiences here. Thanks !1 point