Giter VIP home page Giter VIP logo

Comments (6)

enterlet avatar enterlet commented on May 10, 2024

I found the same problem with you. It can temporarily solved by exporting to ahk file and removing "*64" in "CenterImgSrchCoords("*64 C:\CHB\image.png", FoundX, FoundY)"

from puloversmacrocreator.

nw2372 avatar nw2372 commented on May 10, 2024

This also happens when selecting a transparent color:
"CenterImgSrchCoords("*Trans0xFFFFFF C:\Users\David\AppData\Roaming\MacroCreator\Screenshots\Screen_20180108155624.png", FoundX, FoundY)"
It is not fixed in the current version.

from puloversmacrocreator.

 avatar commented on May 10, 2024

Yes, ton of bugs. I switch to Notepad already.
The code is wrong. Look when convert to AHK:

Macro1:
Loop
{
    CoordMode, Pixel, Window
    ImageSearch, FoundX, FoundY, 0, 0, 1920, 1080, *69 D:\download\PuloversMacroCreator-Portable\MacroCreatorPortable\x86\MacroCreator\Screenshots\Screen_20180812200820.png
    CenterImgSrchCoords("*69 D:\download\PuloversMacroCreator-Portable\MacroCreatorPortable\x86\MacroCreator\Screenshots\Screen_20180812200820.png", FoundX, FoundY)
}
Until ErrorLevel = 0
If ErrorLevel = 0
{
}
Return


CenterImgSrchCoords(File, ByRef CoordX, ByRef CoordY)
{
	static LoadedPic
	LastEL := ErrorLevel
	Gui, Pict:Add, Pic, vLoadedPic, %File%
	GuiControlGet, LoadedPic, Pict:Pos
	Gui, Pict:Destroy
	CoordX += LoadedPicW // 2
	CoordY += LoadedPicH // 2
	ErrorLevel := LastEL
}


from puloversmacrocreator.

 avatar commented on May 10, 2024

Create my own function:

ImageSearchMouseCenter(ByRef xMouse, ByRef yMouse, File)
{
	LastErrorLevel := ErrorLevel

	static LoadedPic
	Gui -DPIScale
	Gui, Add, Picture, vLoadedPic, %File%
	GuiControlGet, LoadedPic, Pos
	Gui, Destroy
	xMouse += LoadedPicW // 2
	yMouse += LoadedPicH // 2

	ErrorLevel := LastErrorLevel
}

and use as

        Loop
        {
            CoordMode, Pixel, Window
            ImageSearch, x, y, 0, 0, 1920, 1080, *120 Sail_Img_1.png
            ImageSearchMouseCenter(x, y, "Sail_Img_1.png")
            Sleep, 200
        }
        Until ErrorLevel = 0
        If ErrorLevel = 0
        {
            MsgBox, %x% %y%
        }

return

from puloversmacrocreator.

Pulover avatar Pulover commented on May 10, 2024

ImageSearch options are prefixed to the file name in this command I forgot to trim them. Will be fixed in the next release.

from puloversmacrocreator.

Pulover avatar Pulover commented on May 10, 2024

Fixed in v5.1.2.

from puloversmacrocreator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.