-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtimer.lua
More file actions
82 lines (70 loc) · 4.71 KB
/
timer.lua
File metadata and controls
82 lines (70 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
--[[
Script by Tobias00723 ████████
from the TGFB server ████████ ████████
Discord : https://discord.gg/hEHd4A3czx ██████ ██████
any questions? ^^ ████ ▒ ▒ █████
find me on my discord server ^^ ████ ▒▒ ▒▒▒ ███
_________________________________ ████ ▒▒▒ ▒▒▒ ███
███ ▒▒▒▒ ▒▒▒▒ ███
██ ▒▒▒▒ ▒▒▒▒▒ ███
███ ▒▒▒▒▒▒ ▒▒▒▒▒▒ ███
Script as is. ███ ▓▒▒▒▒▒▒ ▒▒▒▒▒▒▒ ███
███ ▒▒▒▒▒▒▒▒ ▓▒▒▒▒▒▒▓ ███
Enjoy The open sauce! ███ ▓▒▒▓▒▒▓▒▓ ▒▒▓▒▒▒▒▒ ███
███ ▓▒▓▓▒▓▓▒▓ ▓▓▒▓▓▓▓▓▓ ███
If used credit, is appreaciated. █ ▓▓▓▒▓ ▓▓▓▒ ▓▓▓▓ ▒▓▒▓▓ █
Happy "borrowing" :) ▓▓▓▓ ▓▓▓ ████ ▓▓▓ ▓▓▓▓
_________________________________ ▓▓▓ ▓▓ ▓▓▓▓ ▓▓ ▓▓▓
▓▓ ▓▓ ▓▓▓▓ ▓▓ ▓▓
▓▓ ▓ ▓▓▓▓ ▓ ▓▓
Copyright (c) 2025 TGFB ▓▓▓▓
All rights reserved. ▓▓▓▓
]]
do
---@meta
--classes
do
end
---The timer singleton has two important uses. 1. Return the mission time. 2. To schedule functions.
---https://wiki.hoggitworld.com/view/DCS_singleton_timer
---@class timer
timer = {}
--Functions
do
---Returns the mission time in seconds. It is relative compared to the mission start time. The default mission start time in the mission editor is Day 1: 12:00:00. In seconds this value is: 43200
---https://wiki.hoggitworld.com/view/DCS_func_getAbsTime
---@return number time
function timer.getAbsTime() end
--No Docu
---Seems to always returns false
---@return boolean
function timer.getPause() end
---Returns the model time in seconds to 3 decimal places. This counts time once the simulator loads. So if a mission is paused, the time this function returns still moves forward.
---https://wiki.hoggitworld.com/view/DCS_func_getTime
---@return number time
function timer.getTime() end
---Returns the mission start time in seconds. Can be used with timer.getAbsTime() to see how much time has passed in the mission.
---https://wiki.hoggitworld.com/view/DCS_func_getTime0
---@return number time
function timer.getTime0() end
---Removes a scheduled function as defined by the functionId from executing. Essentially will "destroy" the function.
---https://wiki.hoggitworld.com/view/DCS_func_removeFunction
---@return function
---@param functionId number
function timer.removeFunction( functionId ) end
---Schedules a function to run at a time in the future. This is a very powerful function. The function that is called is expected to return nil or a number which will indicate the next time the function will be rescheduled. Use the second argument in that function to retrieve the current time and add the desired amount of delay (expressed in seconds).
---https://wiki.hoggitworld.com/view/DCS_func_scheduleFunction
---@generic ARG
---@return number functionId
---@param anyFunctionArguement ARG functionArgs
---@param functionToCall fun(ARG?:ARG, time?:number):number?
---@param modelTime number time
function timer.scheduleFunction( functionToCall, anyFunctionArguement, modelTime ) end
---Re-Schedules an already scheduled function to run at a different time in the future.
---https://wiki.hoggitworld.com/view/DCS_func_setFunctionTime
---@return function
---@param functionId number
---@param modelTime number
function timer.setFunctionTime( functionId, modelTime ) end
end
end