Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

Excel Macro to AutoIt not working

$
0
0

I have an Excel Maco that works in Excel:

 

Dim oRng As Range
    Set oRng = Selection
    Selection.Font.Bold = True
    Selection.SpecialCells(xlCellTypeBlanks).Select
    Selection.Font.Bold = False
    Selection.FormulaR1C1 = "=R[-1]C"
    oRng.Copy
    oRng.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
       SkipBlanks:=False, Transpose:=False

 

I have tried to convert to AutoIt but it is not working????

#include <Excel.au3> #include <ExcelConstants.au3> Local $oExcel = ObjCreate("Excel.Application") Const $sType = $xlCSVMSDOS ;Const $xlToRight = -4161 ;Const $xlValues = -4163 ;Const $xlNone = -4142 Global $oExcel = _Excel_Open() Global $sTextFile = "Path to File\temp.csv" Global $oWorkBook = _Excel_BookOpenText($oExcel, $sTextFile, Default, $xlFixedWidth) $oWorkbook.Range = .Selection $oWorkbook.Selection.SpeciallCells(xlCellTypeBlanks).Select $oWorkbook.Selection.FormulaR1C1 = "=R[-1]C" $oWorkbook.Copy $oWorkbook.Selection.PasteSpecial($xlvalue,Default,Default,Default)

Can anyone tell me what I have missed?


_ArrayMaxIndex not working correct, maybe a bug

$
0
0

Hello,
 
i got the following problem, this code does not work correctly:

 

#include <Array.au3>

Dim $array[1][2] = [[0, 5]]
$result = _ArrayMaxIndex($array, 1, 0, 0, 1)
MsgBox(0,"Error:",@error) ; @error = 5, but the Array is not empty!

 

 

This might be abug?

_IEAttach errors out when ran as Citrix Published App

$
0
0

I have been working on an script for work now for quite some time and I finally worked through all my bugs and have the script working great on my desktop.  My ultimate goal however is to run this script on top of another web app as part of a Citrix published app.  However it looks like _IEAttach doesn't want to recognize any browser instances when ran as a published app in Citrix.  It runs fine if I login to Citrix and run it from a desktop.  I found this old thread, but it looks like it was never resolved.

 

http://www.autoitscript.com/forum/topic/94046-citrix-published-apps-and-ieau3/

 

I have requested authorization to load AutoIT and sciTE on the Citrix server, but I have not heard back from the admin yet.  I do have a folder on the Citrix server where I can copy my EXEs to for testing.  I'm using straight AutoIT help examples below to show the issues I am seeing so that they will be easy to recreate.

 

When I compile the WinList HelpFile Example and run it from the Citrix server it sees my browser instances as windows:

#include <MsgBoxConstants.au3> Example() Func Example()     ; Retrieve a list of window handles.     Local $aList = WinList()     ; Loop through the array displaying only visable windows with a title.     For $i = 1 To $aList[0][0]         If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then             MsgBox($MB_SYSTEMMODAL, "", "Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1])         EndIf     Next EndFunc   ;==>Example

But when I compile and run one of the HelpFile _IEAttach examples (below) and run it from the Citrix server, it immediately errors out with:

 

Line 201 (File "M:\StickyNotes\IEInstance.exe" ):

 

Error: Variable must be of type "Object".

#include <IE.au3> #include <MsgBoxConstants.au3> Local $aIE[1] $aIE[0] = 0 Local $i = 1, $oIE While 1     $oIE = _IEAttach("", "instance", $i)     If @error = $_IEStatus_NoMatch Then ExitLoop     ReDim $aIE[$i + 1]     $aIE[$i] = $oIE     $aIE[0] = $i     $i += 1 WEnd MsgBox($MB_SYSTEMMODAL, "Browsers Found", "Number of browser instances in the array: " & $aIE[0])

I am really so close on this and I would really appreciate any help you guys could spare.

 

_IE Action not working

$
0
0

Hello, I believe I have come across a bug in the _IE library. I am trying to make a script that will automatically fill's in data for a restore script for a WP site. It's called Importbuddy by IThemes and it is one of the best, if not the best, backup restore plugins for WordPress. The problem that I am having is once it is on the first step of the script, filling in the password and clicking next, it redirects me to the index.php file and when I keep trying to return to the importbuddy.php file, it keeps redirecting back to the index file. Here is the code I am using, 

