-
Posts
19 -
Joined
-
Last visited
GeekyBunny's Achievements

Seeker (1/7)
0
Reputation
-
Yes, I find them pretty confusing D:
-
Hello forum. I was messing around with Auto It today, I just saw the example script of dll open, I tried to understand it but I can't, All those parameters and stuff, It would be nice if anyone can help me understand that.
-
Oh, okay, thanks for your time. I found something known as ImageSearch in the Internet. #include-once ; ------------------------------------------------------------------------------ ; ; AutoIt Version: 3.0 ; Language: English ; Description: Functions that assist with Image Search ; Require that the ImageSearchDLL.dll be loadable ; ; ------------------------------------------------------------------------------ ;=============================================================================== ; ; 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 ; ; Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify ; a desktop region to search ; ;=============================================================================== Func _ImageSearch($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance) return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance) EndFunc Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance) ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage $result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage) ; If error exit if $result[0]="0" then return 0 ; Otherwise get the x,y location of the match and the size of the image to ; compute the centre of search $array = StringSplit($result[0],"|") $x=Int(Number($array[2])) $y=Int(Number($array[3])) if $resultPosition=1 then $x=$x + Int(Number($array[4])/2) $y=$y + Int(Number($array[5])/2) endif return 1 EndFunc ;=============================================================================== ; ; Description: Wait for a specified number of seconds for an image to appear ; ; Syntax: _WaitForImageSearch, _WaitForImagesSearch ; Parameter(s): ; $waitSecs - seconds to try and find the image ; $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 ; ; ;=============================================================================== Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs sleep(100) $result=_ImageSearch($findImage,$resultPosition,$x, $y,$tolerance) if $result > 0 Then return 1 EndIf WEnd return 0 EndFunc ;=============================================================================== ; ; Description: Wait for a specified number of seconds for any of a set of ; images to appear ; ; Syntax: _WaitForImagesSearch ; Parameter(s): ; $waitSecs - seconds to try and find the image ; $findImage - the ARRAY of images to locate on the desktop ; - ARRAY[0] is set to the number of images to loop through ; ARRAY[1] is the first image ; $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 the index of the successful find ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImagesSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs for $i = 1 to $findImage[0] sleep(100) $result=_ImageSearch($findImage[$i],$resultPosition,$x, $y,$tolerance) if $result > 0 Then return $i EndIf Next WEnd return 0 EndFunc I just don't get the syntax. If you can explain this to me, I would be really thankful
-
Hello! I was just checking around the help file trying to find an imagesearch type of command, but i didun' find it, Does auto IT have such a command?
-
Question and PixelSearch
GeekyBunny replied to GeekyBunny's topic in AutoIt General Help and Support
Well, thanks a lot The tutorial seems pretty filled with examples, Thanks yet again. This solved my problem of the day xD -
Well, I've returned to AutoIt after trying out numerous other languages, I'm pretty much happier with this language then the rest >_> I was just wondering two things : #1. Is there any tutorial which is like Auto It for beginners, amateurs and experts? #2. How do i use PixelSearch to find a range of red, which would be around light red till dark red?
-
What's the website's name? You can try to navigate to this using run command o-o Run(<Whatever your thing's name is>)
-
Thank you, I found my answer, next time, i'll consult the help file first before coming here. xD
-
GeekyBunny reacted to a post in a topic: Pixel Locator
-
Well, i've heard that C#, C++ and other languages have a known function like Pixel Locator. Does Auto It have one as well?
-
Thank you very much! You guys are the best! :3 Now, i can post when i want without waiting till the morning but for now, All my problems are solved due to JLogan3o13's answer! But still thank you very much
-
GeekyBunny reacted to a post in a topic: Hotkeyset
-
(2nd last post ) I can define my function anywhere? Right? Even at the end of the script, right? o-o
-
Thank you guys very much! It might be a bother but you guys would be getting way more questions from me >_> But i am very thankful to you guys! And the helpful community
-
(I can make only 4 more posts) Erm, sorry for troubling you what i meant to say is that the i want a hotkeyset as an alternative for the button i press so that i keep hitting the hotkey instead of going back to the form1 and click the button. Like isn't there a way to give the button a hotkey so that whenever i press a certain key, say, "F5", it completes a certain function which i had written in the button.
-
As i said, "I'm new your help would be greatly appreciated Well, This is a program i am making for paint. I want it to click around 7 times whenever i press a special key. Plus, I want a hotkey set to $Button1. So that i don't have to press start everytime. Well, here is the code : #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 251, 245, 927, 209) $Button1 = GUICtrlCreateButton("Start", 24, 16, 75, 25) $Button2 = GUICtrlCreateButton("Instructions", 24, 64, 75, 25) $Button3 = GUICtrlCreateButton("Quit", 24, 104, 75, 25) $Label1 = GUICtrlCreateLabel("Made by GeekyBunny", 128, 96, 84, 81) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $Button1 <> 0 then MouseClick("Left") MouseWheel("Down") MouseClick("Left") MouseWheel("Down") MouseClick("Left") MouseWheel("Down") EndIf Case $Button2 MsgBox(0,"Instructions","Try") Case $Button3 Exit EndSwitch WEnd
-
Oh, sorry, I will try to be more descriptive next time But thank you for your help!