gayChou/脚本信息
INFO

脚本信息

WindUI 站内加载指南与公开脚本一览。

WindUI 站内加载

本站已托管 WindUI v1.6.66,直接 HttpGet 下面的地址即可,不用再连 GitHub。

库已就位 · 1318 KB
整包地址 https://aly.gaychou.top/api/windui-official.php
分片地址 https://aly.gaychou.top/api/windui-part.php?n=1&parts=6
示例文件 https://aly.gaychou.top/info.php?dl=windui
为什么要分片? 整包约 1.29 MB,部分执行器(Xeno 等)单次 HttpGet 会超时。 分片把库切成 N 段,每段约 220 KB,在 Lua 里拼回来即可。n=1..parts 必须使用同一个 parts 值,否则拼接错乱。

最简用法

不想看长篇,先跑这三行。

local WindUI = loadstring(game:HttpGet("https://aly.gaychou.top/api/windui-official.php", true))()

local Win = WindUI:CreateWindow({ Title = "我的脚本", Icon = "solar:widget-add-bold-duotone" })
local Tab = Win:Tab({ Title = "主页" })
Tab:Button({ Title = "点我", Callback = function() WindUI:Notify({ Title = "OK", Content = "可用", Duration = 3 }) end })

完整加载示例

带状态框反馈、整包失败自动转分片、每一步 xpcall 包裹、出错显示 traceback。直接下载改业务即可。

下载 .lua
整包优先先试整包,失败自动切 6 片
进度可见下载/编译/建窗口全程状态框
出错不白屏红框显示原因 + traceback
防重复注入重复执行自动跳过
if _G.WINDUI_SITE_LOCK then
    print("[windui] 脚本已在运行,跳过重复注入")
    return
end
_G.WINDUI_SITE_LOCK = true

local SITE = "https://raw.gaychou.top"
local URL_MAIN = SITE .. "/api/windui-official.php"
local URL_PART = SITE .. "/api/windui-part.php"
local PARTS = 6

local cloneref_fn = (type(cloneref) == "function" and cloneref) or function(s) return s end

local Players = cloneref_fn(game:GetService("Players"))
local LocalPlayer = Players.LocalPlayer

local function getCoreGui()
    local ok, h = pcall(function()
        if type(gethui) == "function" then return gethui() end
        return nil
    end)
    if ok and h then return h end
    local ok2, cg = pcall(function() return game:GetService("CoreGui") end)
    if ok2 and cg then return cg end
    return LocalPlayer:WaitForChild("PlayerGui", 10)
end

local function makeBox(parent, titleText)
    local gui = Instance.new("ScreenGui")
    gui.Name = "WINDUI_SITE_StatusBox"
    gui.ResetOnSpawn = false
    gui.IgnoreGuiInset = true
    gui.DisplayOrder = 9999
    gui.Parent = parent

    local frame = Instance.new("Frame")
    frame.AnchorPoint = Vector2.new(0.5, 0.5)
    frame.Position = UDim2.new(0.5, 0, 0.5, 0)
    frame.Size = UDim2.new(0, 440, 0, 110)
    frame.BackgroundColor3 = Color3.fromRGB(28, 30, 28)
    frame.BackgroundTransparency = 0.08
    frame.BorderSizePixel = 0
    frame.Parent = gui

    local corner = Instance.new("UICorner")
    corner.CornerRadius = UDim.new(0, 10)
    corner.Parent = frame

    local title = Instance.new("TextLabel")
    title.Size = UDim2.new(1, -24, 0, 26)
    title.Position = UDim2.new(0, 12, 0, 10)
    title.BackgroundTransparency = 1
    title.Text = titleText
    title.TextColor3 = Color3.fromRGB(180, 255, 180)
    title.TextSize = 18
    title.Font = Enum.Font.GothamBold
    title.TextXAlignment = Enum.TextXAlignment.Left
    title.Parent = frame

    local body = Instance.new("TextLabel")
    body.Size = UDim2.new(1, -24, 1, -52)
    body.Position = UDim2.new(0, 12, 0, 40)
    body.BackgroundTransparency = 1
    body.Text = ""
    body.TextColor3 = Color3.fromRGB(230, 230, 230)
    body.TextSize = 15
    body.Font = Enum.Font.Gotham
    body.TextXAlignment = Enum.TextXAlignment.Left
    body.TextYAlignment = Enum.TextYAlignment.Top
    body.TextWrapped = true
    body.Parent = frame

    return {
        say = function(text)
            body.Text = tostring(text)
            body.TextColor3 = Color3.fromRGB(230, 230, 230)
        end,
        error = function(text)
            frame.BackgroundColor3 = Color3.fromRGB(60, 24, 24)
            title.Text = titleText .. " · 出错"
            title.TextColor3 = Color3.fromRGB(255, 120, 120)
            body.Text = tostring(text)
            body.TextColor3 = Color3.fromRGB(255, 190, 190)
        end,
        destroy = function() gui:Destroy() end,
    }
end

local function checkLib(src)
    if type(src) ~= "string" or #src < 10000 then return false end
    if src:find("WindUI", 1, true) then return true end
    return false
end

