Leaderboard
Popular Content
Showing content with the highest reputation on 02/13/2014 in all areas
-
Advanced Pixel Search Library
robertocm reacted to FastFrench for a topic
As I was too limited by what was feasible with PixelSearch in Autoit, I wrote an optimized DLL in C++ for searching pixels on the screen. The most basic function allows you to find the pixel in a given color - as PixelSearch - but instead of returning the first found, it returns the closest to a given point. It can go much further: - Search for 'spot' the closest (NxN square containing P pixels that meet the criteria of color mentioned) - Maintains a list containing up to 1024 colors (search pixels with one color in this list) - Manages up to 1024 exclusion rectangles. We can define precisely the search pattern that you want (with a rectangle from which you "substract" several "exclusion rectangles"). You can have up to 1024 exclusion rectangles. - You can also set a 'shade variation' (same idea as with PixelSearch). - Can work on several 'snapshots' (screen captures) in memory. It is possible to retain up to 1024 snapshots simultaneously (of course, each capture consumes memory, so only use the "slots" you really need). - Works on full screen or specific window (HWND optionnal parameter) or part of it. - Also includes functions to identify the changes between two SnapShots (minimum rectangle containing all changes + number of pixels that have changed). Useful to detect movement on the screen, object state changes... - Fairly sophisticated tools provided for debugging are also included in the UDF. You can choose the type of logs you want, including the ability to view on screen the detected areas (most useful during development phasis) and record the transaction details in a log file. - For even more performance, you can capture the content of a screen memory (SnapShot, takes about the same time as or PixelSearch PixelGetColor) then do all the research you want in this snapshots (very fast functions : nearly 1000 times as fast as the native PixelGetColor). - [v1.4] : find the "best spot" - meaning the spot that has the best number of "right" colors. - [v1.4] : now provided with a tool, FFShowPixels.exe, to find colors, manage color lists, show all occurences of them on the Captured Window, and... automatically generates AutoIt or C++ code. - [v1.6] : Saves SnapShots on BitMaps (BMP and JPG supported) - [v1.6] : Modifies SnapShots with "filters" (Keep only some colors or only pixels that have changes. All other pixels can be turned to black). - [v1.7] : Can change pixels colors on SnapShots (SetPixel) - [v1.7] : Can access the Raw pixel data of SnapShots (GetRawData) - [v1.7] : Can draw back SnapShots on Screen. - [v1.8] : Bug fixes. Deleted - [v1.8.1] : Bug fixes (FastFind.au3). - [v1.8.2] : Bug fixes (FastFind.au3). - [v1.8.3] : Bug fixes (FastFind.au3). Deleted - [v1.8.4] : Should now run on early XP and Windows 2000 OS. - [v2.0] : Documentation file in english (FastFind.chm), several new functions and new feature on some old functions. - [v2.1] : Bug fixes (removed those nasty errors in message boxes) - [v2.2] : Bug fix Included in the archive: both the 32 bits and 64 bits dll (written in Visual C++ 2010), the AutoIt Wrapper, a demonstration script and a tiny Benchmark script. Here it is, your comments and suggestions are welcome. [updates/Changelog] Last Version : 2.2 FastFind 2_2.zip Version 2.2 Bug fixes FastFind 2_2.zip Version 2.1 Bug fixes FastFind 2_1.zip Version 2.0 A new documentation file, in chm format (thanks to CeramicWeasel) New functions : DrawSnapShotXY (same as DrawSnapShot, with specific top-left position for drawing). ComputeMeanValues (Gives mean Red, Green and Blue values of a SnapShot) ApplyFilterOnSnapShot (apply a AND filter on each pixels in the SnapShot) FFGetRawData (provide access to all pixel data) ShadeVariation parameter added in the following functions : KeepChanges LocalizeChanges HasChanged FastFind 2_0.zip jan 5 2012: ShowPixel Link should work now ?do=embed' frameborder='0' data-embedContent> Version 1.8 -> bug fixes Updates : FastFind 1_8_4.zip Version 1.7 -> bug fix with client coordinates -> Can change pixels colors on SnapShots (SetPixel) -> Can access the Raw pixel data of SnapShots (GetRawData). Not that this feature is not allready wrapped into autoit: you have to do it with dllcall. -> Can draw back SnapShots on Screen (DrawSnapShot). -> New function to duplicate a SnapShot (DuplicateSnapShot) FastFind 1_7.zip FFShowPixels + FastFind complete 1.7 package : ?do=embed' frameborder='0' data-embedContent> Version 1.6 -> bug fix (restriction rectangles + FFColorCount) -> New functions to export captures into BMP or JPEG Files -> New functions to create SnapShots with changes or selected colors from a previous SnapShot(FFKeepChanges & FFKeepColors). FFShowPixels1_6 wo FFShowPixels.zip Version 1.5 -> FFGetPixel bug fix. FastFind1_5.zip (Update) Version 1.4 -> A new optional parameter in SetHWnd : You can now choose to take either the full Window or only the Client area of the window. -> Several bug fixes (more reliable and consistent) -> A new search fonction : FFBestSpot. It will find the spot that contains the most "good" pixels. -> A new tool - ShowPixels.exe - will allow you to easily manage list of colors (find them on the screen, make stats...) and automatically generate AutoIt or C++ code from them. Unfortunately, the zip is too big to include ShowPixel.exe in it. So if you want this tool, just ask with pm or mail. (Update) Version 1.3 -> comments in demo scripts now in english -> Some minor bug fixed -> now both 32 bits and 64 bits dll are provided -> Several function calls are now more simple to use : the x1,y1,x2,y2 limits of the area for search functions are now optional. Default values means full window (or screen)) ** Warning ** I've changed the order of the parameters in some fonctions, to make them easier to use. So if you use any of the 3 following function, you will need to reorder the parameters if you want to update to the version 1.3 of FastFind. Func FFNearestPixel($PosX, $PosY, $Color, $Left=0, $Top=0, $Right=0, $Bottom=0, $ForceNewSnap=true, $NoSnapShot=$FFLastSnap, $WindowHandle=-1) Func FFNearestSpot($SizeSearch, $NbPixel, $PosX, $PosY, $Color, $ShadeVariation=0, $Left=0, $Top=0, $Right=0, $Bottom=0, $ForceNewSnap=true, $NoSnapShot=$FFLastSnap, $WindowHandle=-1) Func FFColorCount($ColorToCount, $ShadeVariation=0, $Left=0, $Top=0, $Right=0, $Bottom=0, $ForceNewSnap=true, $NoSnapShot=$FFLastSnap, $WindowHandle=-1) (Update) Version 1.2 I hope these library will prove useful. Please tell me how you use it and how you like it. FF1 point -
Hi! Today I want to show you my current AutoIt project: The ISN AutoIt Studio. The ISN AutoIt Studio is a complete IDE made with AutoIt, for AutoIt! It includes a GUI designer, a code editor (with syntax highlighting, auto complete & intelisense), a file viewer, a backup system, trophies and a lot more features!! Here are some screenshots: Here some higlights: -> easy to create/manage/public your AutoIt-projects! ->integrated GUI-Editor (ISN Form Studio 2) ->integrated - file & projectmanager ->auto backupfunction for your Projects ->extendable with plugins! ->available in several languages ->trophies ->Syntax highlighting /Autocomplete / Intelisense ->Dynamic Script ->detailed overview of the project (total working hours, total size...) And much more!!! -> -> Click here to download ISN AutoIt Studio <- <- Here is the link to the german autoit forum where I posted ISN AutoIt Studio the first time: http://autoit.de/index.php?page=Thread&threadID=29742&pageNo=1 For more information visit my Homepage: https://www.isnetwork.at So….have fun with ISN AutoIt Studio! PS: Sorry for my bad English! ^^1 point
-
Context Menu
UndefinedVar reacted to BrewManNH for a topic
ConsoleWrite(_GUICtrlListView_GetItemTextString($ListView1, -1) & @CRLF) So, take this line out of the message loop and replace it with a function call that includes the text of the LV passed to it.1 point -
onlinethlive, Of course it is. Some of the elements of the language that you will need are: - inputbox / guictrlcreateinput - function(s) / call(s) Look in the Help file and see what you can come up with. Good Luck, kylomas1 point
-
I would also recommend that you check out the >ISN AutoIt Studio, which includes what many (including myself) believe to be a better Form Designer. The ISN AutoIt Studio is an IDE (Integrated Development Environment) for AutoIt and it is being developed by a member of the AutoIt community using AutoIt.1 point
-
Context Menu
UndefinedVar reacted to BrewManNH for a topic
This works. #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 314, 233, 192, 124) $ListView1 = GUICtrlCreateListView("Test|_Test", 14, 26, 154, 188) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $ListViewArray[100] Local $OptionsArray[100] For $i = 0 To 6 If $ListViewArray[$i] = "" Then $ListViewArray[$i] = GUICtrlCreateListViewItem("test" & $i & "|" & "test" & $i * 2, $ListView1) Next $contextmenu = GUICtrlCreateContextMenu($ListView1) $submenu = GUICtrlCreateMenu("FUNCS", $contextmenu) $option1 = GUICtrlCreateMenuItem("op1", $submenu) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $option1 ConsoleWrite(_GUICtrlListView_GetItemTextString($ListView1, -1) & @CRLF) EndSwitch Sleep(10) WEnd Prints out the text of the selected row of the listview in the SciTE console.1 point -
How to Generate a Random English Word
onlineth reacted to Unc3nZureD for a topic
This one does the same: $File = FileReadToArray("Word's.txt") $Random = $File[Random(0, UBound($File) - 1, 1)] MsgBox(64, "Hey", "Here's a random word: " & $Random)1 point -
How to Generate a Random English Word
GoogleDude reacted to jdelaney for a topic
try: $aWords = StringRegExp(FileRead("some.txt"),"(\w+)",3) $sRandom = $aWords[Random(0,UBound($aWords),1)] ConsoleWrite($sRandom & @CRLF)1 point -
image compare 99% identical
Alexxander reacted to nullschritt for a topic
Though I would add that I release an imagecompare library based on my datadifference udf. My udf was able to detect there was an average of 10.19% difference in your images. (this means it got 10% brighter in the room in these 2 seconds. (probably due to the skylight in your room) See the below images. The shades of blue represent the amount of change that has occurred. Lighter blue = more change. black= no change. (this image excludes changes of less than 10%) (notice how the black areas are either 1)full white/black and thus cannot appear any brighter OR 2)are under objects (shadows)) (image with all changes displayed)1 point -
abhinavrohatgi, Welcome to the AutoIt forum. But please pay attention to where you post - the "Developer Chat" section where you started this thread is not for general support questions. I have moved the thread for you, but would ask you to be more careful in future. However, I must ask if your question has anything at all to do with AutoIt - it seems to be a PowerPoint query? M231 point
-
nitekram, That makes even less sense than the first post. If you want to see if the element contains the string "<->" then you need to use the "partial search" parameter as explained above. In that case the return will be -1 if the string is not found and 0+ if it is. So I think your code would need to be: If _ArraySearch($array, '<-->', 0, 0, 0, 1) = -1 Then ; Not found so - code Else ; Found so - continue EndIf But I am not entirely sure I have your desired outcome correct. M231 point
-
... another way shorter but a few bits slower ConsoleWrite(Hex(ReverseBits(0x40), 8) & @LF) ConsoleWrite(Hex(ReverseBits(0x20), 8) & @LF) Func ReverseBits($Byte) Local $out = 0 For $i = 0 To 7 $out = BitShift($out, -1) $out = BitOR($out, BitAND($Byte, 2 ^ $i) > 0) Next Return $out EndFunc ;==>ReverseBits EDIT: or only by manipulation of the bits ConsoleWrite(Hex(ReverseBits(0x40), 8) & @LF) ConsoleWrite(Hex(ReverseBits(0x20), 8) & @LF) Func ReverseBits($Byte) Local $out = 0 For $i = 0 To 7 $out = BitOR(BitShift($out, -1), BitAND($Byte, 1)) $Byte = BitShift($Byte, 1) Next Return $out EndFunc ;==>ReverseBits1 point
-
If you install the FULL SciTe editor then Koda is included.1 point
-
Not sure of the appeal...something like this? ;~ ;~Create the params for a function ;~ ConsoleWrite("$" & $i) ;~ For $i = 2 To 200 ;~ ConsoleWrite(",$" & $i & "=Default") ;~ Next ;~ ConsoleWrite(@CRLF) #include <Array.au3> Lazy_SomeFunction("some","string","here","as","you","see","fit") Func Lazy_SomeFunction($1,$2=Default,$3=Default,$4=Default,$5=Default,$6=Default,$7=Default,$8=Default,$9=Default,$10=Default,$11=Default,$12=Default,$13=Default,$14=Default,$15=Default,$16=Default,$17=Default,$18=Default,$19=Default,$20=Default,$21=Default,$22=Default,$23=Default,$24=Default,$25=Default,$26=Default,$27=Default,$28=Default,$29=Default,$30=Default,$31=Default,$32=Default,$33=Default,$34=Default,$35=Default,$36=Default,$37=Default,$38=Default,$39=Default,$40=Default,$41=Default,$42=Default,$43=Default,$44=Default,$45=Default,$46=Default,$47=Default,$48=Default,$49=Default,$50=Default,$51=Default,$52=Default,$53=Default,$54=Default,$55=Default,$56=Default,$57=Default,$58=Default,$59=Default,$60=Default,$61=Default,$62=Default,$63=Default,$64=Default,$65=Default,$66=Default,$67=Default,$68=Default,$69=Default,$70=Default,$71=Default,$72=Default,$73=Default,$74=Default,$75=Default,$76=Default,$77=Default,$78=Default,$79=Default,$80=Default,$81=Default,$82=Default,$83=Default,$84=Default,$85=Default,$86=Default,$87=Default,$88=Default,$89=Default,$90=Default,$91=Default,$92=Default,$93=Default,$94=Default,$95=Default,$96=Default,$97=Default,$98=Default,$99=Default,$100=Default,$101=Default,$102=Default,$103=Default,$104=Default,$105=Default,$106=Default,$107=Default,$108=Default,$109=Default,$110=Default,$111=Default,$112=Default,$113=Default,$114=Default,$115=Default,$116=Default,$117=Default,$118=Default,$119=Default,$120=Default,$121=Default,$122=Default,$123=Default,$124=Default,$125=Default,$126=Default,$127=Default,$128=Default,$129=Default,$130=Default,$131=Default,$132=Default,$133=Default,$134=Default,$135=Default,$136=Default,$137=Default,$138=Default,$139=Default,$140=Default,$141=Default,$142=Default,$143=Default,$144=Default,$145=Default,$146=Default,$147=Default,$148=Default,$149=Default,$150=Default,$151=Default,$152=Default,$153=Default,$154=Default,$155=Default,$156=Default,$157=Default,$158=Default,$159=Default,$160=Default,$161=Default,$162=Default,$163=Default,$164=Default,$165=Default,$166=Default,$167=Default,$168=Default,$169=Default,$170=Default,$171=Default,$172=Default,$173=Default,$174=Default,$175=Default,$176=Default,$177=Default,$178=Default,$179=Default,$180=Default,$181=Default,$182=Default,$183=Default,$184=Default,$185=Default,$186=Default,$187=Default,$188=Default,$189=Default,$190=Default,$191=Default,$192=Default,$193=Default,$194=Default,$195=Default,$196=Default,$197=Default,$198=Default,$199=Default,$200=Default) Local $a[@NumParams] For $i = 0 To UBound($a)-1 $a[$i] = Eval($i+1) Next SomeFunction($a) EndFunc Func SomeFunction($array) _ArrayDisplay($array) EndFunc basically a function to concat strings into an array...1 point
-
1 point
-
When your calling $username in your _IEFormElementSetValue, you're actually getting the ControlID of the GUICtrlInput that you created on your GUI. You need to use $somevar = GUICtrlRead($username) to actually get the string in the input field. It's also kind of suspicious to have a 'Number of Searches' field while on a webmail login page.1 point
-
Device Management API
mesale0077 reacted to llewxam for a topic
Enjoy Ian DeviceAPI.au3 DeviceAPI_GUI_Example.au3 DeviceAPI_Example.au31 point -
@water If you don't mind me asking, were does it say that a function can have only 30 parameters? Here is a test function with 100 parameters. Global $iReturn = _Test(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) ConsoleWrite($iReturn & @LF) Func _Test($param1, $param2, $param3, $param4, $param5, $param6, $param7, $param8, $param9, $param10, _ $param11, $param12, $param13, $param14, $param15, $param16, $param17, $param18, $param19, $param20, _ $param21, $param22, $param23, $param24, $param25, $param26, $param27, $param28, $param29, $param30, _ $param31, $param32, $param33, $param34, $param35, $param36, $param37, $param38, $param39, $param40, _ $param41, $param42, $param43, $param44, $param45, $param46, $param47, $param48, $param49, $param50, _ $param51, $param52, $param53, $param54, $param55, $param56, $param57, $param58, $param59, $param60, _ $param61, $param62, $param63, $param64, $param65, $param66, $param67, $param68, $param69, $param70, _ $param71, $param72, $param73, $param74, $param75, $param76, $param77, $param78, $param79, $param80, _ $param81, $param82, $param83, $param84, $param85, $param86, $param87, $param88, $param89, $param90, _ $param91, $param92, $param93, $param94, $param95, $param96, $param97, $param98, $param99, $param100) ConsoleWrite("@NumParams: " & @NumParams & @LF) Return $param1 + $param2 + $param3 + $param4 + $param5 + $param6 + $param7 + $param8 + $param9 + $param10 + _ $param11 + $param12 + $param13 + $param14 + $param15 + $param16 + $param17 + $param18 + $param19 + $param20 + _ $param21 + $param22 + $param23 + $param24 + $param25 + $param26 + $param27 + $param28 + $param29 + $param30 + _ $param31 + $param32 + $param33 + $param34 + $param35 + $param36 + $param37 + $param38 + $param39 + $param40 + _ $param41 + $param42 + $param43 + $param44 + $param45 + $param46 + $param47 + $param48 + $param49 + $param50 + _ $param51 + $param52 + $param53 + $param54 + $param55 + $param56 + $param57 + $param58 + $param59 + $param60 + _ $param61 + $param62 + $param63 + $param64 + $param65 + $param66 + $param67 + $param68 + $param69 + $param70 + _ $param71 + $param72 + $param73 + $param74 + $param75 + $param76 + $param77 + $param78 + $param79 + $param80 + _ $param81 + $param82 + $param83 + $param84 + $param85 + $param86 + $param87 + $param88 + $param89 + $param90 + _ $param91 + $param92 + $param93 + $param94 + $param95 + $param96 + $param97 + $param98 + $param99 + $param100 EndFunc Adam1 point
-
it does, but i found a better solution #Include <GuiConstantsEx.au3> $hGUI = GUICreate("",110,100) GUICtrlCreateGraphic(0,0,200,200) GUICtrlSetBkColor(-1,0xFF11EE) GUICtrlSetState(-1,$GUI_DISABLE) $check = GUICtrlCreatecheckbox ( " checkbox " , 20 , 20 ) GUICheckBoxSetColor ($check, 0x000000 , $GUI_BKCOLOR_TRANSPARENT ) GUISetState ( ) While 1 $nMsg = GUIGetMsg ( ) Switch $nMsg Case - 3 Exit EndSwitch WEnd Func GUICheckBoxSetColor ( ByRef $nats, $iColor, $iBkColor= "0xF1EDED" ) $CtrlHWnd = $nats If Not IsHWnd ( $CtrlHWnd) Then $CtrlHWnd = GUICtrlGetHandle ($nats) $AParent = DllCall ( "user32.dll" , "hwnd" , "GetParent" , "hwnd" , $CtrlHWnd) $aCPos = ControlGetPos ( $AParent[ 0 ] , "" , $nats) $Soldt = GUICtrlRead ( $nats, 1 ) GUICtrlDelete ( $nats) DllCall ( 'uxtheme.dll' , 'none' , 'SetThemeAppProperties' , 'int' , 0 ) $nats = GUICtrlCreatecheckbox ( $Soldt, $aCPos[ 0 ] , $aCPos[ 1 ] , $aCPos[ 2 ] , $aCPos[ 3 ] ) GUICtrlSetColor ( - 1 , $iColor) GUICtrlSetBkColor ( - 1 , $iBkColor) DllCall ( 'uxtheme.dll' , 'none' , 'SetThemeAppProperties' , 'int' , 7 ) EndFunc1 point