Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/09/2017 in all areas

  1. R0G

    Digital Sign Tool

    Digital Sign Tool V1.6 Features: Digitally sign: (.exe) (.cab) (.cat) (.ocx) (.dll) (.stl) Metro style GUI thanks @BBs19 Error logging Multi file support Instructions: You must have your (.pfx) certificate imported to the "Current User\Personal\Certificates" store Your certificate must be exportable Select your digital certificate from the drop down menu Click browse to add your files to sign Click sign For more information please visit: https://www.autoitscript.com/forum/topic/149137-sign-your-exe-with-a-digital-signature-signtoolexe/#comment-1061738 https://msdn.microsoft.com/en-us/library/bfsktky3(vs.100).aspx?f=255&MSPPError=-2147217396 Changelog: V1.6 1/8/2021 - Updated broken Signing URL - Added option to change signing URL in settings - Other Bug Fixes Download: Digital Sign Tool V1.6.zip Digital Sign Tool V0.5.zip
    1 point
  2. trancexx

    Subrogation

    I finally have some more space in the attachments folder. In the past I've had to sacrifice, delete lots of scripts I posted to be able to post more. That was shit. So, what's the subrogation in this context? It's a technique of loading dll file embedded in your script as a string or perhaps stored on a remote server. Purpose is to be able to call functions from some dll without it needed to be written on the HD. As you will see in the script I'm attaching you choose some existing file (in my case I'm going with explorer.exe) then out of embedded dll you construct new fully functional module on the fundaments of the choosen. After that you call functions from embedded module but now (and that's the beauty) you call from subrogated. Pseudo/pseudo-expressed example from the script below would be: Subrogor = "explorer.exe" Subrogee = "kernel32.dll" Subrogate(byref Subrogor, Subrogee) DllCall(Subrogor, FunctionFromSubrogee) There are different problems with (only) some dlls to embed. It can be used both for 32 and 64 bit dlls with no difference. Script: Subrogation.au3 This technique (mild) is used in this script. edit: New script.
    1 point
  3. Melba23

    Single Array to 2D array

    zone97, Simple maths gives you the solution: #include <Array.au3> Global $aArray = ["1","2","3","4","a1","a2","a3","a4", "b1","b2","b3","b4"] $iRows = Int(UBound($aArray) / 4) Global $aNewArray[$iRows][4] $iIndex = 0 For $i = 0 To $iRows - 1 For $j = 0 To 3 $aNewArray[$i][$j] = $aArray[$iIndex] $iIndex += 1 Next Next _ArrayDisplay($aNewArray, "", Default, 8) M23
    1 point
  4. Try to add _WinAPI_Wow64EnableWow64FsRedirection ( False ) before.
    1 point
  5. EmilyLove

    Image Search Library

    I see the issue now. Here's an example script I have. It's what I used to learn how to use ImageSearch. Hope it helps. #include "ImageSearch.au3";Required to get ImageSearch to function. Store in @scriptdir #include "GDIPlus.au3";Required to get ImageSearch to function. Comes with AutoIT Global $iX, $iY;Make these variables global so we can reuse them after finding an image, instead of creating new variables for that purpose. ;Example Image is the AutoIt Logo on the Offical Website. https://www.autoitscript.com/site/ Do Sleep(300) Until _FindImage("Example.png") MsgBox(0, "Example", "Found Image!" & @CRLF & @CRLF & "Coord X = " & $iX & "." & @CRLF & "Coord y = " & $iY & ".") Func _FindImage($sImgPath);the function that searches ;Initialize and prepare ImageSearch. _GDIPlus_Startup();Initialize Microsoft Windows GDI+. Local $hImage = _GDIPlus_ImageLoadFromFile($sImgPath);Create an image object based on a file. Local $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage);Create a handle to a bitmap from a bitmap object. ;Search for Image. $iRet = _ImageSearch($hHBmp, 1, $iX, $iY, 5) ; Default=5: Tolerance, if it does not work for you rise it (up to 255) ;Begin Cleanup. _WinAPI_DeleteObject($hHBmp);Deletes a logical pen, brush, font, bitmap, region, or palette. _GDIPlus_ImageDispose($hImage);Release an image object. _GDIPlus_Shutdown();Clean up resources used by Microsoft Windows GDI+. ;Report Result. Return $iRet;Will return 1 if image was found. If no image was found, this will return 0. EndFunc ;==>_FindImage I'm not sure who made the example above. Also, next time, please use the code button. Best of luck. Example.png
    1 point
  6. Depends on the type of GUI that is in the outlook email. If they used activex to create the form and controls, I wouldn't know how to do it, but if you can use the AutoIt tool to read the info about the control then they used a a Form Control, and that is very easy to work with. ControlGetText ControlSetText ControlClick ControlCommand Are the functions you'd want to use. Idk how you'd use some VBA code to intereact with these. You'd need to know the control name of each of the controls. Once you've got it then you could work from there.
    1 point
  7. Unfortunately Column C: would be difficult to get as it's a dynamic link and not within the page source the others are fairly easy to get using IE GetElementsbyTagName which then can be used to add to Excel, for example: #include <Array.au3> #include <IE.au3> $oIE = _IECreate ("http://www.sciencedirect.com/science/article/pii/S1750946716301660", 0, 0, 1, 0) If IsObj($oIE) = False Then Exit Local $aValues[1][3] $aValues[0][0] = _GetInnerText('p', 'volIssue') $aValues[0][1] = _GetInnerText('h1', 'svTitle') $aValues[0][2] = _GetInnerText('a', 'cLink') _IEQuit ($oIE) _ArrayDisplay($aValues) Func _GetInnerText($sTagName, $sTagValue, $sTagType = 'className') Local $sResult, $oIETags $oIETags = $oIE.document.GetElementsByTagName($sTagName) For $oIEItem in $oIETags Switch $sTagType Case 'className' $sResult = $oIEItem.className Case 'id' $sResult = $oIEItem.id EndSwitch Switch $sTagName Case 'a' If $sResult = $sTagValue Then Return $oIEItem.href Case Else If $sResult = $sTagValue Then Return $oIEItem.innerText EndSwitch Next Return '' EndFunc
    1 point
  8. JohnOne

    Copy Files with RunAs

    Run and runAs require a program for example a .exe not a file like .au3. That's just for a start.
    1 point
  9. water

    Empty Array

    Did you compile your script as a console application? https://www.autoitscript.com/autoit3/docs/functions/ConsoleWriteError.htm
    1 point
  10. Don't know python, but a quick search suggests you could use sys.stdout.write, and capture that, alternatively if you return value is int, you may use runwait / shellexecutewait to get exit code.
    1 point
  11. I really think you should create a new topic, since it's not the same issue, but anyway.. I can't get to that page to see the page source, but i assume you done it right. Sometimes stuff inside iframes are more tricky, if i remember right, you have to enter the iframe first. Is that field inside any iframe? Danp2 where are you?
    1 point
  12. A20017, Just check which ListBox has focus: While 1 If _IsPressed("2E", $dll) Then ; Wait for key to be released to avoid multiple firing the code below While _IsPressed("2E", $dll) Sleep(10) WEnd ; Detect focused ListBox Switch _WinAPI_GetFocus() Case $hListBoxGlobal $indice = _GUICtrlListBox_GetCurSel($hListBoxGlobal) _GUICtrlListBox_DeleteString($hListBoxGlobal, $indice) Case $hListBoxMain $indice = _GUICtrlListBox_GetCurSel($hListBoxMain) _GUICtrlListBox_DeleteString($hListBoxMain, $indice) Case $hListBoxMini $indice = _GUICtrlListBox_GetCurSel($hListBoxMini) _GUICtrlListBox_DeleteString($hListBoxMini, $indice) EndSwitch EndIf WEnd Good enough? M23
    1 point
  13. After successfully calling _FFXpath, you should be able to access the element and it's attributes like this: FFXPath(".//*[@id='checkboxDisable']/li[1]/label") $card = _FFCmd("FFau3.xpath.innerHTML") MsgBox(0,"",$card) Basically, FFau3.xpath hold a reference to the last item found with _FFXPath.
    1 point
  14. I wrote this very simple functions to parse command line arguments. It can get: Simple key/value Example. The following code: #include "cmdline.au3" MsgBox(0, _CmdLine_Get('color')) Will return "white" if you run the script in one of these ways (quotes are optional but mandatory if you're going to use spaces): script.exe -color "white" script.exe --color white script.exe /color white Existence Example. The following code: #include "cmdline.au3" If _CmdLine_KeyExists('givemecoffee') Then ConsoleWrite('You want coffee.') Else ConsoleWrite('You do not want coffee.') EndIf Will return "You want coffee." if you run one of these: script.exe -givemecoffee script.exe --givemecoffee script.exe /givemecoffee And the following code: #include "cmdline.au3" If _CmdLine_ValueExists('givemecoffee') Then ConsoleWrite('You want coffee.') Else ConsoleWrite('You do not want coffee.') EndIf Will return "You want coffee." if you run one of these: script.exe givemecoffee script.exe "givemecoffee" Flags Example. This script: #include "cmdline.au3" ConsoleWrite("You want: ") If _CmdLine_FlagEnabled('C') Then ConsoleWrite("coffee ") EndIf If _CmdLine_FlagEnabled('B') Then ConsoleWrite("beer ") EndIf ConsoleWrite(" and you do not want: ") If _CmdLine_FlagDisabled('V') Then ConsoleWrite("vodka ") EndIf If _CmdLine_FlagDisabled('W') Then ConsoleWrite("wine ") EndIf ConsoleWrite(" but you did not tell me if you want: ") If Not _CmdLine_FlagExists('S') Then ConsoleWrite("soda ") EndIf If Not _CmdLine_FlagExists('J') Then ConsoleWrite("juice ") EndIf Will return "You want: coffee beer and you do not want: vodka wine but you did not tell me if you want: soda juice" if you run: script.exe +CB -VW Getting argument by its index You can also read the $CmdLine (1-based index) through this function. The advantage is that if the index does not exist (the user did not specify the argument), it won't break your script. It will just return the value you specify in the second function parameter. #include "cmdline.au3" $first_argument = _CmdLine_GetValByIndex(1, False) If Not $first_argument Then ConsoleWrite("You did not specify any argument.") Else ConsoleWrite("First argument is: " & $first_argument) EndIf Just a note: The second value of _CmdLine_GetValByIndex function can be an integer value, a string, a boolean value, an array or anything you want it to return if the index does not exist in $CmdLine array. This parameter is also available in _CmdLine_Get() function, also as a second function parameter. In this case, it will return this value if the key was not found. Example: #include "cmdline.au3" $user_wants = _CmdLine_Get("iwant", "nothing") ConsoleWrite("You want " & $user_wants) So, if you run: script.exe /iwant water It will return "You want water". But if you run just: script.exe It will return "You want nothing". Please note that, as these two are the only functions in this library meant to return strings, the second parameter is not available for the other functions. By default, if you do not specify any fallback value, it returns null if the wanted value could not be found. Also, please note that this UDF can NOT parse arguments in the format (key=value). Example: script.exe key=value IT WILL NOT WORK Here is the code: #include-once #comments-start CmdLine small UDF coder: Jefrey (jefrey[at]jefrey.ml) #comments-end Func _CmdLine_Get($sKey, $mDefault = Null) For $i = 1 To $CmdLine[0] If $CmdLine[$i] = "/" & $sKey OR $CmdLine[$i] = "-" & $sKey OR $CmdLine[$i] = "--" & $sKey Then If $CmdLine[0] >= $i+1 Then Return $CmdLine[$i+1] EndIf EndIf Next Return $mDefault EndFunc Func _CmdLine_KeyExists($sKey) For $i = 1 To $CmdLine[0] If $CmdLine[$i] = "/" & $sKey OR $CmdLine[$i] = "-" & $sKey OR $CmdLine[$i] = "--" & $sKey Then Return True EndIf Next Return False EndFunc Func _CmdLine_ValueExists($sValue) For $i = 1 To $CmdLine[0] If $CmdLine[$i] = $sValue Then Return True EndIf Next Return False EndFunc Func _CmdLine_FlagEnabled($sKey) For $i = 1 To $CmdLine[0] If StringRegExp($CmdLine[$i], "\+([a-zA-Z]*)" & $sKey & "([a-zA-Z]*)") Then Return True EndIf Next Return False EndFunc Func _CmdLine_FlagDisabled($sKey) For $i = 1 To $CmdLine[0] If StringRegExp($CmdLine[$i], "\-([a-zA-Z]*)" & $sKey & "([a-zA-Z]*)") Then Return True EndIf Next Return False EndFunc Func _CmdLine_FlagExists($sKey) For $i = 1 To $CmdLine[0] If StringRegExp($CmdLine[$i], "(\+|\-)([a-zA-Z]*)" & $sKey & "([a-zA-Z]*)") Then Return True EndIf Next Return False EndFunc Func _CmdLine_GetValByIndex($iIndex, $mDefault = Null) If $CmdLine[0] >= $iIndex Then Return $CmdLine[$iIndex] Else Return $mDefault EndIf EndFunc
    1 point
×
×
  • Create New...