CLEO Help How to get current time

CLEO related
Status
Not open for further replies.

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
@monday
@springfield
@supahdupahnubah

How to get current time of my pc with cleo?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,126
Solutions
1
Reaction score
157
http://ugbase.eu/Thread-SNIPPET-Date-and-time
http://ugbase.eu/Thread-Tutorial-Using-functions-from-Windows-libraries

For measuring time difference it would be better to use "GetTickCount" function:

Code:
//0AB1: call_scm_func @GetTickCount 0 _returnedTickCount 31@
:GetTickCount
0AA2: 2@ = load_library "kernel32.dll" // IF and SET
31@ = 0
    if 0AA4: 3@ = get_proc_address "GetTickCount" library 2@ // http://www.geoffchappell.com/studies/windows/win32/kernel32/api/index.htm   https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx
    then    
    0AA7: call_function 3@ num_params 0 pop 0 31@    
    end
0AA3: free_library 2@
0AB2: ret 1 31@
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
monday said:
http://ugbase.eu/Thread-SNIPPET-Date-and-time
http://ugbase.eu/Thread-Tutorial-Using-functions-from-Windows-libraries

For measuring time difference it would be better to use "GetTickCount" function:

Code:
//0AB1: call_scm_func @GetTickCount 0 _returnedTickCount 31@
:GetTickCount
0AA2: 2@ = load_library "kernel32.dll" // IF and SET
31@ = 0
    if 0AA4: 3@ = get_proc_address "GetTickCount" library 2@ // http://www.geoffchappell.com/studies/windows/win32/kernel32/api/index.htm   https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx
    then    
    0AA7: call_function 3@ num_params 0 pop 0 31@    
    end
0AA3: free_library 2@
0AB2: ret 1 31@
Thank you
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
0xB7CB84 [DWORD] - internal tick counter
Reading this address will be way faster, only cons that it doesn't refresh when your game is paused\alttabed
Nothing bad with it, it will update current tick when you unpause the game, still good for creating timers and shit
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
supahdupahnubah said:
0xB7CB84 [DWORD] - internal tick counter
Reading this address will be way faster, only cons that it doesn't refresh when your game is paused\alttabed
Nothing bad with it, it will update current tick when you unpause the game, still good for creating timers and shit

I just want to force my script work after 1am for example
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Malchik said:
supahdupahnubah said:
0xB7CB84 [DWORD] - internal tick counter
Reading this address will be way faster, only cons that it doesn't refresh when your game is paused\alttabed
Nothing bad with it, it will update current tick when you unpause the game, still good for creating timers and shit

I just want to force my script work after 1am for example

Yea then you can use monday's snippet, since it is more precise
This address is good when you do something fast in loop, especially when it affects something that is binded to this counter, animation time for example, or fire time
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
supahdupahnubah said:
Malchik said:
supahdupahnubah said:
0xB7CB84 [DWORD] - internal tick counter
Reading this address will be way faster, only cons that it doesn't refresh when your game is paused\alttabed
Nothing bad with it, it will update current tick when you unpause the game, still good for creating timers and shit

I just want to force my script work after 1am for example

Yea then you can use monday's snippet, since it is more precise
This address is good when you do something fast in loop, especially when it affects something that is binded to this counter, animation time for example, or fire time
good to know, grats bro
 
Status
Not open for further replies.
Top