Leaderboard
Popular Content
Showing content with the highest reputation on 07/25/2014 in all areas
-
Let's assume that there is a function that expects another function as an argument. Func GetSortedListOfVillains (ByRef $hero, Const ByRef $sortingAlgorithmOfEvil) ; That will take a while, so fight with swords while riding on chairs (xkcd.com/303/). Local $villains = [$evilOverlord] ; should be global _ArrayConcatenate ($villains, VisitGhibliHills ($hero)) _ArrayConcatenate ($villains, VisitForestOfInconvenience ($hero)) _ArrayConcatenate ($villains, VisitHillsOfModerateEvil ($hero)) _ArrayConcatenate ($villains, VisitMountDoom ($hero)) $sortingAlgorithmOfEvil ($villains) Return $villains EndFuncOne way to use that: Global $Sort_Arguments ; ... $Sort_Arguments = ["evilsort", $SORT_IGNORECASE] ; Let's assume that you're using a compiler which translates this into valid AutoIt. GetSortedListOfVillains ($theHero, Sort) ; ... Func Sort (ByRef $array) If Not IsArray ($Sort_Arguments) Then Return SetError (...) ; I changed this function yesterday. Use the specified sorting algorithm and silently ignore any other arguments. ; Bonus points for silently changing the meaning of an argument. EndFuncAnother way: GetSortedListOfVillains ($theHero, SpecialEvilSortUsingAUniqueVillainIdList) ; ... Func SpecialEvilSortUsingAUniqueVillainListId (ByRef $array) ; this is the id of the list v Return Sort ("evilsort", 16372, $array) ; That's a magical number, but I can't pass it as an argument. ; And I need to create a separate function for every used combination of id and sorting algorithm. EndFuncThe desired way with the hypothetical function "BindFunction": GetSortedListOfVillains ($theHero, BindFunction (Sort, "evilsort")) ; ... Func Sort (Const ByRef $sortingAlgorithm, ByRef $array) ; sort it ; Time complexity of EvilSort: O((n^2)!) EndFunc(The example code should highlight specific aspects of these approaches. That's the reason for the different signatures of the sort function.) Is something like that possible? Do you think that it would be useful?2 points
-
File Name: AutoIt v3.3.13.9 Beta File Submitter: Jon File Submitted: 25 Jul 2014 File Category: Beta 3.3.13.9 (25th, 2014) (Beta) AutoIt: - Added: MapAppend() returns the index of the element added. - Fixed: Regression with Call() and CallArgArray. - Fixed: Regression with speed of arrays. - Fixed: Was silently failing when passing unsupported parameters ByRef - now shows an error message. - Fixed: Map/Object properties starting with ".E3" were incorrectly classed as a number rather than property. Click here to download this file2 points
-
HotKeySetEx.UDF Mouse hot keys for autoit
232showtime reacted to ozmike for a topic
Hi Here is a UDF which has the much requested hotkeys for mouse clicks. Autoit's hotkeyset doesn't support mouse clicks. one of the main differences with AHK (i think). ; This UDF extends AutoIT HotKeySet by adding the much requested Mouse Button Clicks ; HotKeySet (autoIT) only does KEYBOARD ; HotKeySetEx Does both KEYBOARD and MOUSE! simple interface HotKeySetEx("{RCLICK}", "myfun") ; Right Click mouse hot key HotKeySetEx("{RDCLICK}", "myfun") ; Right double click mouse hot key HotKeySetEx("{F1}", "myfun") ; normal hot key ; new function call replaces @HotKeyPressed ; getLastHotKey() = eg {RCLICK} or {F1} See MouseTrapEvent for supported events. ; single clicks ; LClick - left button click (Primary) ; MClick - middle button click (Wheel click) ; RClick - right button click (Secondary) ; XClick1 - Xtra button 1 click (usually 'back navigaton') ; XClick2 - Xtra button 2 click (usually 'forward navigaton') ; double clicks ; LDClick - left button (Primary) ; MDClick - middle button (Wheel click) ; RDClick - right button (Secondary) ; XDClick1 - Xtra button 1 (usually 'back navigaton') ; XDClick2 - Xtra button 2 (usually 'forward navigaton') ; psuedo double clicks ('chords') - ; XClick12 - Xtra button 1&2 pressed at the same time. ; ; OTHER EVENTS you'll have to work out yourself eg mouse wheel scroll - see code. This UDF is based on MouseTrapEvent which is based on MouseSetEvent. New events for scroll and drag could be added see MouseTrapEvent code. enjoy Version two fixed left and middle double, click. Note there is a bug if you set a double click, you should set a single click as it get blocked (my apols). HotKeySetExV2.zip HotKeySetEx.zip1 point -
send problem on slow computer
langthang084 reacted to Muzaiyan for a topic
i think you was looking for this Opt('SendAttachMode', 1) ; 0 = Don't attach, 1 = Attach. Opt('SendCapslockMode', 0) ; 1 = Store and restore, 0 = Don't store/restore. Opt('SendKeyDelay', 5) ; ? = 5 milliseconds. Opt('SendKeyDownDelay', 1) ; ? = 1 millisecond. if you are still not satisfied then make a udf like this Func _Send($character,$sleep) Send($character) Sleep($sleep) EndFunc and send your string character by character using a loop1 point -
send problem on slow computer
langthang084 reacted to jdelaney for a topic
This may or may not work on your version. I'm unable to get the buttons. Probably need UI automation for that, but most is done: ; initate the find-replace window...then execute this script $hFindReplace = WinWait("Find and Replace") WinActivate($hFindReplace) $hFind = ControlGetHandle($hFindReplace,"",1024) $hReplace = ControlGetHandle($hFindReplace,"",1026) ControlSetText($hFindReplace, "", $hFind, "searchstring") ControlSetText($hFindReplace, "", $hReplace, "replacestring") ControlSend($hFindReplace, "", "","!a") WinWaitClose($hFindReplace) ConsoleWrite("done" & @CRLF)1 point -
send problem on slow computer
langthang084 reacted to jdelaney for a topic
Don't use sends then. Use controlsettext.1 point -
Problem when using script inside a window
232showtime reacted to JLogan3o13 for a topic
232showtime, it is a sign of common sense on this forum that, when a Moderator steps into a thread to ask a question, you take that as a sign to stay out of it1 point -
1 point
-
Straight issue with InetGet
pixelsearch reacted to AdmiralAlkex for a topic
This is wrong: Local $iFiledownload = InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE) "Did we download it: " & $iFiledownload) $INET_DOWNLOADCOMPLETE is only whether the download is finished (as in stopped receiving data) or not. $INET_DOWNLOADSUCCESS is what tells you if it succeeded.1 point -
HotKeySetEx.UDF Mouse hot keys for autoit
232showtime reacted to guinness for a topic
It appears the user has just taken UDFs by other authors and merged together. It would have been polite if they had linked back to the original threads.1 point -
Function Binding
jvanegmond reacted to guinness for a topic
We are making progress in this area with that UDF.1 point -
How Much Internet Traffic Used?
AmirAshkan2012 reacted to Jos for a topic
Though I gave the answer already ..no?1 point -
Fixed in next beta. It should never have worked in previous versions either.1 point
-
thanks Dany, it helped me out. I modified '?do=embed' frameborder='0' data-embedContent>> and used code posted here to come up this #include "_WinTrust.au3" $filepath = FileOpenDialog("pick a file",@ScriptDir, "All Files (*.*)") If Not FileExists($filepath) Then MsgBox(16, '', $filepath & ' does not exist.') Exit EndIf $retval = _Verify($filepath) If $retval[0] Then MsgBox(64,'Verified', $filepath & ' is verified.' & @crlf & $retval[0] & @CRLF & $retval[1] & @CRLF & $retval[2]) ConsoleWrite($filepath & ' is verified.' & @CRLF & $retval[0] & @CRLF & $retval[1] & @CRLF & $retval[2] & @CRLF) Else MsgBox(032,'Unverified',$filepath & ' is not verified.') ConsoleWrite($filepath & ' is not verified.' & @CRLF) EndIf I have tested on win 7 64 bit, win 8 32bit, win 8.1 64 bit and xp sp3 and it worked. _WinTrust.au31 point
-
How Much Internet Traffic Used?
AmirAshkan2012 reacted to Jos for a topic
You would need some sort of Proxy program in between. Wouldn't recommend AutoIt3 for that. Jos1 point -
alobimday, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation - and then you will understand why you will get no help and your code has been removed. See you soon with a legitimate question I hope. M231 point
-
Simple mouse clicking in Java app using info from simplespy?
232showtime reacted to junkew for a topic
Please read the iuiautomation thread and see what can and cannot work. It heavily depends on how the java application is build. For example lotus notes is written in java and supports full accessibility. If its the same for your application you can best assess by looking with simplespy how easy elements are highligthed. Commands and examples are in the first post attached in zip files. And you should then not us autoit commands to control elements.1 point -
Image Search Library
jvanegmond reacted to Hyflex for a topic
Lucky, I still have a backup of this See attached. However, I don't know how to get it working I'm constantly getting: if $result[0]="0" then return 0 if $result^ ERRORWhenever I run... (Line 40 of ImageSearch.au3)ImageSearch.zip1 point -
How can I Set Focus to an input box?
SkysLastChance reacted to Melba23 for a topic
Genos, You need the handle, not the ControlID: #include <GUIConstantsEx.au3> #Include <WinAPI.au3> $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("", 10, 10, 400, 20) GUICtrlCreateButton("Test", 10, 100, 80, 30) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState() Sleep(5000) _WinAPI_SetFocus(ControlGetHandle("Test", "", $hInput)) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd M231 point