La función esta basada en la que escribio Duned@i en cuanto a su funcionamiento.
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.8.1
Author: Naker90
Script Function:
Hace la misma función que un Sleep() pero en segundos
Ejemplo de uso:
Delay_Seconds(10)
Msgbox(64, '', 'Delay de 10 segundos')
#ce ----------------------------------------------------------------------------
Func Delay_Seconds($Segundos)
Local $SYSTEMTIME = 'WORD wYear;' & _
'WORD wMonth;' & _
'WORD wDayOfWeek;' & _
'WORD wDay;' & _
'WORD wHour;' & _
'WORD wMinute;' & _
'WORD wSecond;' & _
'WORD wMilliseconds'
Local $Struct = DllStructCreate($SYSTEMTIME)
DllCall('Kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($Struct))
Local $Delay = DllStructGetData($Struct, 'wSecond') + $Segundos
Do
DllCall('Kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($Struct))
Local $Time = DllStructGetData($Struct, 'wSecond')
Until $Time >= $Delay
EndFunc
Saludos