Problème FastFind
Re, apres plusieurs jours de codage et de "démerdage" je n'arrive toujours pas a faire fonctionner mon code a cause de FastFind que je n'arrive pas a utiliser correctement.
Voici mon code :
#include "FastFind.au3" ; Wrapper to FastFind.dll, for lightning-fast pixel searches.
Global const $FFNB_CHANVRE_COLORS=31
Global const $gFFChanvreColors[$FFNB_CHANVRE_COLORS]=[0xACB525, 0x7D8119, 0x888F1E, 0x7F9912, 0x80841A, 0xAFB826, 0x7D9511, 0x829E12, 0x687C04, 0x7B7F19, 0xA2A822, 0x3F4D02, 0x758B0F, 0x7D9611, 0x7E9811, 0x697F04, 0x516303, 0x3B4802, 0xABB424, 0x7B9210, 0x84A213, 0xAFBA27, 0x89911E, 0xB0BB27, 0x85A313, 0x878F1E, 0x435302, 0xADB726, 0xA8B124, 0x83A113, 0xA4AB22]
global $gFFPos[2] = [0,0]; Last known position, default start for next search
global $gFFWin[4] = [0, 0, 0, 0]; Borders of default (or last) Window
Func FFFindNext($SearchPos=$gFFPos)
;In a 10x10 spot, we're first looking for the nearest spot with at least 4 pure color pixels.
;If none, then we're looking for a spot with as much as possible pure color pixels
;If still none found, then we're looking for a spot with as much as possible pixels using ShadeVariation of 2
;You can adapt those parameters as needed
local $Res = FFBestSpot(10, 1, 4, $SearchPos[0], $SearchPos[1], -1, 2, true, $gFFWin[0], $gFFWin[1], $gFFWin[2], $gFFWin[3])
If IsArray($Res) Then
$gFFPos[0] = $Res[0]
$gFFPos[1] = $Res[1]
FFAddExcludedArea($Res[0]-5, $Res[1]-5, $Res[0]+5, $Res[1]+5); This will avoid to detect same spot again later
return $Res
Else
SetError(1)
return False
EndIf
EndFunc
Func FFStart($ColorList, $SearchPos=$gFFPos, $WinLimits=$gFFWin, $hWnd=-1) ; Set all settings to start search on a new list of colors
FFResetExcludedAreas() ; New color list => we reset the restriction rectangles list
FFResetColors() ; Start with an empty list of colors
FFAddColor($ColorList)
return FFFindNext()
EndFunc
Func _Ceuillette()
global $MyWindowHandle = WinGetHandle("Oxydess")
FFSetWnd($MyWindowHandle, True)
for $FFCat = 0 to 0
Switch $FFCat
Case 0
local $SearchResult = FFStart($gFFChanvreColors)
EndSwitch
while (@Error = 0)
MouseClick("left",$SearchResult[0],$SearchResult[1]); Do here what you want once you find a good Spot. // On click sur la ressource
sleep(2100); Position (center of spot) is in (x:$SearchResult[0], y:$SearchResult[1]) // On attends la récolte
_Combat(); $SearchResult[2] gives the number of good pixels found in 10x10 spot (1 min, or closest spot with at least 20) // On verifie si on entre pas en cbt
_FullPods() ; On vérifie que l'on est pas full pods
$SearchResult = FFFindNext() ; Looks for the next spot
Wend
Next
EndFunc
Le problème vient de la fonction _Ceuillette() quand on a trouver un "good spot', une ressource en faite, et bien rien de ne se passe il ne click pas et il y a d'étrange petit symbole qui apparaissent tout autours du curseur de la souris.
J'ai donc besoin de votre aide pour résoudre ce problème, por favor !