Leaderboard
Popular Content
Showing content with the highest reputation on 07/24/2013 in all areas
-
AutoIt v3.3.9.12 Beta
jaberwacky reacted to Jon for a topic
File Name: AutoIt v3.3.9.12 Beta File Submitter: Jon File Submitted: 24 Jul 2013 File Category: Beta 3.3.9.12 (24th July, 2013) (Beta) AutoIt: - Added: @LocalAppDataDir for local AppData (@AppDataDir is the roaming location) - Fixed: 3rd time lucky changes for Windows XP RTM compatability. (Un)RegisterTypeLibForUser loaded dynamically. - Fixed: Regression in WinGetClassList() with missing line feeds. - Fixed: Better operator precedence handling for tenary operator. Aut2Exe: - Changed: Aut2Exe makes all resource changes (version info, manifest, etc) in a single pass. Should be quicker. UDFs: - Added: _FileListToArrayRec now accepts the Default keyword to use default parameters. - Changed: _ReplaceStringInFile() will only overwrite the file if instances of the replacement were found. Click here to download this file1 point -
Functions are not first class objects, as they cannot be created at runtime (yet). This is the first step towards possibly implementing that in the future. The correct term would be second class, in a similar way to C's function pointers. A very common design pattern in other languages is a callback system like so: Local $a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] _EnumArray($a, MyCallback) Func MyCallback($v) ConsoleWrite($v & @LF) Return True EndFunc ;==>MyCallback ; Calls $Callback for each element in the array. ; If the callback returns FALSE then enumeration is stopped. ; Returns TRUE if the callback returned TRUE for all elements. Func _EnumArray($a, $Callback) For $i = 0 To UBound($a) - 1 If Not $Callback($a[$i]) Then Return False Next Return True EndFunc ;==>_EnumArray This is actually how the Enum* winapi functions work (though autoit handles this for you in WinAPI.au3 to return an array). This functionality was available previously with Call() and passing string function names. Advantages of this system are: AutoIt can check the functions for you, and fails with the correct error message if these are incorrect (e.g. incorrect number of parameters). AutoIt will also report an undeclared function name when you pass it to the function, rather than when you try and call it which could be somewhere further down the line making it difficult to trace the real problem. Works with obfuscator even if you use a variable rather than string literal. This is doing it properly. The main advantage you will see in every day use is that functions like HotkeySet can now take a function name as the second argument, rather than a string. This will report errors correctly as per point 2 above, though it appears that is not working correctly at the moment. I will report the bug now (assuming it is a bug as it means typos in keywords won't be reported as errors). If I'm honest, the main reason I like this change is the last point above: This is doing it properly and using string function names was not a good design choice in the first place (though was probably a lot easier to implement).1 point
-
http://www.youtube.com/watch?v=l91ISfcuzDw Joking aside, please see the forum rules linked at the bottom right of this page, as game automation is against the rules.1 point
-
Report Help file errors here (Part 2)
trancexx reacted to JLogan3o13 for a topic
Glad you threw that in there, I was reaching for my kerchief.1 point -
Read Hex
Danp2 reacted to JLogan3o13 for a topic
It's a d, then another d, then 6, 1, 2, then c... How about you think a little and explain what you're trying to do1 point -
Your button information is in the "text" parameter in your first 2 tries, put "", before the button information and use the second example you posted. The help file is the best place to find out how to use a function, optional parameters aren't optional if you use one of the other optional parameters that come after it Left to Right.1 point
-
asianqueen, Open the Help file page for ControlClick and compare those snippets to the required syntax. You will see that none of them match - so it js hardly surprising that none of them work. You need 3 obligatory parameters: title, text, ControlID - you have a title, the Advanced CLASS information you have will act as a ControlID, and you can leave the text parameter as an empty string (""). So why not put those parameters into the correct places in the function call and see if it works then. M231 point
-
This works for me: #include "WinHttp.au3" Global $sHost = "kboxdemo.bomgar.com" Global $sTarget = "download_customer_connector.ns?issue_menu=1&id=1&customer_name=Name&download=1" Global $hHttpOpen = _WinHttpOpen() Global $hConnect = _WinHttpConnect($hHttpOpen, $sHost, $INTERNET_DEFAULT_HTTPS_PORT) Global $hRequest = _WinHttpOpenRequest($hConnect, "GET", $sTarget, Default, Default, Default, $WINHTTP_FLAG_SECURE) _WinHttpAddRequestHeaders($hRequest, "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0") _WinHttpSendRequest($hRequest) _WinHttpReceiveResponse($hRequest) Global $sDisp = _WinHttpQueryHeaders($hRequest, $WINHTTP_QUERY_CONTENT_DISPOSITION) ConsoleWrite($sDisp & @CRLF) ; Close handles _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hHttpOpen)1 point
-
This might come closer to what AHK does with its StatusBarWait command, although there is absolutely no parameter checking in the code here, and doesn't seem to be any in AHK either for that matter. Func _StatusBarWait($StatusBarText = "", $StatusBarWaitTime = Default, $StatusBarPart = 1, $StatusBarWinTitle = "[ACTIVE]", $StatusBarWinText = "", $StatusBarInterval = 50) Local $StatusBarTimer = TimerInit(), $StatusBarReturn = "" Local $StatusBarError = 1 ; Timeout Error code Do $StatusBarRead = StatusbarGetText($StatusBarWinTitle, $StatusBarWinText, $StatusBarPart) If Not @error Then If $StatusBarRead = $StatusBarText Then $StatusBarReturn = $StatusBarRead $StatusBarError = 0 ; no error ExitLoop EndIf Else $StatusBarError = 2 ; Can't read the statusbar or find the window ExitLoop EndIf Sleep($StatusBarInterval) Until TimerDiff($StatusBarTimer) >= $StatusBarWaitTime Return SetError($StatusBarError, 0, $StatusBarReturn) EndFunc ;==>_StatusBarWait1 point
-
Get list of file from a webserver
michaelslamet reacted to kylomas for a topic
michaelslamet, This is how I list files from a specific directory at my WEB server... Func display_remote_files() $file_count = 0 GUICtrlSetData($lbl020,'Finding remote files...please wait...') GUICtrlSetData($edt010,'') Local $server = '*********************' Local $username = '********' Local $pass = '********' Local $Open = _FTP_Open('Samolyk FTP') If $open = 0 Then l(' FTP Open Error - Error code = ' & @error & _WinAPI_GetLastErrorMessage()) Exit endif Local $Conn = _FTP_Connect($Open, $server, $username, $pass) If $conn = 0 Then l(' FTP Connect Error - Error code = ' & @error & _WinAPI_GetLastErrorMessage()) exit endif Local $hfl Local $a_files = _FTP_findfilefirst($conn,"/www/klms/",$hfl) If @error = -1 Then GUICtrlSetData($lbl020,$file_count & ' files available for download...') Return endif GUICtrlSetData($edt010,$a_files[10] & @crlf, 1) $file_count += 1 While 1 $a_files = _ftp_findfilenext($hfl) If @error = -1 Then exitloop EndIf GUICtrlSetData($edt010,$a_files[10] & @crlf, 1) $file_count += 1 wend GUICtrlSetData($lbl020,$file_count & ' file(s) available for download...hit "DOWNLOAD FILES" to start download...') _ftp_findfileclose($hfl) Local $Ftpc = _FTP_Close($Open) If $ftpc = 0 Then l(' FTP CLose Error = ' & @error & @LF & _WinAPI_GetLastErrorMessage()) exit EndIf endfunc There are other, better FTP* functions that I was unaware of when I wrote this (see Help file). kylomas Edit: Obviously this is part of a script so the GUI references and references to function L() don't make sense. If the FTP functions are not clear I'll post the entire script. Edit2: A better example is right in the Help file under _FTP_ListToArray.1 point -
look into the helpfile, the _IE_Example() ff functions offer all you want. study the examples. it's a bit tricky, but you can automate almost everything. E. ; ******************************************************* ; Example 1 - Open a browser with the form example, click on the ; <input type=image> form element with matching alt text ; ******************************************************* #include <IE.au3> Local $oIE = _IE_Example("form") _IEFormImageClick($oIE, "AutoIt Homepage", "alt") ; ******************************************************* ; Example 2 - Open a browser with the form example, click on the <input type=image> ; form element with matching img source URL (sub-string) ; ******************************************************* #include <IE.au3> $oIE = _IE_Example("form") _IEFormImageClick($oIE, "autoit_6_240x100.jpg", "src") ; ******************************************************* ; Example 3 - Open a browser with the form example, click on the ; <input type=image> form element with matching name ; ******************************************************* #include <IE.au3> $oIE = _IE_Example("form") _IEFormImageClick($oIE, "imageExample", "name") . , ; ******************************************************* ; Example 1 - Open a browser with the form example, set the value of a text ; form element, retrieve and display the value from the element ; ******************************************************* #include <IE.au3> Local $oIE = _IE_Example("form") Local $oForm = _IEFormGetObjByName($oIE, "ExampleForm") Local $oText = _IEFormElementGetObjByName($oForm, "textExample") Local $IEAu3Version = _IE_VersionInfo() _IEFormElementSetValue($oText, $IEAu3Version[5]) MsgBox(0, "Form Element Value", _IEFormElementGetValue($oText)) . very useful are the "developer tools" in the Extras menu of ie. they give you the structure of the html code.1 point