_$o = _IECreate() _IENavigate($o, [url of ImportBuddy]) _IELoadWait($o, 2000) $step0 = _IEGetObjByName($o, "password");Password feild _IEFormElementSetValue($step0, "pass");Password of Importbuddy $Step0submit = _IEGetObjByName($o, "submit") _IEAction($Step0submit, "click") _IELoadWait($o, 2000) ;Goes to index.html, not the next step of the importbuddy

Here is a link to the importbuddy.php file,   http://bit.ly/1H9YZNb

Please only use this file for testing, it is part of a commercial product by IThemes 

To keep this simple, just install a program like XAMPP to view the file. Also, the password is "pass"

Does anyone have any ideas why this isn't working? 

As always, Thanks for your help 

Thomas 

Chrome Command Line Switches

$
0
0

Does anyone know a link to the Chrome Command Line Switches.?

 

I uses 

 
Run ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe  --new-window  "http://www.mypage.com")
 
to start chrome, but would like to add something to NOT RESTORE.  When Chrome or helper files crashed on previous run, you have the option to restore.  I would like to skip the restore.
 
 
Thanks

Hex to ASCII

$
0
0

You normally see people trying to convert their code from ASCII to Hex. I want to do the opposite (i am cool that way). 

The code i am trying to use is

 

"
$v = 4549
$Chr = StringSplit("$v", ",");Hex
 
for $i = 1 to $Chr[0]
    MsgBox(0,"",$Chr[$i] & " = " & Chr(Dec(StringRight($Chr[$i],2))))
Next
"
 
This code has a number of problems with it, like when i run the code it only gives me $v=. 
If i get rid of the $v sign and move the 4549, it will only give me the ASCII key I. 
Can someone please help me? 
Or point me to a working HEX to ascii code that allows me to do this?

AES

$
0
0
I have an AES encryption technique which isn't behaving like i want it too 

 

#include-Once

#include <MsgBoxConstants.au3>
 
 
 
Textinput()
 
Func Textinput()
    ; Places the input box in the top left corner displaying the characters as they
    ; are typed.
    Global $input = InputBox("Plain Text", "Input the text you want to be encrypted?", "EAAAAEEEAA520202010201021", "")
 
    ; Display the result.
    MsgBox($MB_SYSTEMMODAL, "Plain text", $input,  10)
EndFunc
 
 
$encdata=_AESEncrypt("$input", "2b7e151628aed2a6abf7158809cf4f3c",128,1 )
MsgBox(1, "Encrypted data", $encdata)
$decdata=_AESEncrypt($encdata, "2b7e151628aed2a6abf7158809cf4f3c", 128, 0)
MsgBox(1, "decrypted data", $decdata)
 
 
Func _AESEncrypt($sUDFIn, $sUDFKey, $KeySize = 128, $fEncrypt = 1)
        If $KeySize <> 128 And $KeySize <> 192 And $KeySize <> 256 Then
                SetError(1, 0, 0)
        ElseIf StringLen($sUDFIn) <> 32 Then
                SetError(2, 0, 0)
        ElseIf StringLen($sUDFKey) <> 32 And $KeySize = 128 Then
                SetError(3, 0, 0)
        ElseIf StringLen($sUDFKey) <> 48 And $KeySize = 192 Then
                SetError(3, 0, 0)
        ElseIf StringLen($sUDFKey) <> 64 And $KeySize = 256 Then
                SetError(3, 0, 0)
        ElseIf $fEncrypt <> 1 And $fEncrypt <> 0 Then
                SetError(4, 0, 0)
        EndIf
 
        Local $abOut[16]
        Local $abIn[16]
        Local $abKey[32]
        Local $abRoundKey[240]
        Local $vTempJ = 1
        Local $sReturn
        Local $iNr
        Local $iNk
 
        $iNk = $KeySize / 32
        $iNr = $iNk + 6
 
        For $vVariable = 0 To $iNk * 4 - 1
                $abKey[$vVariable] = Dec(StringMid($sUDFKey, $vTempJ, 2))
                $vTempJ += 2
        Next
 
        $vTempJ = 1
        For $vVariable = 0 To 15
                $abIn[$vVariable] = Dec(StringMid($sUDFIn, $vTempJ, 2))
                $vTempJ += 2
        Next
 
        $abRoundKey = __KeyExpansion($abKey, $iNr, $iNk)
 
        If $fEncrypt = 1 Then
                $abOut = __Cipher($abIn, $abRoundKey, $iNr)
        ElseIf $fEncrypt = 0 Then
                $abOut = __InvCipher($abIn, $abRoundKey, $iNr)
        EndIf
 
        For $vVariable = 0 To 15
                $sReturn &= $abOut[$vVariable]
        Next
 
        Return $sReturn
