Make sure the hover_i function gets the update as well

This commit is contained in:
Bradlee Speice 2012-07-24 16:20:43 -04:00
parent 4769d51e21
commit 0cb20fd48f

View File

@ -334,41 +334,53 @@ hover_i ()
out "hover_i: $@" out "hover_i: $@"
for x in $@ if [ -n "$USE_CENTER" ]; then
do center="c"
if [ -n "$USE_CENTER" ]; then else
center="c" center=""
else fi
center="" if [ -n "$USE_SANE_TOLERANCE" ]; then
fi TOLERANCE_OPTION="-o"
if [ -n "$USE_SANE_TOLERANCE" ]; then else
TOLERANCE_OPTION="-o" TOLERANCE_OPTION="-t"
else fi
TOLERANCE_OPTION="-t"
fi
if [ -n "$USE_WAIT" ]; then if [ -n "$USE_WAIT" ]; then
eval "$CVAINPUT $TOLERANCE_OPTION $TOLERANCE --search-method $SEARCH_METHOD --timeout $TIMEOUT -s 'waitfor $x' >> $OUTFILE" #Alternate between each image until a match is found, or we loop $TIMEOUT times
CVA_RETURN=$? #This is a bit weird, since we need to lower the TIMEOUT value for the "waitfor"
#function, and then restore it at the end.
OLD_TIMEOUT=$TIMEOUT
TIMEOUT=1
if [ $CVA_RETURN -lt $RETURN_CODE ]; then for loop in {1..$OLD_TIMEOUT}
RETURN_CODE=$CVA_RETURN do
fi
if [ $CVA_RETURN -eq 0 ]; then for x in $@
#We found the image, click it do
eval "$CVAINPUT $TOLERANCE_OPTION $TOLERANCE --search-method $SEARCH_METHOD -s '${center}mouseimage $x' >> $OUTFILE" waitfor "$x"
fi CVA_RETURN=$?
else
eval "$CVAINPUT $TOLERANCE_OPTION $TOLERANCE --search-method $SEARCH_METHOD -s '${center}mouseimage $x' >> $OUTFILE"
CVA_RETURN=$?
if [ $CVA_RETURN -lt $RETURN_CODE ]; then if [ $CVA_RETURN -lt $RETURN_CODE ]; then
RETURN_CODE=$CVA_RETURN RETURN_CODE=$CVA_RETURN
fi fi
if [ $CVA_RETURN -eq 0 ]; then
#We found the image, click it
eval "$CVAINPUT $TOLERANCE_OPTION $TOLERANCE --search-method $SEARCH_METHOD -s '${center}mouseimage $x' >> $OUTFILE"
TIMEOUT=$OLD_TIMEOUT
return $?
fi
done
done
else
eval "$CVAINPUT $TOLERANCE_OPTION $TOLERANCE --search-method $SEARCH_METHOD -s '${center}mouseimage $x' >> $OUTFILE"
CVA_RETURN=$?
if [ $CVA_RETURN -lt $RETURN_CODE ]; then
RETURN_CODE=$CVA_RETURN
fi fi
fi
done
return $RETURN_CODE return $RETURN_CODE
} # ---------- end of function hover_i ---------- } # ---------- end of function hover_i ----------