meta data for this page
  •  

📚 差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
scripting:native:core [2025/08/27 14:48] bibiboxsscripting:native:core [2025/12/04 11:33] (当前版本) bibiboxs
行 188: 行 188:
 function QuitGame() function QuitGame()
 ``` ```
 +
 +
 +
 +### SetDisconnectMethod()
 +
 +> 设置断开连接监听处理方法,允许设置为`null`。
 +>
 +> 此功能允许根据断开原因选择处理方式(断开、重连、关闭模组)。
 +
 +```javascript
 +function SetDisconnectMethod( (output: string ): int => {} )
 +```
 +```javascript
 +SetDisconnectMethod((output) => {
 +    if(output.indexOf("Error") >= 0)
 +    {
 +        //Unload Mod
 +        return 2;
 +    }
 +});
 +```
 +
 +| Method | 说明         |
 +| ------ | ------------ |
 +| 0      | 默认         |
 +| 1      | 重新连接     |
 +| 2      | 关闭运行模组 |
  
  
行 266: 行 293:
  
 ```javascript ```javascript
-function Env.LoadScript( path: string )+function Env.LoadScript( path: string, IIFE: bool = false)
 ``` ```
  
 - `path`脚本目录下的 同级或子级 脚本文件路径(例如:`Test/MyCode.js`) - `path`脚本目录下的 同级或子级 脚本文件路径(例如:`Test/MyCode.js`)
 +- `IIFE`是否为独立作用域,否则默认脚本续写加载
  
 ```javascript ```javascript
行 275: 行 303:
 LoadScript("Test/MyCode.js"); //√ LoadScript("Test/MyCode.js"); //√
 LoadScript("Test/MyCode"); //√ LoadScript("Test/MyCode"); //√
-LoadScript("MyCode.js"); //√ 正确+LoadScript("MyCode.js"); //√
 LoadScript("../MyCode.js"); //× LoadScript("../MyCode.js"); //×
  
行 1025: 行 1053:
 RemoveVectorPoint("HomePos"); RemoveVectorPoint("HomePos");
 ``` ```
 +
 +
 +
 +### FormatPlainText()
 +
 +> 格式化指定文本为纯文本(去除`HTML|UBB`),可用于获取除表情外等真实文本及长度。
 +
 +```javascript
 +function FormatPlainText( text: string, includeUBB: bool = true ): string
 +```
 +
 +- `includeUBB`:如果设置为`true`,则允许包含`UBB`(忽略处理)。
  
  
行 1035: 行 1075:
  
 ```javascript ```javascript
-function FormatRichText( text: string, onlyEmoji: bool = false )+function FormatRichText( text: string, onlyEmoji: bool = false ): string
 ``` ```
  
行 1049: 行 1089:
 ### FormatDefineText() ### FormatDefineText()
  
-> 格式化指定文本为[引擎宏文本](reference/define "引擎宏文本"),这将使一段文本自动将宏文本替换为最终结果。+> 格式化指定文本为[引擎宏文本](developer/define "引擎宏文本"),这将使一段文本自动将宏文本替换为最终结果。
  
 ```javascript ```javascript
-function FormatDefineText( text: string, includeColor: bool = true )+function FormatDefineText( text: string, includeColor: bool = true ): string
 ``` ```
  
行 1101: 行 1141:
  
 - `sampleAll`是否采样所有静态对象,否则仅采样地面对象(陆地)。 - `sampleAll`是否采样所有静态对象,否则仅采样地面对象(陆地)。
 +
 +
 +
 +
 +