EndFunc   ;==>_AESEncrypt
Func __GetSBoxValue($bNum)
        Local $abSBox[256] = [0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31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, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16]
        Return $abSBox[Dec(Hex($bNum, 2))]
EndFunc   ;==>__GetSBoxValue
Func __GetSBoxInvert($bNum)
        Local $abRSBox[256] = [0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB, 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D]
        Return $abRSBox[Dec(Hex($bNum, 2))]
EndFunc   ;==>__GetSBoxInvert
Func __KeyExpansion($abKey, $iNr, $iNk)
        Local $vVariable
        Local $vTempK
        Local $abRoundKey[240]
        Local $avTemp[4]
        Local $abRcon[255] = [0x8D, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36, 0x6C, 0xD8, 0xAB, 0x4D, 0x9A, 0x2F, 0x5E, 0xBC, 0x63, 0xC6, 0x97, 0x35, 0x6A, 0xD4, 0xB3, 0x7D, 0xFA, 0xEF, 0xC5, 0x91, 0x39, 0x72, 0xE4, 0xD3, 0xBD, 0x61, 0xC2, 0x9F, 0x25, 0x4A, 0x94, 0x33, 0x66, 0xCC, 0x83, 0x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x7D, 0xFA, 0xEF, 0xC5, 0x91, 0x39, 0x72, 0xE4, 0xD3, 0xBD, 0x61, 0xC2, 0x9F, 0x25, 0x4A, 0x94, 0x33, 0x66, 0xCC, 0x83, 0x1D, 0x3A, 0x74, 0xE8, 0xCB]
 
        For $vVariable = 0 To $iNk - 1
                $abRoundKey[$vVariable * 4] = $abKey[$vVariable * 4]
                $abRoundKey[$vVariable * 4 + 1] = $abKey[$vVariable * 4 + 1]
                $abRoundKey[$vVariable * 4 + 2] = $abKey[$vVariable * 4 + 2]
                $abRoundKey[$vVariable * 4 + 3] = $abKey[$vVariable * 4 + 3]
        Next
        While $vVariable < (4 * ($iNr + 1))
                For $vTempJ = 0 To 3
                        $avTemp[$vTempJ] = $abRoundKey[($vVariable - 1) * 4 + $vTempJ]
                Next
                If Mod($vVariable, $iNk) = 0 Then
                        $vTempK = $avTemp[0]
                        $avTemp[0] = $avTemp[1]
                        $avTemp[1] = $avTemp[2]
                        $avTemp[2] = $avTemp[3]
                        $avTemp[3] = $vTempK
                        $avTemp[0] = __GetSBoxValue($avTemp[0])
                        $avTemp[1] = __GetSBoxValue($avTemp[1])
                        $avTemp[2] = __GetSBoxValue($avTemp[2])
                        $avTemp[3] = __GetSBoxValue($avTemp[3])
                        $avTemp[0] = BitXOR($avTemp[0], $abRcon[$vVariable / $iNk])
                ElseIf $iNk > 6 And Mod($vVariable, $iNk) = 4 Then
                        $avTemp[0] = __GetSBoxValue($avTemp[0])
                        $avTemp[1] = __GetSBoxValue($avTemp[1])
                        $avTemp[2] = __GetSBoxValue($avTemp[2])
                        $avTemp[3] = __GetSBoxValue($avTemp[3])
                EndIf
 
                $abRoundKey[$vVariable * 4 + 0] = BitXOR($abRoundKey[($vVariable - $iNk) * 4 + 0], $avTemp[0])
                $abRoundKey[$vVariable * 4 + 1] = BitXOR($abRoundKey[($vVariable - $iNk) * 4 + 1], $avTemp[1])
                $abRoundKey[$vVariable * 4 + 2] = BitXOR($abRoundKey[($vVariable - $iNk) * 4 + 2], $avTemp[2])
                $abRoundKey[$vVariable * 4 + 3] = BitXOR($abRoundKey[($vVariable - $iNk) * 4 + 3], $avTemp[3])
                $vVariable += 1
        WEnd
        Return $abRoundKey
