“LlListenControl”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: llListenControl( integer handle, integer active ); |参数…”) |
|||
| 第8行: | 第8行: | ||
integer active – TRUE (default) activates, FALSE deactivates | integer active – TRUE (default) activates, FALSE deactivates | ||
|返回值= 返回值: | |返回值= 返回值: | ||
| + | 返回从 src 中按顺序获取的逗号分隔的值的字符串。 | ||
| + | |注意事项= | ||
在状态更改或脚本重置时,所有监听都会自动删除。 | 在状态更改或脚本重置时,所有监听都会自动删除。 | ||
| − | |||
| − | |||
|示例= | |示例= | ||
示例一 | 示例一 | ||
2020年8月22日 (六) 02:27的版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: llListenControl( integer handle, integer active ); |
| 参数:
integer handle – handle to control listen event integer active – TRUE (default) activates, FALSE deactivates |
| 返回值:
返回从 src 中按顺序获取的逗号分隔的值的字符串。 |
| 注意事项 |
|---|
| 在状态更改或脚本重置时,所有监听都会自动删除。 |
| 示例 |
|---|
示例一
integer handle;
integer toggle;
default
{
state_entry()
{
handle = llListen(5, "", NULL_KEY, ""); // Establish a listener to listen to anything on channel 5 ...
llListenControl(handle, FALSE); // ... but make the listener inactive for now
llSetText("not listening", <0.0,0.0,0.0>, 1.0);
}
touch_start(integer total_number)
{
toggle = !toggle;
llListenControl(handle, toggle); // Make the listener active or inactive as required
if(toggle)
{
llSay(0, "now listening on channel 5");
llSetText("listening on ch 5", <1.0,0.0,0.0>, 1.0);
}
else
{
llSay(0, "not listening any more");
llSetText("not listening", <0.0,0.0,0.0>, 1.0);
}
}
listen(integer channel, string name, key id, string message)
{
llSay(0, name + " just said " + message);
}
}
|
| 相关函数 |
|---|
| llListen |
| 相关事件 |
|---|
| listen |