Jump to content

gruntydatsun

Active Members
  • Posts

    289
  • Joined

  • Last visited

Reputation Activity

  1. Like
    gruntydatsun reacted to mikell in Regex... Repeating Block of Regex   
    ... and there is nothing more to do but add the \K  ("keep out") verb  
    $sAfter = StringRegExpReplace($sBefore, "(?m)(^\s{3}<null/>\s\r\n){3}\K", "$1")
    Edit
    Please note that as \K is used here as a lookbehind alternative, obviously this works too
    $sAfter = StringRegExpReplace($sBefore, "(?m)(?<=(^\s{3}<null/>\s\r\n){3})", "$1")  
  2. Like
    gruntydatsun reacted to TheXman in Regex... Repeating Block of Regex   
    @gruntydatsun
    Here's one of several ways you could do it.
    example() Func example() Local $sBefore = _ '<row name="subTotal" mergeCellEnd="7" mergeCellStart="1"> ' & @CRLF & _ ' <cell type="text" name="subTotal">Subtotal: Hotpants Sales To Senior Execs</cell> ' & @CRLF & _ ' <null/> ' & @CRLF & _ ' <null/> ' & @CRLF & _ ' <null/> ' & @CRLF & _ ' <cell type="number" name="Year 1">0</cell> ' & @CRLF & _ ' <cell type="number" name="Year 2">0</cell> ' & @CRLF & _ ' <cell type="number" name="Year 3 and 4">1,000</cell> ' & @CRLF & _ ' <null/> ' & @CRLF & _ ' <null/> ' & @CRLF & _ '</row> ' & @CRLF Local $sAfter = StringRegExpReplace($sBefore, "(?sm)((?:^\s{3}<null/>\s\r\n){3})", "\1 <null/> " & @CRLF) ConsoleWrite("Before:" & @CRLF) ConsoleWrite($sBefore & @CRLF) ConsoleWrite("After:" & @CRLF) ConsoleWrite($sAfter & @CRLF) EndFunc  
  3. Like
    gruntydatsun got a reaction from Draygoes in Reading/Manipulating Browser Content from Applications   
    if it's only for you and only to click two links, save yourself a lot of effort and just use MouseClick on some coords... then spend the time you would have spent writing code to sip coffee and dunk biscuits.... rapidly starting to slacken off for Straya Day  wooohooO!!!!
  4. Like
    gruntydatsun got a reaction from Draygoes in System Microphone   
    Use devcon

    http://ccm.net/faq/1886-enable-disable-a-device-from-the-command-line
    https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon
  5. Like
    gruntydatsun got a reaction from ReformedOceot in Counting from 001?   
    use & to join them
    local $v1 = 1, $v2 = 2, $v3 = 3 local $v4 = $v1&$v2&$v3 msgbox(1,"together",$v4)  
  6. Like
    gruntydatsun got a reaction from Sleepyguy in help - condition count 3 reset on false loop   
    lol you'll might get burned pretty hard for posting something that reads a bit like game automation though 
    Do $endofstage = PixelSearch( 484, 225, 551, 280, $bluexp, 5) Sleep (Random (600, 800)) If IsArray ($endofstage) = 1 Then Local $e = $e + 1 if $e = 3 then ExitLoop Else Local $e = 0 EndIf Until $e > 3  
  7. Like
    gruntydatsun got a reaction from Earthshine in QUESTION   
    If you were to manually do it, what tool would you use?  Browser, putty etc
  8. Like
    gruntydatsun got a reaction from amin84 in Hotkey Program   
    Its a dead quiet day here so I've been mucking around with it
    $aHotkeys = IniReadSection(@ScriptDir & "\test.ini", "Hotkeys") For $i = 1 To $aHotkeys[0][0] HotKeySet($aHotkeys[$i][0],"HotKeyPressed") Next While 1 Sleep(500) WEnd Func HotKeyPressed() for $x = 1 to UBound($aHotkeys)-1 if @HotKeyPressed = $aHotkeys[$x][0] Then Execute($aHotkeys[$x][1]) Next EndFunc and make a file called test.ini in the root of the program folder with contents:
     
    [Hotkeys] +!d=ShellExecute("D:\backup") +!x=ShellExecute("D:\repo") this works for me
  9. Like
    gruntydatsun got a reaction from NewKid4 in Prevent string from changing back in start of loop   
    declare
    $larger = true
    before the loop
  10. Like
    gruntydatsun got a reaction from MikahS in How to get name of IE page element?   
    have a look in the the help file for _IEFormElementSetValue  (examples at foot of that document)
    get the firebug addon for firefox go to www.wikihow.com/macrame right click on the search box at the top select Inspect Element with Firebug check out the html for the form you want in the firebug window  
    In this case it's:
    <form id="cse-search-box" action="/Special:GoogSearch"> <div> <input type="hidden" value="008953293426798287586:mr-gwotjmbs" name="cx"> <input type="hidden" value="FORID:10" name="cof"> <input type="hidden" value="UTF-8" name="ie"> <input type="text" x-webkit-speech="" class="search_box" value="" size="30" name="q" id="cse_q"> <input type="submit" onclick="gatTrack(&quot;Search&quot;,&quot;Search&quot;,&quot;Custom_search&quot;);" onmouseout="button_unswap(this);" onmouseover="button_swap(this);" class="search_button" value="Search" id="cse_sa"> </div> </form> So then this is the code to write something into the search box:
    #include <IE.au3> $oIE = _IECreate("www.wikihow.com/Macrame") ;open page in IE and get a handle to it Local $oForms = _IEFormGetCollection($oIE,1) ;get handle to form: 1 means get 2nd form on page Local $oQuery = _IEFormElementGetCollection($oForms,3) ;get handle to element: 3 means 4th element of that form _IEFormElementSetValue($oQuery,"Organic Lambswool Mirkin Patterns") ;put what you want into the field Remember the numbering starts at zero so element 4 has index number 3. 
  11. Like
    gruntydatsun got a reaction from TechCoder in need help with speeding up the script   
    What I'm hearing your IT manager say is "I don't know how to do that or even what you're talking about and will not be admitting it to you today".
  12. Like
    gruntydatsun got a reaction from philkryder in I would like to have timestamps on autoIT traces   
    This file implements TraceAdd() function.
    C:Program FilesAutoIt3SciTELUAAutoItTools.lua
    Good luck
  13. Like
    gruntydatsun got a reaction from MadaraUchiha in ComboBox Item Values   
    or write a getter
    $iconValue = getIconValue(GuiCtrlRead($comboName)) Func getIconValue($string) Switch $string Case "No Icon" Return 0 Case "Error Icon" Return 23434 Case "Question Icon" Return 283 Case "Warning Icon" Return 9876 Case "Information Icon" Return 4567 EndSwitch EndFunc
  14. Like
    gruntydatsun got a reaction from Shrapnel in how to monitor (in console) the processing time of each line of my scripts?   
    yo dawg i heard you like scripts...
    you can script a script to interleave the console writes in your script
     
    that would be a nice tool to add to scite in the same way  TOOLS > TRACE: ADD TRACE LINES works.
×
×
  • Create New...