Image search with variable file path

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Spent
Posts: 4
Joined: 03 May 2018, 12:25

Image search with variable file path

03 May 2018, 15:53

Hi All,

This is my first AHK script and I'm trying to make this code usable among multiple users. I'm having trouble with the use of a variable file path. It's giving me a "Call to non-existant function" error. I've tried several variations and all error in the same way.

Code: Select all


EnvGet, UserProfile, UserProfile

WinActivate, 430 - San Diego OE ahk_class SunAwtFrame
Sleep, 333
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, %USERPROFILE%\Dropbox\MacroCreator\Screenshots\Screen_20180502120145.png
CenterImgSrchCoords(%USERPROFILE% . "\Dropbox\MacroCreator\Screenshots\Screen_20180502120145.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Image search with variable file path

03 May 2018, 16:20

CenterImgSrchCoords(path, x, y) is not defined anywhere in the script youve shown, and judging by the error message it isnt defined in the script you havent shown either
User avatar
tidbit
Posts: 1273
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Image search with variable file path

03 May 2018, 16:28

and incase it is defined and you just didn't copy it all for us...
CenterImgSrchCoords(%USERPROFILE% . "\Dropbox\MacroCreator\Screenshots\Screen_20180502120145.png", FoundX, FoundY)
needs to be:
CenterImgSrchCoords(USERPROFILE . "\Dropbox\MacroCreator\Screenshots\Screen_20180502120145.png", FoundX, FoundY)

(remove the %'s)

also, you could probably just use A_UserName instead of envget
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
Spent
Posts: 4
Joined: 03 May 2018, 12:25

Re: Image search with variable file path

03 May 2018, 16:35

Full working code without the variable file path.

Code: Select all


WinActivate, 430 - San Diego OE ahk_class SunAwtFrame
Sleep, 333
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502120145.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502120145.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Click, 994, 246 Left, 1
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}{Tab}
Sleep, 10
SendRaw, ATTEMPT
Sleep, 10
Send, {LShift Down}
Sleep, 10
Send, {Home}
Sleep, 10
Sleep, 10
Send, {LShift Up}
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 10
Send, {F7}
Sleep, 10
Send, {F7}
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 10
Send, {Tab}
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {Tab}
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 500
Send, {Enter}
Sleep, 500
Send, {Tab 5}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {Tab 5}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 10
Send, {Tab 2}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {Tab 2}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 10
Send, {Tab 6}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {Tab 6}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 10
Send, {Tab 7}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {Tab 7}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 10
Send, {F7}
Sleep, 10
Send, {F7}
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 10
Send, {Tab}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {Tab}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 10
Send, {Tab 2}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 300
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {Tab 2}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502110518.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 10
Send, {Tab 3}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {c}
Sleep, 10
Send, {LControl Up}
Sleep, 400
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1600, 900, C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png
CenterImgSrchCoords("C:\Users\Michael\Downloads\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180502111654.png", FoundX, FoundY)
If ErrorLevel = 0
	Click, %FoundX%, %FoundY% Left, 1
If ErrorLevel
{
    MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue.
    IfMsgBox, Cancel
    	Return
}
If ErrorLevel = 0
{
}
Sleep, 300
Send, {Tab 3}
Sleep, 10
Sleep, 10
Send, {LControl Down}
Sleep, 10
Send, {v}
Sleep, 10
Send, {LControl Up}
Sleep, 10


Spent
Posts: 4
Joined: 03 May 2018, 12:25

Re: Image search with variable file path

03 May 2018, 16:49

I just tried removing the %'s and still got the same error.
tidbit wrote:and incase it is defined and you just didn't copy it all for us...
CenterImgSrchCoords(%USERPROFILE% . "\Dropbox\MacroCreator\Screenshots\Screen_20180502120145.png", FoundX, FoundY)
needs to be:
CenterImgSrchCoords(USERPROFILE . "\Dropbox\MacroCreator\Screenshots\Screen_20180502120145.png", FoundX, FoundY)

(remove the %'s)

also, you could probably just use A_UserName instead of envget
Spent
Posts: 4
Joined: 03 May 2018, 12:25

Re: Image search with variable file path

03 May 2018, 17:02

swagfag wrote:CenterImgSrchCoords(path, x, y) is not defined anywhere in the script youve shown, and judging by the error message it isnt defined in the script you havent shown either
Sorry for the newb question...How should I go about defining it?
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: Image search with variable file path

03 May 2018, 17:43

Spent wrote:Sorry for the newb question...How should I go about defining it?
Basically, you are trying to use a function that doesn't exist - neither natively in AHK and in your script scope.

This is how you define functions:

Code: Select all

YourFunctionName(coma, separated, arguments)
{
	; function's code goes here
}
But you would have known this, so I'm guessing you copy-pasted this from somewhere and all we can do is play guess-game what it does. Sounds like it's function build around ImageSearch, so start there.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Image search with variable file path

03 May 2018, 19:17

It seems to me as though this script has been generated by a program of sorts. We don't know what the function body should contain. If you do, you can try implementing the missing functionality yourself, presumably something to do with centering the image search coordinates. If you don't know what the function is supposed to do or it isn't relevant\critical to the operation of your script you may opt to simply not use it, comment it out or delete it.
poetbox
Posts: 112
Joined: 18 Apr 2018, 20:47

Re: Image search with variable file path

04 May 2018, 05:40

If you know what's the meaning of "CenterImgSrchCoords()",pls tell us to help you further.If you don't know,you can delete all the lines which contain "CenterImgSrchCoords" to test the code.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Leli196, NinjoOnline and 319 guests