EndFunc   ;==>__KeyExpansion
Func __AddRoundKey($iRound, $abRoundKey, $abState)
        For $vVariable = 0 To 3
                For $vTempJ = 0 To 3
                        $abState[$vTempJ][$vVariable] = BitXOR($abState[$vTempJ][$vVariable], $abRoundKey[$iRound * 4 * 4 + $vVariable * 4 + $vTempJ])
                Next
        Next
 
        Return $abState
EndFunc   ;==>__AddRoundKey
Func __SubBytes($abState)
        For $vVariable = 0 To 3
                For $vTempJ = 0 To 3
                        $abState[$vVariable][$vTempJ] = __GetSBoxValue($abState[$vVariable][$vTempJ])
                Next
        Next
 
        Return $abState
EndFunc   ;==>__SubBytes
Func __InvSubBytes($abState)
        For $vVariable = 0 To 3
                For $vTempJ = 0 To 3
                        $abState[$vVariable][$vTempJ] = __GetSBoxInvert($abState[$vVariable][$vTempJ])
                Next
        Next
 
        Return $abState
EndFunc   ;==>__InvSubBytes
Func __ShiftRows($abState)
        Local $avTemp
 
        $avTemp = $abState[1][0]
        $abState[1][0] = $abState[1][1]
        $abState[1][1] = $abState[1][2]
        $abState[1][2] = $abState[1][3]
        $abState[1][3] = $avTemp
        $avTemp = $abState[2][0]
        $abState[2][0] = $abState[2][2]
        $abState[2][2] = $avTemp
        $avTemp = $abState[2][1]
        $abState[2][1] = $abState[2][3]
        $abState[2][3] = $avTemp
        $avTemp = $abState[3][0]
        $abState[3][0] = $abState[3][3]
        $abState[3][3] = $abState[3][2]
        $abState[3][2] = $abState[3][1]
        $abState[3][1] = $avTemp
 
        Return $abState
EndFunc   ;==>__ShiftRows
Func __InvShiftRows($abState)
        Local $avTemp
 
        $avTemp = $abState[1][3]
        $abState[1][3] = $abState[1][2]
        $abState[1][2] = $abState[1][1]
        $abState[1][1] = $abState[1][0]
        $abState[1][0] = $avTemp
        $avTemp = $abState[2][0]
        $abState[2][0] = $abState[2][2]
        $abState[2][2] = $avTemp
        $avTemp = $abState[2][1]
        $abState[2][1] = $abState[2][3]
        $abState[2][3] = $avTemp
        $avTemp = $abState[3][0]
        $abState[3][0] = $abState[3][1]
        $abState[3][1] = $abState[3][2]
        $abState[3][2] = $abState[3][3]
        $abState[3][3] = $avTemp
 
        Return $abState
EndFunc   ;==>__InvShiftRows
Func __xtime($iFactorX)
        Return BitXOR(BitShift($iFactorX, -1), (BitAND(BitShift($iFactorX, 7), 1) * 0x1B))
EndFunc   ;==>__xtime
Func __Multiply($iFactorX, $iFactorY)
        Return BitXOR((BitAND($iFactorY, 1) * $iFactorX), (BitAND(BitShift($iFactorY, 1), 1) * __xtime($iFactorX)), (BitAND(BitShift($iFactorY, 2), 1) * __xtime(__xtime($iFactorX))), (BitAND(BitShift($iFactorY, 3), 1) * __xtime(__xtime(__xtime($iFactorX)))), (BitAND(BitShift($iFactorY, 4), 1) * __xtime(__xtime(__xtime(__xtime($iFactorX))))))
