All Activity

This stream auto-updates   

  1. Past hour
  2. I have a page that I need to be able to click on a button, but the class name for that button is only visible with inspecting element on the page and not the source code. I added Local $sHTML = $oDoc.documentElement.innerHTML hoping to be able to use that as the object then change Local $oInputs = _IETagNameGetCollection($oIE, "span") to Local $oInputs = _IETagNameGetCollection($sHTML, "span") hoping that would work, but of course it did not. Here is my full code. #include <IE.au3> $oIE = _IECreate("") Sleep(1000) $oDoc = _IEDocGetObj ($oIE) Local $sHTML = $oDoc.documentElement.innerHTML _IELoadWait($oIE) $i = 0 while $i <= 10 Local $oInputs = _IETagNameGetCollection($sHTML, "span") For $oInput In $oInputs If $oInput.className == "this-class-name" Then _IEAction($oInput, "click") Next Sleep(2000) WEnd Is it possible to click on an element that's only in the innerHTML and not the source code?
  3. The UTF8 you read from stdout needs to be converted to UTF16-LE which AutoIt uses. Try this: ; $s is your UTF8 string Local $Str = BinaryToString(StringToBinary($s, 4), 1)
  4. $DBT_DEVICEARRIVAL = "0x00008000" $WM_DEVICECHANGE = 0x0219 GUICreate("") GUIRegisterMsg($WM_DEVICECHANGE , "MyFunc") Func MyFunc($hWndGUI, $MsgID, $WParam, $LParam) If $WParam == $DBT_DEVICEARRIVAL Then $dg = DriveGetDrive( "REMOVABLE" ) For $i = 1 to $dg[0] $dt = DriveGetType( $dg[$i] ) If $dt = "REMOVABLE" And $dg[$i] <> "a:" And $dg[$i] <> "b:" Then ;;look for my marker file at $dg[$i] , if found do check... MsgBox(4096,"Drive " & $i, $dg[$i] & " = " & $dt) EndIf Next EndIf EndFunc While 1 $GuiMsg = GUIGetMsg() WEnd The example above detects usb insertion just fine.
  5. @Au3Builder I tried, but it does not work #include <WindowsConstants.au3> RegWrite('HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR', 'Start', 'REG_DWORD', '4') $strComputer = "." Global $objObject $objWMIServices = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") $sink = ObjCreate("WbemScripting.SWbemSink") ObjEvent($sink, "SINK_") $objWMIServices.ExecNotificationQueryAsync($sink, "SELECT * FROM __InstanceOperationEvent WITHIN 5 WHERE " & "TargetInstance ISA 'Win32_LogicalDisk'") While 1 Sleep(10) WEnd Func SINK_OnObjectReady($objObject, $objAsyncContext) If $objObject.TargetInstance.DriveType = 2 Then Select Case $objObject.Path_.Class() = "__InstanceCreationEvent" _pass() RegWrite('HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR', 'Start', 'REG_DWORD', '3') ShellExecute($objObject.TargetInstance.DeviceId) Case $objObject.Path_.Class() = "__InstanceDeletionEvent" ConsoleWrite("Drive " & $objObject.TargetInstance.DeviceId & " Has been removed." & @CR) EndSelect EndIf EndFunc Func _pass($Pass = "123456") Local $Inputbox For $I = 1 To 3 $Inputbox = InputBox("Please try again", "Please enter the password to view the usb disk", "", "*") If @error Then Exit ElseIf $Pass = $Inputbox Then ExitLoop Else MsgBox(0, "Please try again", "Wrong password " & $I, 3) EndIf Next If $Pass <> $Inputbox Then RegWrite('HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR', 'Start', 'REG_DWORD', '4') EndIf EndFunc
  6. this is how coordinates work for PixelSearch.
  7. Today
  8. Ah, ok... understand now. That function is not build into AutoIt3Wrapper, sorry. Jos
  9. Thank you. Your code works. It shows the date in the MsgBox. As expected. However, I would like that date written to the ???.aux source file. So that when I open the source in my editor (Scite) it is visible there. Especially when compiling to a3x that date may not be apparent until runtime. I hope I explained my intention clearly. Thank you for your trouble.
  10. Sorry but that doesn't make it any clearer for me. How is the line I posted not right for you? It will write the compile date into the PE header. Try compiling and running this script: Jos
  11. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_type=a3x #AutoIt3Wrapper_LastBuild=201802192031 <<<<<<<<<<<<<<<<<<<<<<<<<<<<< system updated on build #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <MsgBoxConstants.au3> MsgBox($MB_SYSTEMMODAL, "Title", "This message box will timeout after 10 seconds or select the OK button.", 10) I hope this helps. So whenever I open the source file, I can see when is the last time this source was built.
  12. I guess I have lost you as to what you want. Give me an example script how you use the fileversion information so I understand what you mean. Jos
  13. Thank you. This has resolved another issue I had. But I still want an answer for a question, perhaps best phrased like this: when I build/compile, the EXE can contain a FileVersion, which can be auto updated. It is written to the source code (and included in the out file). Is it possible to write the build/compile date to source code as well?
  14. Here you are. Local $vData = "Hello jcpetu this is an example using base64 func.khsfishfiagsfgiy9047019tcDV:{:J{B:CSgAAFCACXC>N<@#$%#$^@@#%@#$^TCCCCCKGAS GZG" print("Your data for this example is [" & $vData & "]" & @CRLF) print("1. Method: String -> Base64Binary") Local $sBase64Binary = base64($vData) print("Output: " & $sBase64Binary & @CRLF) print("2. Method: Base64Binary -> String") print("Output: " & BinaryToString(base64($sBase64Binary, False)) & @CRLF) ; used binary to string because base64 func first convert data to Binary (some web dont do this) print("3. Method: String -> Base64Url") Local $sBase64Url = base64($vData, True, True) print("Output: " & $sBase64Url & @CRLF) print("4. Method: Base64Url -> String") print("Output: " & BinaryToString(base64($sBase64Url, False, True)) & @CRLF) Func print($vData) Return ConsoleWrite($vData & @CRLF) EndFunc ;==>print()
  15. mmm I see the forum is screwing with my posted code. Lets see if this works without codebox: #AutoIt3Wrapper_Res_Field=Compile Date|%date% %time% Or quote: Jos
  16. My dear Sir, please be so kind as to explain your explanation? "C:\AutoIt\pegasi\main.au3" (15) : ==> Error in expression.: ://////=__= ^ ERROR ->19:56:51 AutoIt3.exe ended.rc:1 +>19:56:51 AutoIt3Wrapper Finished. >Exit code: 1 Time: 13.13 ; The last header lines... #AutoIt3Wrapper_Run_AU3Check=n #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 6 -q #Au3Stripper_Parameters=/rm ://////=__= #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Or, If I move it to the version line.... ! Invalid FileVersion value 4=50://////=__=. It will be changed to:50 -> No changes made.. Yes. You are probably right about the AutoItWrapper. Where should I place this?
  17. It appears the OP is trying to do it using the AutoItX dll and not AutoIt scripting, so he won't be able to use any of the UDFs. Although, if he looks at what is inside the UDFs it should be relatively easy to replicate what it's doing in another language, because most of the IE UDF is just dll calls to the IE dlls.
  18. If it's what he means, then It shouldn't be that hard to do. My advice is to disable USB ports via registry and re-enable them after entering the password.
  19. From what I'm getting from this, you're looking to block ALL access to ANY USB device/drive until someone enters a password authorizing it? Sounds very difficult, and probably harder to do than you'd think.
  20. thanks "chcp" return: Active code page: 852 when i use code page 65001 then read from stdout: Lokálne pripojenie ľščťžýáíéóú still no good, I tested other pagesets and not working
  21. Hi Ascer, any example to understand how to use it. thanks in advance and regards.
  22. Like I said before.BitLocker is what you need.You won't access your usb drive without entering the password.
  23. this problem touch all functions where I need to search something on the screen, for example with PixelSearch if I write: $result = PixelSearch(10,0,100,300, $Color) the program search the pixel in a wrong area (not in the part of the screen defined from point (10, 0) to (100,300) ); if the computer find the correct color, it return coordinates that doesn't corrispond to nothing. I tryed also with PixelChecksum and in this case the computer searches if there are changes on the screen but in a wrong area ($result = PixelChecksum ($a1[0],$a1[1],$a2[0],$a2[1])) ( the syntax is PixelChecksum($x_of_point1, y_of_point1, $x_of_point2, $y_of_point2) ) a last example is with image search: it makes his duty searching an image in the screen, however it returns wrong coordinates: (example) #include <ImageSearch2015.au3> $x1=0 $y1=0 $result=0 MsgBox(0,"start","start") func start() $result = _ImageSearch("C:\folder\image.PNG", 1, $x1, $y1, 150, 0) if $result=1 Then MouseMove($x1,$y1,10) EndFunc
  24. I do not want to encrypt the usb drive My computer needs a password when I plug in a usb driver without permission. Do not display the usb drive without entering the password.
  25. First, not sure why you are performing the nested loops. You can simply use the regular _IE commands to retrieve the form and it's elements. That said, this is a tricky one because of the use of jQuery and an older version of YUI. Here's the solution that I came up with -- Local $oIE = _IECreate("") Local $iQuestID = "123456" Local $sCharacterName = "test" Local $sRealm = "Area 52" Local $oForm = _IEFormGetObjByName ($oIE, "questForm") Local $jQuery = _jQuerify($oIE) $jQuery(".us").click() $jQuery(".us").addClass("yui-button-checked yui-radio-button-checked") Local $oElement = _IEFormElementGetObjByName($oForm, "realm") _IEFormElementSetValue($oElement, $sRealm) $oElement = _IEFormElementGetObjByName($oForm, "name") _IEFormElementSetValue($oElement, $sCharacterName) $oElement = _IEFormElementGetObjByName($oForm, "check") _IEFormElementSetValue($oElement, $iQuestID) $jQuery(".checkButton").trigger('click') ; #FUNCTION# ==================================================================================================================== ; Name ..........: _jQuerify ; Description ...: ; Syntax ........: _jQuerify(Byref $oIE) ; Parameters ....: $oIE - Object variable of an InternetExplorer.Application. ; Return values .: an object variable pointing to the jQuery library ; Author ........: Chimp ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _jQuerify(ByRef $oIE) Local $msie, $jsEval, $jQuery, $otherlib = False $msie = Execute('$oIE.document.documentMode') If ($msie = "") Or Number($msie) < 11 Then ; an IE version < 11 ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('window.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.parentwindow.eval') Until IsObj($jsEval) Else ; IE version > = 11 ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('document.head.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.head.eval') Until IsObj($jsEval) EndIf ; if jQuery is not already loaded then load it If $jsEval("typeof jQuery=='undefined'") Then ; check if the '$' (dollar) name is already in use by other library If $jsEval("typeof $=='function'") Then $otherlib = True Local $oScript = $oIE.document.createElement('script'); $oScript.type = 'text/javascript' ; If you want to load jQuery from a disk file use the following statement ; where i.e. jquery-1.9.1.js is the file containing the jQuery source ; (or also use a string variable containing the whole jQuery listing) ;~ $oScript.TextContent = FileRead(@ScriptDir & "\jquery-1.9.1.js") ; <--- from a file ; If you want to download jQuery from the web use this statement $oScript.src = '' ; <--- from an url $oIE.document.getElementsByTagName('head').item(0).appendChild($oScript) Do Sleep(250) Until $jsEval("typeof jQuery == 'function'") EndIf Do Sleep(250) $jQuery = $jsEval("jQuery") Until IsObj($jQuery) If $otherlib Then $jsEval('jQuery.noConflict();') Return $jQuery EndFunc ;==>_jQuerify There may be a better way, so I welcome others input / feedback.
  1. Load more activity