Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/01/2019 in all areas

  1. Danyfirex

    Hash HMAC

    Hello guys. Here is a small function to create a hash hmac similar to hash_hmac PHP function. Supported are: SHA512,SHA256,SHA1,SHA384,MD5 and RIPEMD160. Local $sSecret = "SecretKey" Local $sMessage = "AutoIt Rocks!!!" ConsoleWrite("HMAC-SHA256: " & @TAB & @TAB & _HashHMAC("SHA512", $sMessage, $sSecret) & @CRLF) ConsoleWrite("HMAC-SHA256: " & @TAB & @TAB & _HashHMAC("SHA256", $sMessage, $sSecret) & @CRLF) ConsoleWrite("HMAC-SHA1: " & @TAB & @TAB & _HashHMAC("SHA1", $sMessage, $sSecret) & @CRLF) ConsoleWrite("HMAC-SHA384: " & @TAB & @TAB & _HashHMAC("SHA384", $sMessage, $sSecret) & @CRLF) ConsoleWrite("HMAC-MD5: " & @TAB & @TAB & _HashHMAC("MD5", $sMessage, $sSecret) & @CRLF) ConsoleWrite("HMAC-RIPEMD160: " & @TAB & _HashHMAC("RIPEMD160", $sMessage, $sSecret) & @CRLF) Func _HashHMAC($sAlgorithm, $bData, $bKey, $bRaw_Output = False) Local $oHashHMACErrorHandler = ObjEvent("AutoIt.Error", "_HashHMACErrorHandler") Local $oHMAC = ObjCreate("System.Security.Cryptography.HMAC" & $sAlgorithm) If @error Then SetError(1, 0, "") $oHMAC.key = Binary($bKey) Local $bHash = $oHMAC.ComputeHash_2(Binary($bData)) Return SetError(0, 0, $bRaw_Output ? $bHash : StringLower(StringMid($bHash, 3))) EndFunc ;==>_HashHMAC Func _HashHMACErrorHandler($oError) ;Dummy Error Handler EndFunc ;==>_HashHMACErrorHandler It requires .NET Framework 2.0 or higher. Saludos
    1 point
  2. Just add this to PersonalTools.lua: function PersonalTools:SelectQuoatedText() local from = 0 local to = 0 for i = editor.CurrentPos, editor:PositionFromLine(editor.CurrentPos), -1 do -- Make sure we don't count brackets in strings. if editor.StyleAt[i] ~= SCE_AU3_STRING then from = i+3 break end end for i = editor.CurrentPos, editor.LineEndPosition[editor.CurrentPos] do -- Make sure we don't count brackets in strings. if editor.StyleAt[i] ~= SCE_AU3_STRING then to = i break end end editor:SetSel(from - 1, to -1) end and something like this to SciTEUser.properties: #Select total string between "" or '' command.name.41.$(au3)=SelectQuoatedText command.mode.41.$(au3)=subsystem:lua,savebefore:no command.shortcut.41.$(au3)=Ctrl+Shift+l command.41.$(au3)=InvokeTool PersonalTools.SelectQuoatedText and change the shortcut to something you like. This one has Ctrl+Shift+L. Now just put the carret somewhere in the quoted string and pres the shortcut. Jos
    1 point
  3. Why don't you just use labels beside the input controls. There's no way you're going to get a listview and input controls to line up correctly without a lot of tweaking. BTW, I'd move the input controls around instead of trying to manipulate the LV control settings, much easier if you insist on trying it.
    1 point
  4. Which is pretty much what I said. If they just want someone to write it for them, because they are not a programmer or other extenuating circumstance, that site has been suggested in the past. However, down the road when they have to pay again because they don't know anything about the care and feeding of the program, it becomes more of a headache. That is why this forum encourages people to take the time to learn the language, so they can support themselves.
    1 point
  5. I forgot the [] on button and [] and CLASS: on the window.
    1 point
  6. @jugador Never heard before about ListViews?
    1 point
  7. eukalyptus

    DirectSound UDF

    DirectSound UDF play audio files, record microphone, apply effects or create your own sound - check out the examples Download: https://autoit.de/index.php/Attachment/69-DirectSound-7z/ Or visit the original topic at the german forum - link in my signature
    1 point
  8. I don't have a problem using ControlCommand function with 'FindString' command. Here is an example. #include <GUIConstantsEx.au3> $text = 'TAB Processor (TAB QWERTYGP Compound) - Qwert00' $text &= '|' & 'TDD Processor (TDD QWERTYGP Compound) - Qwert00' $text &= '|' & 'TPA Processor (TPA QWERTYGP Compound) - Qwert00' $text &= '|' & 'TPA Processor (TPA QWERTYAD Compound) - Qwert01' $text &= '|' & 'TPA Processor (TPA QWERTYGD Compound) - Qwert02' $text &= '|' & 'TAB Processor (TAB QWERTYAD Compound) - Qwert01' Example() Func Example() Local $msg GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered GUICtrlCreateCombo("", 10, 10,300) ; create first item GUICtrlSetData(-1,$text) $btnFind = GUICtrlCreateButton("Find String",10,50) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $btnFind Then $index = ControlCommand("My GUI combo","Find String","ComboBox1","FindString",'TPA Processor (TPA QWERTYAD Compound) - Qwert01') ControlCommand("My GUI combo","Find String","ComboBox1","SetCurrentSelection",$index) EndIf If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example
    1 point
×
×
  • Create New...