Leaderboard
Popular Content
Showing content with the highest reputation on 04/20/2017 in all areas
-
LAST VERSION - 1.4 18-May-12 This small library allows simple and reliable way to copy or move files and directories without suspending your script. Moreover, you can get the current state (number of copied bytes, system error code, and other status information) while copying. Also supported copying or moving a multiple files and directories at once (up to 256). Working with this UDF is similar with the InetGet() function. For more information, see description for each function within the library. Available functions Copy UDF Library v1.4 (x86 and x64) Previous downloads: 1162 Copy.zip Examples Copying a multiple files at once GUI, files copying GUI, directories copying1 point
-
my basic script wont work
SkysLastChance reacted to adam51 for a topic
this is where I got this coding from. so does his work because he has the full version?1 point -
@Danyfirex, The C++ Invokemember3 is a really nice example ! I am not an C++ or C# expert but I can follow the flow of the script. And it will answer al lot questions that Junkew had ... So will update the Examples in the Zip with the working version you posted... This working Example opens again a new opportunities .... @Junkew To Answer some of your questions like, How to instantiate in AutoIt these hidden interfaces of mscorlib? Some of the .Net Classes are exposed as traditional COM Objects... That's why you can use objCreate() OR you can use the CLSID and IID to instantiate the COM Object like this : #AutoIt3Wrapper_UseX64=Y Global $hActiveX ; Load the modules If @AutoItX64 Then $hActiveX = DllOpen("C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.tlb") Else $hActiveX = DllOpen("C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorlib.tlb") EndIf ;MsgBox(0,"x64",@AutoItX64) ; Object identifiers Global Const $sCLSID = "{4E77EC8F-51D8-386C-85FE-7DC931B7A8E7}" ;Global Const $sIID = "{3D54C6B8-D283-40E0-8FAB-C97F05947EE8}" Global Const $sIID = Default ; Or use keyword Default if you want to use the Default interface ID ; COM Error monitoring Global $oError = ObjEvent("AutoIt.Error", "_ErrFunc") Func _ErrFunc() ConsoleWrite("! COM Error ! Number: 0x" & Hex($oError.number, 8) & " ScriptLine: " & $oError.scriptline & " - " & $oError.windescription & @CRLF) Return EndFunc ;==>_ErrFunc ; Instantiate the Object Local $oDotNET = ObjCreate($sCLSID, $sIID, $hActiveX) If $oDotNET = 0 Then MsgBox(16,"Error", "Could not create the object, Common problem ActiveX not registered.") ; This will create a System.Random Number ConsoleWrite("System.Random # : " & $oDotNET.Next_2( 1, 100 ) & @CRLF) $oDotNET = "" DllClose($hActiveX) In OLE/COM Viewer you will find all the information needed to find all the CLSID's and IID's, see .NET Category So leaves us only the documentation, correct ? Who want to take the liberty to do the release, I feel I am not entiltled to do so... !1 point
-
Right-click context menu items - where are they stored?
MattHiggs reacted to JLogan3o13 for a topic
@whiggs2 sometimes the trouble is indeed worth it. Years ago I provided the script below to a helpdesk worker at one of my customers. Went back several years later and that person was now the senior, providing same script to the helpdesk to force them to look up their own answers to questions. #pragma Compile(Out, Every Answer to Every Question Ever.exe) #pragma Compile(Icon, C:\Users\JLogan3o13\Documents\Icons\EasyButton.ico) $input = InputBox("Search Criteria", "Please enter type in your question.") ShellExecute ("http://www.lmgtfy.com/?q=" & $input) I have noticed, sadly, that they removed the last piece. Now it says "That's It!" for the last step, rather than "Was that really so hard?". I much prefer the former1 point -
My clipboard: 0xFFF0BDC5 0xFFF0BDC4 0xFFF0BDC3 0xFFF0BDC2 0xFFF0BDC11 point
-
Consistency check
Deye reacted to JLogan3o13 for a topic
@Deye I get the same result from the script you have posted. If you are seeing different results produced from your "main script", we will need to see that to help you determine the difference.1 point -
First have a look here and download the UDF or whatever. Set some functions to flag variables. Name the functions any valid function name. I have kept the misspelling from the tutorial. ;mouse event functions Func MOUSE_WHELLSCROLL_DOWN() ConsoleWrite(@CRLF & "!MOUSE WHEEL DOWN") $gMb_wheel_down = 1 EndFunc;MOUSE_WHELLSCROLL_DOWN() Func MOUSE_WHELLSCROLL_UP() ConsoleWrite(@CRLF & "!MOUSE WHEEL UP") $gMb_wheel_up = 1 EndFunc;MOUSE_WHELLSCROLL_UP() Assign those functions to be called on mouse wheel up | down. You might have to do this after you create a GUI window Idk. _MouseSetOnEvent_RI($MOUSE_WHEELSCROLLUP_EVENT, "MOUSE_WHELLSCROLL_UP", $hGui) _MouseSetOnEvent_RI($MOUSE_WHEELSCROLLDOWN_EVENT, "MOUSE_WHELLSCROLL_DOWN", $hGui) Now you can check the variables to test for true. If true, switch them back off and maybe do some action. If $gMb_wheel_up = 1 Then $gMb_wheel_up = 0 Exit EndIf1 point
-
Google Speech Recognition API in AutoIT
LeloDragneel reacted to genius257 for a topic
Hi @LeloDragneel. Yeah it is possible to implement the Google Speech API. It accepts REST, AutoIt can handle that. The UDF you will haft to write yourself, based on their documentation, or wait for someone to make it.1 point -
If you use StringStripWS($sDataFInalBR, 7) what does it return, if you look at the two examples below, the first returns the correct information however if you have a prefix space it will return 0. #include <Date.au3> $sDataFinalBR = "2017/04/20 07:18:26" Local $iDateCalc1 = _DateDiff('s', $sDataFinalBR, "2017/04/19 16:02:52") ; test 1 Local $iDateCalc2 = _DateDiff('s', "2017/04/19 16:02:52", $sDataFinalBR) ; test 2 Local $iDateCalc3 = _DateDiff('s', "2017/04/19 16:02:52", "2017/04/19 16:02:53") ; test 3 MsgBox(64, "Date Calc - Test 1", $iDateCalc1) MsgBox(64, "Date Calc - Test 2", $iDateCalc2) MsgBox(64, "Date Calc - Test 3", $iDateCalc3) $sDataFinalBR = " 2017/04/20 07:18:26" Local $iDateCalc1 = _DateDiff('s', $sDataFinalBR, "2017/04/19 16:02:52") ; test 1 Local $iDateCalc2 = _DateDiff('s', "2017/04/19 16:02:52", $sDataFinalBR) ; test 2 Local $iDateCalc3 = _DateDiff('s', "2017/04/19 16:02:52", "2017/04/19 16:02:53") ; test 3 MsgBox(64, "Date Calc - Test 1", $iDateCalc1) MsgBox(64, "Date Calc - Test 2", $iDateCalc2) MsgBox(64, "Date Calc - Test 3", $iDateCalc3)1 point
-
Try that (standard SQL): delete from nodups where id in ( select id from ( select id, count(*) from nodups group by NumVoie, NbPrises having count(*) > 1 ) ) ; That will keep a random row in each subset of duplicates. For instance, SQLite will yield: ID NumVoie NbPrises 1 10 10 3 85 2 4 85 1 5 25BIS 2 Yet any engine is free to select rowids 1 and 5 for deletion, instead of 2 and 6.1 point
-
The interpreter works like this (line by line): ; I am the interpreter! SomeFunc(Null) ; I need to call SomeFunc. First let me check that the function exist. Oh great, it does, found it in list of all functions that I created at the beginning! ; Ok I need to create the list of arguments for this call, the user is passing one parameter. ; The list of arguments will therefore have one member. ; Let me first create unnamed variable (because user passes literal) with value of Null. Done! ; Time for the list of arguments... ; Hm, I see that inside definition of SomeFunc the first argument is ByRef, so I'll add reference to the unnamed variable I created moment ago to the list. Dang bang... done! ; Calling the function now. Func SomeFunc(ByRef $Output) ; I'm inside a function and I have one local variable named $Output to work with plus no global variables. This $Output is ByRef, so ; I won't be allocating anything. $Output = 1 ; The user is changing the value of $Output variable. I see that $Output is reference. Accessing the original variable... changing... Done! ;... ConsoleWrite($Output & ' (L: ' & @ScriptLineNumber & ')' & @CRLF) ; This will print 1 EndFunc More clear?1 point
-
Extract table from website until the end
KimberlyJillPereira reacted to Subz for a topic
#include <Array.au3> #include <IE.au3> #include <String.au3> Local $oIE Local $oDivs Local $aPageCount, $iPageCount Local $aTable, $oTables Local $aResults[0][7] Local $oUserName, $oPassWord Local $sUserName = "user" Local $sPassWord = "demo" $oIE = _IECreate("http://www.timeview2.net/", 1) $oForms = _IETagNameGetCollection($oIE, "form") For $oForm In $oForms If $oForm.id = "UserLoginForm" Then $oUserName = _IEFormElementGetObjByName($oForm, "data[User][username]") _IEFormElementSetValue($oUserName, $sUserName) $oPassWord = _IEFormElementGetObjByName($oForm, "data[User][password]") _IEFormElementSetValue($oPassWord, $sPassWord) _IEFormSubmit($oForm) EndIf Next _IENavigate($oIE, "http://www.timeview2.net/alarms") $oDivs = _IETagNameGetCollection($oIE, "div") For $oDiv In $oDivs If $oDiv.ClassName = "alarms index" Then $aPageCount = _StringBetween($oDiv.InnerText, "Page 1 of ", ", showing ") If @error Then Exit $iPageCount = Number($aPageCount[0]) EndIf Next For $i = 1 To $iPageCount _IENavigate($oIE, "http://www.timeview2.net/alarms/index/group:All%20Groups/page:" & $i, 1) $oTables = _IETagNameGetCollection($oIE, "table") For $oTable In $oTables If $oTable.ClassName = "pageindex" Then $nTable = $oTable.NextElementSibling $aTable = _IETableWriteToArray($nTable, True) If UBound($aTable) - 1 > 0 And UBound($aTable, 2) = 7 Then If $i = 1 Then _ArrayConcatenate($aResults, $aTable, 0) Else _ArrayConcatenate($aResults, $aTable, 1) EndIf ExitLoop EndIf EndIf Next Next _ArrayDisplay($aResults) ;~ Save to CSV Local $hFileOpen = FileOpen(@ScriptDir & "\Results.csv", 2) For $i = 0 To UBound($aResults) - 1 FileWrite($hFileOpen, '"' & _ StringStripWS($aResults[$i][0], 7) & '","' & _ StringStripWS($aResults[$i][1], 7) & '","' & _ StringStripWS($aResults[$i][2], 7) & '","' & _ StringStripWS($aResults[$i][3], 7) & '","' & _ StringStripWS($aResults[$i][4], 7) & '","' & _ StringStripWS($aResults[$i][5], 7) & '"' & @CRLF) Next FileClose($hFileOpen)1 point -
Extract table from website until the end
KimberlyJillPereira reacted to Subz for a topic
Try this, just replace values for $sUserName and $sPassWord. #include <Array.au3> #include <IE.au3> #include <String.au3> Local $oIE Local $oDivs Local $aPageCount, $iPageCount Local $aTable, $oTables Local $aResults[0][7] Local $oUserName, $oPassWord Local $sUserName = "user" Local $sPassWord = "demo" $oIE = _IECreate("http://www.timeview2.net/", 1) $oForms = _IETagNameGetCollection($oIE, "form") For $oForm In $oForms If $oForm.id = "UserLoginForm" Then $oUserName = _IEFormElementGetObjByName($oForm, "data[User][username]") _IEFormElementSetValue($oUserName, $sUserName) $oPassWord = _IEFormElementGetObjByName($oForm, "data[User][password]") _IEFormElementSetValue($oPassWord, $sPassWord) _IEFormSubmit($oForm) EndIf Next $oIE = _IECreate("http://www.timeview2.net/alarms", 1) $oDivs = _IETagNameGetCollection($oIE, "div") For $oDiv In $oDivs If $oDiv.ClassName = "alarms index" Then $aPageCount = _StringBetween($oDiv.InnerText, "Page 1 of ", ", showing ") If @error Then Exit $iPageCount = Number($aPageCount[0]) EndIf Next For $i = 1 To $iPageCount $oIE = _IECreate("http://www.timeview2.net/alarms/index/group:All%20Groups/page:" & $i, 1) $oTables = _IETagNameGetCollection($oIE, "table") For $oTable In $oTables If $oTable.ClassName = "pageindex" Then $nTable = $oTable.NextElementSibling $aTable = _IETableWriteToArray($nTable, True) If UBound($aTable) - 1 > 0 And UBound($aTable, 2) = 7 Then If $i = 1 Then _ArrayConcatenate($aResults, $aTable, 0) Else _ArrayConcatenate($aResults, $aTable, 1) EndIf ExitLoop EndIf EndIf Next Next _ArrayDisplay($aResults) ;~ Save to CSV Local $hFileOpen = FileOpen(@ScriptDir & "\Results.csv", 2) For $i = 0 To UBound($aResults) - 1 FileWrite($hFileOpen, '"' & _ StringStripWS($aResults[$i][0], 7) & '","' & _ StringStripWS($aResults[$i][1], 7) & '","' & _ StringStripWS($aResults[$i][2], 7) & '","' & _ StringStripWS($aResults[$i][3], 7) & '","' & _ StringStripWS($aResults[$i][4], 7) & '","' & _ StringStripWS($aResults[$i][5], 7) & '"' & @CRLF) Next FileClose($hFileOpen)1 point -
Extract table from website until the end
KimberlyJillPereira reacted to Subz for a topic
Can you post your code without username and password and I'll take a look although probably later this evening.1 point -
my basic script wont work
SkysLastChance reacted to Subz for a topic
@adam51 Welcome to AutoIt forums, highly recommend looking at AutoIt help file as it has examples for almost every function, it will also show you the correct syntax/format for coding in Autoit. For example this is how your code should look, note: No spaces between $ and variable name Use & to join/concatenate two or more strings together Anyway I hope that helps get you started, happy coding. Global $sName = "adam" Global $sMessage = "hello" MsgBox(0,"title", $sMessage & " my name is, " & $sName)1 point -
property indexrelative just goes from a found element n positions further in the elementarray (usefull for textbox without a name after a known label) property index or instance just finds the n-th element with that specific match (similar behavior as AutoIt has)1 point
-
Extract table from website until the end
KimberlyJillPereira reacted to Subz for a topic
#include <Array.au3> #include <IE.au3> #include <String.au3> Local $oIE Local $oDivs Local $aPageCount, $iPageCount Local $aTable, $oTables Local $aResults[0][7] $oIE = _IECreate("http://www.timeview2.net/alarms", 1) $oDivs = _IETagNameGetCollection($oIE, "div") For $oDiv In $oDivs If $oDiv.ClassName = "alarms index" Then $aPageCount = _StringBetween($oDiv.InnerText, "Page 1 of ", ", showing ") If @error Then Exit $iPageCount = Number($aPageCount[0]) EndIf Next For $i = 1 To $iPageCount $oIE = _IECreate("http://www.timeview2.net/alarms/index/group:All%20Groups/page:" & $i, 1) $oTables = _IETagNameGetCollection($oIE, "table") For $oTable In $oTables If $oTable.ClassName = "pageindex" Then $nTable = $oTable.NextElementSibling $aTable = _IETableWriteToArray($nTable, True) If UBound($aTable) - 1 > 0 And UBound($aTable, 2) = 7 Then If $i = 1 Then _ArrayConcatenate($aResults, $aTable, 0) Else _ArrayConcatenate($aResults, $aTable, 1) EndIf ExitLoop EndIf EndIf Next Next _ArrayDisplay($aResults) ;~ Save to CSV Local $hFileOpen = FileOpen(@ScriptDir & "\Results.csv", 2) For $i = 0 To UBound($aResults) - 1 FileWrite($hFileOpen, '"' & _ StringStripWS($aResults[$i][0], 7) & '","' & _ StringStripWS($aResults[$i][1], 7) & '","' & _ StringStripWS($aResults[$i][2], 7) & '","' & _ StringStripWS($aResults[$i][3], 7) & '","' & _ StringStripWS($aResults[$i][4], 7) & '","' & _ StringStripWS($aResults[$i][5], 7) & '"' & @CRLF) Next FileClose($hFileOpen)1 point -
Quick HOW TO install AutoIT for Google Chrome.crx Chrome extension. 1, Download from here: https://docs.google.com/file/d/0B_6JmwNIIZ06enotRTVFNVdKOXM/edit?usp=sharing 2, Rename the file extension from crx to zip (result will be: AutoIT for Google Chrome.zip) 3, Unzip the file in a folder 4, Open Chrome and navigate to the Extensions (chrome://extensions/) 5, Tick the "Developer mode" 6, Click to the "Load unpacked extension..." button and navigate to your previously unzipped folder That's it! Tested, working in Chrome Version 55.0.2883.87 m (64-bit)1 point