This is the working code below, a local variable is set up and then called with the percent sign notation
Code: Select all
Class shipTargetingAdmin
{
targetURL := "UNINITIATED"
...
searchSector(xIndex, yIndex)
{
temporaryURL := this.targetURL
ImageSearch, FoundX, FoundY, xIndex * A_ScreenWidth / 5, yIndex * A_ScreenHeight / 5, (xIndex+1) * A_ScreenWidth / 5, (yIndex+1) * A_ScreenHeight / 5, *10 *Trans2dff3c %temporaryURL%
...
...
...
}
}
I've tried every variation I can think of, but they either result in various warnings and errors
Code: Select all
Class shipTargetingAdmin
{
targetURL := "UNINITIATED"
...
searchSector(xIndex, yIndex)
{
ImageSearch, FoundX, FoundY, xIndex * A_ScreenWidth / 5, yIndex * A_ScreenHeight / 5, (xIndex+1) * A_ScreenWidth / 5, (yIndex+1) * A_ScreenHeight / 5, *10 *Trans2dff3c %this.targetURL%
...
...
...
}
}
The full code below, just in case it is relevant
Code: Select all
Class shipTargetingAdmin
{
targetURL := "UNINITIATED"
Array := [[2,2],[2,3],[3,2],[1,2],[3,3],[2,4],[4,2],[1,3],[3,1],[1,1],[2,0],[0,2],[4,3],[3,4],[1,4],[4,1],[3,0],[0,3],[1,0],[0,1],[4,4],[4,0],[0,4],[0,0]]
locateTarget()
{
For i, quadrant in this.Array
{
coordinates := this.searchSector(quadrant.1, quadrant.2)
if (coordinates.1 != 0 & coordinates.2 != 0)
return coordinates
}
}
searchSector(xIndex, yIndex)
{
temporaryURL := this.targetURL
ImageSearch, FoundX, FoundY, xIndex * A_ScreenWidth / 5, yIndex * A_ScreenHeight / 5, (xIndex+1) * A_ScreenWidth / 5, (yIndex+1) * A_ScreenHeight / 5, *10 *Trans2dff3c %temporaryURL%
;PixelSearch, FoundX, FoundY, xIndex * A_ScreenWidth / 5, yIndex * A_ScreenHeight / 5, (xIndex+1) * A_ScreenWidth / 5, (yIndex+1) * A_ScreenHeight / 5, 0x792c2c, 10, RGB Fast
if (ErrorLevel = 2)
MsgBox Could not conduct the search in targeting system.
else if (ErrorLevel = 0)
{
return [FoundX, FoundY]
}
else
{
return [0, 0]
}
}
SetTargetURL(inputURL)
{
this.targetURL := inputURL
}
GetTargetURL()
{
return this.targetURL
}
}