GetParent 获取父节点
命令名称:` jsd.GetParent 获取父节点 `
语法格式: `jsd.GetParent(节点信息,父节点保存变量[,指定下标]) `
命令参数: `参数1:字符串型,必选,节点信息。`
参数2:`字符串型,必选,保存变量。`
参数3:`可选,数值型,节点下标,节点初始下标为0`
返回值: `布尔值,成功返回true,失败返回null。 `
```脚本例子: 复制代码
Import "jsd.luae"
Import "shanhai.lua"
ShanHai.execute "chmod -R 777 " & GetTempDir()
If Dir.Exist(GetTempDir() & "jsd.apk") = 0 Then
TracePrint "释放附件"
PutAttachment GetTempDir(),"jsd.apk"
End If
//只需执行一次
If jsd.StartServer() Then
TracePrint "恭喜你!!可以使用插件"
Else
TracePrint "很遗憾!!!你无法使用插件"
End If
//雷电游戏中心的主页面,获取推荐的父节点
If jsd.GetParent("By.text('推荐')","node") Then
Dim Info = jsd.FindNodeInfo("node","rect")
If Info Then
TracePrint "节点矩形范围",Join(Info,",")
End If
End If
```
备注: 无。