Jump to content

Nickolai

Members
  • Posts

    17
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Nickolai's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. #AutoIt3Wrapper_UseX64=y ; Set to Y or N depending on your situation/preference!! #include-once #include <WinAPIFiles.au3> ; for _WinAPI_Wow64EnableWow64FsRedirection #include <ScreenCapture.au3> ;_ScreenCapture_CaptureWnd etc. ;using this in the example to create a test image, otherwise not neccessary here #Region When running compiled script, Install needed DLLs if they don't exist yet If Not FileExists("ImageSearchDLLx32.dll") Then FileInstall("ImageSearchDLLx32.dll", "ImageSearchDLLx32.dll", 1);FileInstall ( "source", "dest" [, flag = 0] ) If Not FileExists("ImageSearchDLLx64.dll") Then FileInstall("ImageSearchDLLx64.dll", "ImageSearchDLLx64.dll", 1) If Not FileExists("msvcr110d.dll") Then FileInstall("msvcr110d.dll", "msvcr110d.dll", 1);Microsoft Visual C++ Redistributable dll x64 If Not FileExists("msvcr110.dll") Then FileInstall("msvcr110.dll", "msvcr110.dll", 1);Microsoft Visual C++ Redistributable dll x32 #EndRegion Local $h_ImageSearchDLL = -1; Will become Handle returned by DllOpen() that will be referenced in the _ImageSearchRegion() function #Region TESTING/Example Local $bTesting = false; Change to TRUE to turn on testing/example If $bTesting Then cr(">" & "_ImageSearchStartup()=" & _ImageSearchStartup(), 2) OnAutoItExitRegister(_ImageSearchShutdown) cr("!Testing...") ;using Notepad as a simple example #Region Notepad Snapshot Creation $hWin = WinGetHandle("[CLASS:Notepad]") If Not IsHWnd($hWin) Then If Run("notepad.exe") = 0 Then cr("Couldn't run notepad.exe") Local $hWin = WinWait("[CLASS:Notepad]", "", 10) If $hWin = 0 Then cr("Notepad WinWait Timeout!") EndIf WinSetState($hWin, "", @SW_RESTORE) WinSetState($hWin, "", @SW_SHOW) WinActivate($hWin) Local $testimage = "24bit.bmp" _ScreenCapture_CaptureWnd($testimage, $hWin, 0, 0, -1, -1, False);_ScreenCapture_CaptureWnd ( $sFileName, $hWnd [, $iLeft = 0 [, $iTop = 0 [, $iRight = -1 [, $iBottom = -1 [, $bCursor = True]]]]] ) cr("made Notepad Window screenshot") #EndRegion Notepad Snapshot Creation #Region Test if application appeared Local $y = 0, $x = 0, $result $result = _ImageSearch($testimage, 1, $x, $y, 0, 0);_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) If $result = 1 Then cr("! $result=" & $result, 1) MouseMove($x, $y, 0) cr("+" & "recognised notepad! moved mouse to center of notepad!") Else cr("! $result=" & $result, 1) Exit EndIf #EndRegion Test if application appeared part of the imagesearch2015.au3 script that creates the notepad.
  2. i renamed the empty notepad file to kick because my file is test.au3, if you download the file imagesearch2015.au3 it comes with all the dll files along with the empty notepad after you run it
  3. discord
  4. it's not for a game that's simply the image name.
  5. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ImageSearch2015.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 253, 138, 192, 124) GUISetBkColor(0x99B4D1) Global $Start = GUICtrlCreateButton("Start Program", 8, 8, 75, 25) Global $End = GUICtrlCreateButton("Exit", 8, 33, 73, 23) Global $Checkbox1 = GUICtrlCreateCheckbox("Spart", 88, 8, 97, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") Global $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 88, 40, 97, 17) Global $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 88, 72, 97, 17) Global $Checkbox4 = GUICtrlCreateCheckbox("Boxes", 88, 24, 97, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") Global $Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 88, 88, 97, 17) Global $Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 88, 56, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start CheckStart() Case $End Exit EndSwitch WEnd Func CheckStart() $x = 0 $y = 0 If GUICtrlRead($Checkbox1) = 1 Then $Search = _ImageSearch('kick.png', 0, $x, $y, 0) If $Search = 1 Then MouseMove($x, $y, 50) MouseClick("left") EndIf EndIf EndFunc Trying to figure out how to loop the func CheckStart() i've tried, the issue is i'm trying to get this code to check multiple checkboxes at once when you press "Start program" as well so i only want to loop one area then once that loop is complete i want it to move on to check another checkbox. Func CheckStart() $x = 0 $y = 0 Do until $Search = 0 ; Loop If GUICtrlRead($Checkbox1) = 1 Then $Search = _ImageSearch('kick.png', 0, $x, $y, 0) If $Search = 1 Then MouseMove($x, $y, 50) MouseClick("left") EndIf EndIf EndFunc
  6. I didn't say the .au3 was a dll file , but i figured it out thanks anyways.
  7. i can't find out how to call upon the .DLL file that is in the library i'm using ImageSearch.au3 and i have saved my new script in to the folder and tried #include <ImageSearch.au3> and nothing pops up for it to be called on, i've also tried adding it to the autoit .DLL file section. does anybody have experience in this?
  8. Do you add the .DLL files to the autoit script editors library to be able to call it in the script editor? because it's not popping up for me.
  9. i don't have a script written up for any program i deleted my old script because i was brainstorming this idea. was wondering if it was possible.
  10. looking for a way to click something when something's popped up, pixelsearch has been what i'm using but i'm looking to go a bit more advanced wondering if there's a way to maybe map the pop up? for instance if i had a pop up saying "OK" and "Close" i'd want it to click "Ok" but i don't want to use a pixel search or specific coordinates, would like the script to recognize the boxes as "Ok" and "Close" is that possible or am i reaching out of bounds?
  11. i don't understand how it doesn't make sense to you, If GUICtrlread($VIP) = 0 ( 0 = False ) then ... statement, are you confused about my variable?
  12. this fixed it thank you
  13. $Boxes is declared globally at the top? Global $Boxes = GUICtrlCreateCheckbox("Boxes", 100, 136, 97, 17) for the Else If statement, i can't have 2 statements, so how would i go about checking multiple scenarios at once? i need to check if VIP box is checked and Boxes is checked, along with another statement to check if VIP is not checked but boxes is checked.
  14. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\nick n rachael\desktop\simplegui.kxf $SimpleGUI = GUICreate("COS", 237, 165, -1, -1) GUISetBkColor(0x99B4D1) Global $Program = GUICtrlCreateButton("Run Program", 8, 8, 75, 25) GUICtrlSetBkColor(-1, 0xC8C8C8) GUICtrlSetCursor (-1, 0) Global $exit = GUICtrlCreateButton("exit", 8, 40, 75, 25) GUICtrlSetBkColor(-1, 0xC8C8C8) GUICtrlSetCursor (-1, 0) Global $VIP = GUICtrlCreateCheckbox("VIP > 5", 72, 136, 97, 17) Global $pxs = PixelSearch(1205, 870, 1221, 880, 0xFDF0B0, 20) Global $pxstwo = PixelSearch(1205, 866, 1221, 882, 0xF3CE97, 20) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Program checkboxes() Case $exit Exit EndSwitch WEnd Func checkboxes() if GUICtrlRead($VIP) = 1 and GUICtrlRead($Boxes) = 1 Then MsgBox(1,"test","test VIP",0) Else if GUICtrlRead($VIP) = 0 and GUICtrlRead ($Boxes) = 1 Then MouseMove($pxstwo[0],$pxstwo[1],25) MouseClick("left") EndIf EndIf EndFunc
×
×
  • Create New...