Jump to content

[Solved]Can autoit supply a mac like @msec ?


Recommended Posts

@SEC

Seconds value of clock. Range is 00 to 59

@MIN

Minutes value of clock. Range is 00 to 59

@HOUR

Hours value of clock in 24-hour format. Range is 00 to 23

@MDAY

Current day of month. Range is 01 to 31

@MON

Current month. Range is 01 to 12

@YEAR

Current four-digit year

@WDAY

Numeric day of week. Range is 1 to 7 which corresponds to Sunday through Saturday.

@YDAY

Current day of year. Range is 1 to 366 (or 365 if not a leap year)

Sorry to post here 'cause I have no permission post new topic in the correct place.

I need a more smaller mac for time*:D*

Thank you.Cheers!

Edited by kuhasu
Link to comment
Share on other sites

_Now won't give milliseconds.

#include <GuiConstantsEx.au3>
#include <Date.au3>

Global $iMemo

_Main()

Func _Main()
    Local $hGUI, $tTime, $aTime

     ; Create GUI
    $hGUI = GUICreate("Time", 400, 300)
    $iMemo = GUICtrlCreateEdit("",  2,  2,  396,  296,  $WS_VSCROLL)
    GUICtrlSetFont($iMemo, 9,  400,  0,  "Courier New")
    GUISetState()

    ; Get current  system time
    $tTime = _Date_Time_GetSystemTime()
    $aTime = _Date_Time_SystemTimeToArray($tTime)
    MemoWrite("Month  ........: " & $aTime[0])
     MemoWrite("Day ..........:  " &  $aTime[1])
     MemoWrite("Year .........:  " &  $aTime[2])
     MemoWrite("Hour .........:  " &  $aTime[3])
     MemoWrite("Minute .......:  " &  $aTime[4])
     MemoWrite("Second .......:  " &  $aTime[5])
     MemoWrite("Milliseconds .:  " &  $aTime[6])
     MemoWrite("Day of week ..:  " &  $aTime[7])

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    
EndFunc   ;==>_Main

; Write a line to the memo  control
Func  MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite
Link to comment
Share on other sites

Hi,

While 1
    ToolTip(@Hour & ':' & @Min & ':' & @Sec & ':' & _MSec())
    Sleep(1)
WEnd
Exit

Func _MSec()
    Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
    DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))
    $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8))
    $stSystemTime = 0
    Return $sMilliSeconds
EndFunc

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Thank you !U guys Bull!

here's my modified code

Thank you!here's my code modified,any suggestions?

#include <ScreenCapture.au3>
#include <Date.au3>
Opt('MustDeclareVars', 1)


_Main('渤海证券网上交易V6.05')

Func _Main(Const $title)
Local $tTime, $aTime ,$bTime, $time

$tTime = _Date_Time_GetSystemTime()
$aTime = _Date_Time_SystemTimeToArray($tTime)
$bTime = $aTime[6]
$time=@Hour & " h " & @MIN & " m " & @SEC & " Sec " & $bTime
    
    
    WinActivate($title)
    _ScreenCapture_CaptureWnd("x:\orc\" & $time & ".jpg", WinGetHandle(WinGetTitle($title)), 313, 124, 371, 141)
EndFunc ;==>_Main
Link to comment
Share on other sites

Really Amazing!

I just got 20000 pics in 56min 21sec!

BTW,can au3 file be ran in cmd directly?like "x:\autoit.au3"

Thank you

sure why not... just test it next time :D

as long as you are in windows the assoc command in CMD has a listing for .au3=autoit.exe

of course this is assuming you have it set to run on open

[sup]Psibernetic[/sup]My Creations:X-HideSecuracy

Link to comment
Share on other sites

I can capture and save 6 pics/sec now!

If you need the best speed then try this one speed optimized version based on Xenobiologist's code:

#include <ScreenCapture.au3>

$stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
$dll_kernel32 = DllOpen('kernel32.dll')
$hWnd = WinGetHandle('????????V6.05')

For $i = 1 To 100
    DllCall($dll_kernel32 , 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))
    
    $time=@Hour & " h " & @MIN & " m " & @SEC & " Sec " & DllStructGetData($stSystemTime, 8)

    WinActivate($hWnd)
    _ScreenCapture_CaptureWnd("x:\orc\" & $time & ".jpg", $hWnd, 313, 124, 371, 141)
Next


$stSystemTime = 0
DllClose($dll_kernel32)
Edited by Zedna
Link to comment
Share on other sites

If you need the best speed then try this one speed optimized version based on Xenobiologist's code:

#include <ScreenCapture.au3>

$stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
$dll_kernel32 = DllOpen('kernel32.dll')
$hWnd = WinGetHandle('????????V6.05')

For $i = 1 To 100
    DllCall($dll_kernel32 , 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))
    
    $time=@Hour & " h " & @MIN & " m " & @SEC & " Sec " & DllStructGetData($stSystemTime, 8)

    WinActivate($hWnd)
    _ScreenCapture_CaptureWnd("x:\orc\" & $time & ".jpg", $hWnd, 313, 124, 371, 141)
Next


$stSystemTime = 0
DllClose($dll_kernel32)

Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...