函数:checkScriptAuth 脚本类型和授权

函数名称:脚本类型和授权

函数功能:获取脚本的格式类型、授权状态和脚本 ID

引擎版本:iOS v2.2.6,Android v2.0.3 及以上

函数方法

tsp = checkScriptAuth()

返回值 类型 说明
tsp.type string 返回当前脚本的类型: lua tsp p4u
tsp.auth number 仅支持 iOS v2.4.1、Android v2.2.4 以上版本,
返回当前收费脚本的授权状态: 0 - 未授权;1 - 已授权;2 - 试用中
tsp.id number 返回当前脚本的 ID(此 ID 唯一,可在开发者平台查看)

函数用例

tsp = checkScriptAuth()
nLog(tsp.id)      --输出 tspid 号,脚本必须为 tsp 否则返回空值
tsp = checkScriptAuth()
if tsp.type == "tsp" then
    dialog(tsp.id)
--试用字段只支持 iOS v2.4.1,Android v2.2.4 以上版本
    if tsp.auth == 2 then 
        dialog("脚本状态:试用中")
    elseif tsp.auth == 1 then
        dialog("脚本状态:已激活")
    else
        dialog("脚本状态:未激活")
    end
else
    dialog("lua 脚本")
end
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""