dp-s_doc/CallBack/Timer_Dispatch/Timer_Dispatch.md

42 lines
691 B
Markdown
Raw Permalink Normal View History

2025-03-23 18:51:55 +08:00
# Timer_Dispatch 回调函数文档
**回调说明**
`Timer_Dispatch`类用于在服务端中持续执行的HOOK。
---
**注册方法**
- `Cb_timer_dispatch_Func.rawset(Key,Function)`
**例子**
```squirrel
function Test_Function()
{
print(Clock());
}
Cb_timer_dispatch_Func.rawset("Test", Test_Function);
```
or
```squirrel
function Test_Function()
{
print(Clock());
}
Cb_timer_dispatch_Func.Test <- Test_Function;
```
or
```squirrel
function Test_Function()
{
print(Clock());
}
Cb_timer_dispatch_Func["Test"] <- Test_Function;
```
or
```squirrel
Cb_timer_dispatch_Func.Test <- function ()
{
print(Clock());
};
```