EndFunc   ;==>__Multiply
Func __MixColumns($abState)
        Local $vTmp
        Local $vTm
        Local $vTempT
 
        For $vVariable = 0 To 3
                $vTempT = $abState[0][$vVariable]
                $vTmp = BitXOR($abState[0][$vVariable], $abState[1][$vVariable], $abState[2][$vVariable], $abState[3][$vVariable])
                $vTm = BitXOR($abState[0][$vVariable], $abState[1][$vVariable])
                $vTm = __xtime($vTm)
                $abState[0][$vVariable] = BitXOR($abState[0][$vVariable], BitXOR($vTm, $vTmp))
                $vTm = BitXOR($abState[1][$vVariable], $abState[2][$vVariable])
                $vTm = __xtime($vTm)
                $abState[1][$vVariable] = BitXOR($abState[1][$vVariable], BitXOR($vTm, $vTmp))
                $vTm = BitXOR($abState[2][$vVariable], $abState[3][$vVariable])
                $vTm = __xtime($vTm)
                $abState[2][$vVariable] = BitXOR($abState[2][$vVariable], BitXOR($vTm, $vTmp))
                $vTm = BitXOR($abState[3][$vVariable], $vTempT)
                $vTm = __xtime($vTm)
                $abState[3][$vVariable] = BitXOR($abState[3][$vVariable], BitXOR($vTm, $vTmp))
        Next
 
        Return $abState
EndFunc   ;==>__MixColumns
Func __InvMixColumns($abState)
        Local $vVariable
        Local $vTempA
        Local $vTempB
        Local $vTempC
        Local $vTempD
 
        For $vVariable = 0 To 3
                $vTempA = $abState[0][$vVariable]
                $vTempB = $abState[1][$vVariable]
                $vTempC = $abState[2][$vVariable]
                $vTempD = $abState[3][$vVariable]
 
                $abState[0][$vVariable] = BitXOR(__Multiply($vTempA, 0x0e), __Multiply($vTempB, 0x0b), __Multiply($vTempC, 0x0d), __Multiply($vTempD, 0x09))
                $abState[1][$vVariable] = BitXOR(__Multiply($vTempA, 0x09), __Multiply($vTempB, 0x0e), __Multiply($vTempC, 0x0b), __Multiply($vTempD, 0x0d))
                $abState[2][$vVariable] = BitXOR(__Multiply($vTempA, 0x0d), __Multiply($vTempB, 0x09), __Multiply($vTempC, 0x0e), __Multiply($vTempD, 0x0b))
                $abState[3][$vVariable] = BitXOR(__Multiply($vTempA, 0x0b), __Multiply($vTempB, 0x0d), __Multiply($vTempC, 0x09), __Multiply($vTempD, 0x0e))
        Next
 
        Return $abState
EndFunc   ;==>__InvMixColumns
Func __Cipher($abIn, $abRoundKey, $iNr)
 
        Local $abOut[16]
        Local $abState[4][4]
 
        For $vVariable = 0 To 3
                For $vTempJ = 0 To 3
                        $abState[$vTempJ][$vVariable] = $abIn[$vVariable * 4 + $vTempJ]
                Next
        Next
 
        $abState = __AddRoundKey(0, $abRoundKey, $abState)
 
        For $iRound = 1 To $iNr - 1
                $abState = __SubBytes($abState)
                $abState = __ShiftRows($abState)
                $abState = __MixColumns($abState)
                $abState = __AddRoundKey($iRound, $abRoundKey, $abState)
        Next
 
        $abState = __SubBytes($abState)
        $abState = __ShiftRows($abState)
        $abState = __AddRoundKey($iNr, $abRoundKey, $abState)
 
        For $vVariable = 0 To 3
                For $vTempJ = 0 To 3
                        $abOut[$vVariable * 4 + $vTempJ] = Hex($abState[$vTempJ][$vVariable], 2)
                Next
        Next
 
        Return $abOut
EndFunc   ;==>__Cipher
Func __InvCipher($abIn, $abRoundKey, $iNr)
 
        Local $abOut[16]
        Local $abState[4][4]
 
        For $vVariable = 0 To 3
                For $vTempJ = 0 To 3
                        $abState[$vTempJ][$vVariable] = $abIn[$vVariable * 4 + $vTempJ]
                Next
        Next
 
        $abState = __AddRoundKey($iNr, $abRoundKey, $abState)
 
        For $iRound = $iNr - 1 To 1 Step -1
                $abState = __InvShiftRows($abState)
                $abState = __InvSubBytes($abState)
                $abState = __AddRoundKey($iRound, $abRoundKey, $abState)
                $abState = __InvMixColumns($abState)
        Next
 
        $abState = __InvShiftRows($abState)
        $abState = __InvSubBytes($abState)
        $abState = __AddRoundKey(0, $abRoundKey, $abState)
 
        For $vVariable = 0 To 3
                For $vTempJ = 0 To 3
                        $abOut[$vVariable * 4 + $vTempJ] = Hex($abState[$vTempJ][$vVariable], 2)
                Next
        Next
 
        Return $abOut