local function fetchWhole()
    local ok, res = pcall(function() return game:HttpGet(URL_MAIN, true) end)
    if ok and checkLib(res) then return res end
    return nil, tostring(res)
end

local function fetchParts(onProgress)
    local buf = {}
    for i = 1, PARTS do
        onProgress(i, PARTS)
        local ok, res = pcall(function()
            return game:HttpGet(URL_PART .. "?n=" .. i .. "&parts=" .. PARTS, true)
        end)
        if not ok or type(res) ~= "string" or #res == 0 then
            return nil, "第 " .. i .. "/" .. PARTS .. " 片下载失败:" .. tostring(res)
        end
        buf[#buf + 1] = res
    end
    local src = table.concat(buf)
    if not checkLib(src) then return nil, "拼接后校验未通过(共 " .. #src .. " 字节)" end
    return src
end

local function onReady(WindUI, Window)
    local Tab = Window:Tab({
        Title = "示例",
        Icon = "solar:widget-add-bold-duotone",
    })

    Tab:Section({ Title = "照着自己的功能往里加" })

    Tab:Button({
        Title = "发一条通知",
        Desc = "调用 WindUI:Notify",
        Callback = function()
            WindUI:Notify({
                Title = "Hello",
                Content = "站内 WindUI 加载成功,通知可用",
                Duration = 3,
            })
        end,
    })

    Tab:Toggle({
        Title = "示例开关",
        Default = false,
        Callback = function(v)
            print("[windui] 开关状态:", v)
        end,
    })

    Tab:Slider({
        Title = "示例滑条",
        Value = { Min = 0, Max = 100, Default = 50 },
        Callback = function(v)
            print("[windui] 滑条:", v)
        end,
    })

    Tab:Dropdown({
        Title = "示例下拉",
        Values = { "选项 A", "选项 B", "选项 C" },
        Default = "选项 A",
        Callback = function(v)
            print("[windui] 下拉:", v)
        end,
    })

    WindUI:Notify({
        Title = "站内 WindUI",
        Content = "加载完成,右键(手机长按)隐藏按钮可收起",
        Duration = 4,
    })
end

local function main()
    local coreGui = getCoreGui()
    local box = makeBox(coreGui, "站内 WindUI · 加载中")
    box.say("初始化...")

    box.say("下载 WindUI(整包)...")
    local src, err = fetchWhole()

    if not src then
        box.say("整包失败,改用分片下载(" .. PARTS .. " 片)...")
        src, err = fetchParts(function(i, n)
            box.say("分片下载 " .. i .. "/" .. n .. "...")
        end)
    end

    if not src then
        box.error("WindUI 下载失败\n" .. tostring(err) .. "\n请检查网络后重试")
        return
    end

    box.say("编译 WindUI...")
    local fn, compileErr = loadstring(src)
    if type(fn) ~= "function" then
        box.error("编译失败\n" .. tostring(compileErr) .. "\n源码长度 " .. #src .. " 字节")
        return
    end

    box.say("初始化 WindUI...")
    local okLib, WindUI = xpcall(fn, function(e)
        return debug.traceback(tostring(e), 2)
    end)
    if not okLib or type(WindUI) ~= "table" then
        box.error("初始化失败\n" .. tostring(WindUI))
        return
    end

    box.say("创建窗口...")
    local okWin, Window = xpcall(function()
        return WindUI:CreateWindow({
            Title = "站内 WindUI 示例",
            Icon = "solar:widget-add-bold-duotone",
            Folder = "WindUI_Site",
            ToggleKey = Enum.KeyCode.RightShift,
            OpenButton = {
                Title = "站内 WindUI",
                Icon = "solar:widget-add-bold-duotone",
                Draggable = true,
                OnlyIcon = false,
                OnlyMobile = true,
                Position = UDim2.new(0.5, 0, 0, 60),
            },
        })
    end, function(e)
        return debug.traceback(tostring(e), 2)
    end)
    if not okWin or not Window then
        box.error("窗口创建失败\n" .. tostring(Window))
        return
    end

    box.say("启动完成")
    box.destroy()

    local okMain, err2 = xpcall(function()
        onReady(WindUI, Window)
    end, function(e)
        return debug.traceback(tostring(e), 2)
    end)
    if not okMain then
        local errBox = makeBox(coreGui, "站内 WindUI · 运行错误")
        errBox.error(err2)
    end
end

xpcall(main, function(e)
    print("[windui][致命] " .. debug.traceback(tostring(e), 2))
    pcall(function()
        local coreGui = getCoreGui()
        local box = makeBox(coreGui, "站内 WindUI · 致命错误")
        box.error(debug.traceback(tostring(e), 2))
    end)
end)

print("[windui] 脚本执行完毕")

手机端注意事项

01

OpenButton.OnlyMobile 必须为 true
否则 Delta 上按钮不显示,只能靠 ToggleKey 呼出。

02

ToggleKey 默认 RightShift
手机没有这个键,请确保悬浮按钮可拖动、可点击。

03

下载超时优先用分片
把 PARTS 调大到 8~10,单片更小更稳。

04

gethui 优先
没有 gethui 时回退 CoreGui,再回退 PlayerGui,示例已处理。