Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/23/2015 in all areas

  1. After having lot of issues myself with getting ImageSearch to work I decided to make topic with explanation how to proper use this script. Here is link of original topic at this topic: Credits to kangkeng for creating such useful piece of code. What is ImageSearch? It's script that find part of screen which you before defined with given image. When should I use ImageSearch? You should use it whenever it's not possible or unlikely that pixelsearch will give what you need. So how can I use ImageSearch and enjoy it's awesome benefits? First of all to avoid mostly caused problems I recompiled DLLs for both architectures which you can download at end of this post. When you pick your package you should place both ImageSearch.au3 and ImageSearch.dll inside script folder. Usage Example: First of all take picture of what you want to search for (print screen + paint + corp + save as bmp). Place that picture in script directory (I named my picture checkImage (checkImage.bmp is full name with extension). You must include ImageSearch.au3 in your script. ImageSearch.au3 consist of 2 Functions you can use: _ImageSearch and _ImageSearchArea Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify a desktop region to search Values to put in for _ImageSearch function (entire screen search) ($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance, $HBMP=0) Values to put in for _ImageSearchArea function (you declare part of screen to be searched) ($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance,$HBMP=0) Description of parameters from ImageSearch.au3 itself: ; Description: Find the position of an image on the desktop ; Syntax: _ImageSearchArea, _ImageSearch ; Parameter(s): ; $findImage - the image to locate on the desktop ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 Example of my script using _ImageSearch ( entire screen search) #include <ImageSearch.au3> HotKeySet("p", "checkForImage") global $y = 0, $x = 0 Func checkForImage() Local $search = _ImageSearch('checkImage.bmp', 0, $x, $y, 0) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc while 1 sleep(200) WEnd Example of my script using _ImageSearchArea #include <ImageSearch.au3> HotKeySet("p", "checkForImage") global $y = 0, $x = 0 Func checkForImage() local $search = _ImageSearchArea('check5.bmp', 1, 800, 40, 900, 80, $x, $y, 0) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc while 1 sleep(200) WEnd I would like to apologize if by writing this I offended any of member that thinks this script is too simple to even have it explained, it's just as me being new to autoIt it took me so much time getting around errors and making this script to work. Thanks for reading, if you bump on any problems using it post it here, I will try to help you fixing it and update topic for further reference. Download links: 32bit: ImageSearch 32bit.rar 64bit: ImageSearch 64 bit.rar
    1 point
  2. Online Autoit Editor / Compiler v1.0 I have been lurking around these forums for years. Building everything from personal to commercial products with the help of autoit. Now im not the type to post at all. In fact i have stage fright right now as i always feel like i will say the wrong things. But when i took the time to make this for my personal use on my Windows RT table, i figured it may be nice enough to share with you guys? Its a Advanced Online Autoit editor made with ACE editor. The syntax highlighting among everything else besides the text area ACE supplied was hand made by myself. I do hope you enjoy it and im always open to any tips. And if i ever have used someone else's source along the way that i didn't give credit for, please PM me and i will make sure to do so! Now for the screen shots and site. Taste of the site: Ability to save scripts for later use, and compile to download: AU3CHECK before compiling to make sure your script works first: On the fly Auto-complete / suggestion of every autoit function: Ability to import other syntax for use (C#,Java, Etc.) and a complete customizable editor. Make it your own And these are just a few screenshots of what it can do. Any feedback is welcome! SOURCE: Online AUTOIT Editor and Compiler
    1 point
  3. Before inserting the second or third QR check if the array entry exists: If $i+1 > $aFList[0] Then ExitLoop ; Or If $i+2 > $aFList[0] Then ExitLoop
    1 point
  4. Jos

    Aut2Exe compiling error

    Just for the record: I am happily married and very straight. Jos
    1 point
  5. Insert the following lines after _Word_DocPictureAdd to lock the aspect ratio and resize the image to 120pt. $oShape.LockAspectRatio = True $oShape.Height = 120If you need a relative size (let's say to the page size) please let me know.
    1 point
  6. Exactly what I've coded This example inserts 3 QR files plus the text on top of it. You need to prepare the doc with the table plus the formatting of the content (center). Change the script to process the files in a loop - that's it. If you do not know how many QR files you need to add to the document then it should be possible to change the script so the word template has only one cell and expands the table as needed. #include <Word.au3> #include <Array.au3> #include <File.au3> Local $oWord = _Word_Create() Local $oDoc = _Word_DocOpen($oWord, @ScriptDir & "\test.docx") Local $oRange = _Word_DocRangeSet($oDoc, -1) ; Collapse the range to the start of the document _Word_DocPictureAdd($oDoc, @ScriptDir & "\QR.jpg", True, True, $oRange) $oRange.Insertafter("Test") $oRange = _Word_DocRangeSet($oDoc, $oRange, Default, Default, -1) ; Collapse the range to the end of the range $oRange.InsertBreak($wdLineBreak) ; Insert a line break $oRange = _Word_DocRangeSet($oDoc, $oRange, $WdCell, 1) ; Move the range one cell to the right _Word_DocPictureAdd($oDoc, @ScriptDir & "\QR1.jpg", True, True, $oRange) $oRange.Insertafter("Test1") $oRange = _Word_DocRangeSet($oDoc, $oRange, Default, Default, -1) ; Collapse the range to the end of the range $oRange.InsertBreak($wdLineBreak) ; Insert a line break $oRange = _Word_DocRangeSet($oDoc, $oRange, $WdCell, 1) ; Move the range one cell to the right _Word_DocPictureAdd($oDoc, @ScriptDir & "\QR1.jpg", True, True, $oRange) $oRange.Insertafter("Test1") $oRange = _Word_DocRangeSet($oDoc, $oRange, Default, Default, -1) ; Collapse the range to the end of the range $oRange.InsertBreak($wdLineBreak) ; Insert a line break
    1 point
  7. I'm not retyping that, If you need help with string operations post strings. If you need help with picture operations, post pictures.
    1 point
  8. water

    Script Help

    Dog ate your help file? You need at least 5 parameters: RunAs ( "username", "domain", "password", logon_flag, "program" [, "workingdir" [, show_flag [, opt_flag]]] )
    1 point
  9. In reference to the 2 scripts posted in this thread so far, neither one of them will actually reduce memory usage of your script. What both of them do is to take the memory that your program is using and dumping it to disk in the page file. In other words, it will reduce the RAM being used, but the data that was in the RAM is now in your page file, and being disk based it will make your program run much slower if if needs any of that information that on the disk. It's a band-aid on a bullet wound, you should try and fix any memory issues with your script before you resort to ruining its performance this way. In Windows XP memory management was terrible, so this type of script had limited usage. In today's modern OSs this is totally unnecessary because Windows handles the memory management and your scripts shouldn't try to do it. Microsoft is a lot smarter about memory management than you or I. Memory is usually plentiful, and much faster than disks, leave the data there and let Windows decide when it should page it out.
    1 point
  10. You can not pin programs that are on networked drives, UNC paths, or on removable storage to the taskbar. Just about the ONLY way to do it is to pin some other random program to the taskbar and then modify the shortcut to point to the networked location. It would be stupid to pin a program on removable storage to the taskbar, because if the drive isn't there, there's no program to run. Or if the drive letter changes it also won't run.
    1 point
  11. https://www.autoitscript.com/autoit3/docs/functions/WinActivate.htm build it in steps First make sure you have the window itself ; Wait 10 seconds for the window to appear. Local $hWnd = WinWait("[REGEXPTITLE:.*Registration Confirmation Screen.*]", "", 10) ; Activate the window using the handle returned by WinWait. WinActivate($hWnd) WinMove($hWnd, "", 10, 10)and then just iterate over all children As AU3Inf is seeing them properly it should be possible with the standard functions. If not you could give a try to IUIAutomation in Examples section
    1 point
  12. does the class and instance change if you hold it over different texts? it could also be HTML inside a window, i have seen some software with that in the past, so what out for that too
    1 point
  13. What is the title of your window? There seems to be some characters before the "/"-character. Have you tried to identify the window with the last part of the title ("Registration Confirmation Screen")? Or directly with the window handle?
    1 point
  14. did you try $sText = WinGetText("Admission/Registration Confirmation Screen") ?
    1 point
  15. IniRead() anyone? #cs [FileVersion] #ce #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Fileversion=1.0.0.2 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** MsgBox(0, "Version:", _GetVersion()) Func _GetVersion() If @Compiled Then Return FileGetVersion(@AutoItExe) Else Return IniRead(@ScriptFullPath, "FileVersion", "#AutoIt3Wrapper_Res_Fileversion", "0.0.0.0") EndIf EndFunc
    1 point
×
×
  • Create New...