EndFunc   ;
 

 

The problem arises in the encdata, i am trying to use it to encrypt a variable that the user inputs and it does the encryption process correctly but the decryption process doesn't seem to work. 

If you replace the variable $input with the acutal hexadecimal numbers that the user inputs it works perfectly fine. I was wondering why is this and how do i solve this issue?

 

ControlClick Child Window

$
0
0

I've been searching around for this answer and can't seem to find it anywhere.

My problem is I want to run an external program like Notepad or something and then using ControlClick() click the file button within Notepad, is there any way to do this?

AutoIt         
#include <WindowsConstants.au3> Run("Notepad") $gui = GUICreate("title",500,300,-1,-1) Opt("GUIOnEventMode",1) GUISetOnEvent(-3,"_Exit") GUISetState() ;---Found this searching around. $hPid=Run(@SystemDir & 'notepad.exe',"", @SW_HIDE) WinWait("[CLASS:Notepad]", "", 5) $hChild = WinGetHandle("[CLASS:Notepad]", "") $NEXSTYLE = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hChild, "int", 236) DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hChild, "int", 236, "int", BitOR($NEXSTYLE[0], $WS_EX_MDICHILD)) DllCall("user32.dll", "int", "SetParent", "hwnd", $hChild, "hwnd", $Gui) WinMove($hChild, "", 0, 0,320,240) GUISetState(@SW_SHOW, $Gui) WinSetState($hChild,"",@SW_SHOW) ;--- While 1     Sleep(10) WEnd Func _Exit()     Exit EndFunc

Could I handle Solution Explorer in Visual Studio?

$
0
0

Hi 

 

I would like to make test script for Visual Studio. 

so for controlling Solution , Autoit Window info point to Solution Explorer in Visual Studio.

but I can't know Control ID of  the solution.

 

Could you help me? 

Attached Thumbnails

  • VS_SE.png

Alternative to ICMP

$
0
0

Hi

 

My antivirus blocks ping requests when I'm not in a trusted zone, and I can't disable it (Pretty stupid eset folks), there's any other alternative to check if a website is online?

 

 

Thanks in advance

UDF's ... how to inculde...

$
0
0

Hi all,

 

Okay, I promise i did look first as I love the help and forums. Im trying to inculde a UDF that didn't come with Autoit, so I followed the instructions below

 

https://www.autoitscript.com/wiki/Adding_UDFs_to_AutoIt_and_SciTE

 

Im am now totally confused. I am looking at "- If you have SciTE4AutoIt3 you can use SciTEConfig"   ....  how do I know if I have that one? I think I don't as it says SciTE-Lite  Version 3.4.1 in the Help and About in the script editor, but can someone confirm?   (If its wrong ill go speak to the IT fairies and ask for the correct verison to be installed).

 

The other option it seems to suggest is that I do the following:

"There is a special registry value that can be created at "HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt" called "Include". It should be a REG_SZ (string) value."  I don't have that in my Registry, but I have the below?

 

HKEY_CURRENT_USER\Software\AutoIt v3\Aut2Exe

 

Do i just create the key in v3 or in Aut2Exe, and also ... the string value, does that need to be the address of the inculde folder like "c:\my test inculde folder\" ?

 

Sorry, i know its a dumb questions but i did try first, I hate that. I finished my 1 big project yesterday using autoit, im converting from VBA but its slow going, I appreciate everyones input.

 

Regards,

 

Dixie

Super Noob. Just want help on a simple script.

$
0
0

I just need help with a simple script, I want my left mouse button to automatically click after I press the e button on my keyboard. Can somebody help me with this? Thanks

Vmware + autoit

$
0
0
Hello everyone, I need some advice to automate my vmware
 
What should I write in order to select the portion of the window number 1 and then send keyboard commands?
 
it's correct?
WinActivate ("[CLASS: ATL: SysTreeView32]") Send ("{} Numpad1")

64QQn4K.jpg

 

Can't target - and question about "Default Programs"

$
0
0

We had another program (Lotus Notes) as default mail client on our computers until recently. After migration to Outlook - now trying to make Outlook the Default program using

Run('control /name Microsoft.DefaultPrograms')

then going into the set standard program (I guess it's called in english)

waiting for the list to update - choosing "outlook" and setting the "set as default... ???" - making all settings for outlook.... 

 

Sorry, I don't have access to the english version of Windows, so I'm guessing what the text is in english compared to my danish version.

 

So I have created this script, which actually is working

 

"Standardprogrammer" can be translated to "Default Programs" - the title text for that particular window.

 

MY QUESTION IS

 

1) I can't seem to target the area where all programs are calculated and shown by windows with any control ??

2) It takes between 1 second and 20 seconds before Windows accumulates and shows all programs in the list. I have done sleep 25 seconds, but hey, can we detect somehow that the list is complete and use that to our advantage or is the method really just to wait with the sleep command ??

 

 

Run('control /name Microsoft.DefaultPrograms')
WinWait('Standardprogrammer')
WinActivate('Standardprogrammer')
Send('{TAB}{TAB}{TAB}{SPACE}')
Sleep(25000)
WinActivate('Standardprogrammer')
Send('{TAB}')
Send('outlook')
Send('{TAB}{TAB}{TAB}{SPACE}')
sleep(3000)
Send('{TAB}{TAB}{SPACE}')
WinClose('Standardprogrammer')

Application with identical title and no visible text

$
0
0

Hello!

 

Total Autoit beginner here, but I'd appreciate some help. I'm trying to automate the installation of an application (SMART Notebook 2014) using Autoit but I've run into some problems. Basically it's just a script that uses the WinWaitActive function and the send keypresses.
 

WinWaitActive("Education Software 2014 December") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{SPACE}") Send("{ENTER}")

The first problem is that the installation wizard consists of multiple choices followed by clicking Next, however throughout the wizard the Window title remains the same, "Education Software 2014 December" so I can't distinguish one window from the other. The second is that I can't use visible text to identify the windows either. When I use the Window Info tool, the Visible Text field is just blank. Is there any other way to indentify which is the active window during the installation?

 

 

 


Auto Incremental Int gets converted to Specialchars

$
0
0

Hi,

 

I have the problem that an auto incremental integer from a for loop, got sent with pressed shift, since the special characters are those shift-binded at the actual value at the keyboard.

 

So the number "5986" gets "%)(&".

 

I tried different approaches like

 

Send("{CAPSLOCK OFF}")

 

before the int got sent.

Im also casting the int to string with String() before sending it.

 

Very strange is the fact, that the problem occurs just after passing the loop a few times with a correct sent int.

 

Any idea?

 

Thanks in advance and many greetings,

Luke

Com port & USB-ISS

$
0
0

I need some information on how to start with com port communication.

 

Recently I bought a USB-ISS (it's a USB to I2C device: http://www.robot-electronics.co.uk/htm/usb_iss_tech.htm).

It's connected as Virtual COM port.

 

So, I need some help to start exchanging data with the device.

Can you help me start?

 

Giannis

 

How to use hotkey to exit without blocking?!

$
0
0

Hello,

 

i have a script similar to this example:

HotKeySet("{ESC}", "Terminate") While True     ConsoleWrite("Running" & @CRLF)     Sleep(500) WEnd Func Terminate()     ConsoleWrite("Waiting" & @CRLF)     $result = MsgBox(262148, "Exit?", "Are you sure you want to exit?")     If $result = 6 Then         Exit 0     EndIf EndFunc   ;==>Terminate

When i press esc it will ask me if i really want to exit.

 

As MsgBox is a blocking function, the whole script will pause until i answer the messagebox.

 

So my question is: Is there a way to make sure the main script continues even while the question is unanswered?

 

 

 

 

function to find if window is visible

$
0
0

Hello,

 

i sometimes have to deal with multimonitor setups. I searched the forums and found quite a lot of threads about this. Most fo them seem to complicated for what i have in mind.

 

When i start a program and drag it to a different monitor, and the close the program, i save the x/y coordinates of the window to start it were it was closed.

 

this works fine as long as i start it on the same PC setup. But when suddenly i use a pc with only one monitor i will end up with a window placed outside the visible area.

 

Is there an easy way to detect that? If yes, i would simply move the window to the center of the screen if it is not visible.

 

I tried windowgetstate, but it seems it can only detect if the state is set to hide and not if the window is off screen...

 

Ideas are welcome:-)

 

Thanks!

 

 

testing WPF

$
0
0

Hi,

I just got for testing my first WPF application and wondering if it is possible to use autoit for the automation or I have to look for other possibilities?

 

Thanks

Viewing all 12506 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>