溪流 WarKey

脚本示例

放下所有物品

Extension =
{
    Application   = "xlWarKey",
    Version       = "3.0",
    NameSpace     = "http://www.streamlet.org/Software/xlWarKey/",

    ExtensionName = "放下所有物品",                               --脚本名称
    Author        = "溪流",                                       --脚本作者
    Description   = "该脚本可以用来一次性放下将物品栏所有东西。", --脚本描述

    --这个脚本不需要参数配置
    Configuration =
    {
    },

    --入口函数
    Entrance      = function (id)   --参数 id 仅仅是保留着以便将来使用,目前请忽略

        --六个物品栏的相对位置
        local coef =
        {
            {
                x = 0.664,  --窗口宽度 * 0.664 是第一个格子中心的 x 坐标
                y = 0.846   --窗口高度 * 0.664 是第一个格子中心的 y 坐标,下同
            },
            {
                x = 0.713,
                y = 0.846
            },
            {
                x = 0.664,
                y = 0.911
            },
            {
                x = 0.713,
                y = 0.911
            },
            {
                x = 0.664,
                y = 0.977
            },
            {
                x = 0.713,
                y = 0.977
            },
        };

        local x, y = GetCursorPosition();   --取得当前鼠标位置
        local w, h = GetClientSize();       --取得魔兽窗口大小

        PressKey(Keys.VK_SHIFT);    --按下 Shift,开始插旗子
        for i = 1, 6 do     -- 6 格子,循环 6 次
            --将鼠标移动到格子位置
            MoveMouse(w * coef[i].x, h * coef[i].y);
            Delay(50);
            --单击右键
            PressMouseButton(Mouse.RBUTTON);
            Delay(10);
            ReleaseMouseButton(Mouse.RBUTTON);
            Delay(50);
            --将鼠标移到起始位置
            MoveMouse(x, y);
            Delay(50);
            --单击左键
            PressMouseButton(Mouse.LBUTTON);
            Delay(10);
            ReleaseMouseButton(Mouse.LBUTTON);
            Delay(50);
        end
        ReleaseKey(Keys.VK_SHIFT);  --放开 Shift,结束插旗子

        --为避免刚才按鼠标的时候选中了其他东西,按 F1 选中当前英雄
        PressKey(Keys.VK_F1);
        ReleaseKey(Keys.VK_F1);

        return true;    --返回值也保留,将来使用,请 return true。
    end
};

喊话

Extension =
{
    Application   = "xlWarKey",
    Version       = "3.0",
    NameSpace     = "http://www.streamlet.org/Software/xlWarKey/",

    ExtensionName = "喊话",         --脚本名称
    Author        = "溪流",         --脚本作者
    Description   = "该脚本可以用来在游戏中喊话。", --脚本描述

    --下面这个是参数配置信息,可以将一个脚本用于多种场景
    --比如喊话,可以让同一个脚本用于不同的喊话内容和喊话对象
    Configuration =
    {
        --第一个参数,喊话对象
        Target    =
        {
            Type  = "number",
            Desc = "喊话对象,0 表示默认对象,1 表示向盟友,2 表示向所有人。"
        },
        --第二个参数,函数内容
        Content   =
        {
            Type  = "string",
            Desc = "喊话内容"
        }
    },

    --入口函数
    Entrance      = function(id) --参数 id 仅仅是保留着以便将来使用,目前请忽略

        local config = Extension.Configuration;

        --上面这一行是载入参数配置,接下来使用的话,
        --config.Target 就是用户在软件界面上设置的喊话对象
        --config.Content 就是用户在软件界面上设置的喊话内容

        --接下来要模拟按回车调出聊天框
        --根据不同的喊话对象使用直接回车、Ctrl+回车或者 Shift+回车

        local ctrl = false;
        local shift = false;

        if config.Target == 1 then     --如果像盟友喊话,使用 Ctrl+回车
            ctrl = true;
        elseif config.Target == 2 then --如果像所有人喊话,使用 Shift+回车
            shift = true;
        end;

        --按回车调出聊天框
        PressKey(Keys.VK_RETURN, ctrl, shift);
        ReleaseKey(Keys.VK_RETURN, ctrl, shift);
        --将聊天内容设置到剪贴板
        SetClipboard(config.Content);
        --按 Ctrl+V 粘贴
        PressKey(Keys.VK_V, true);
        ReleaseKey(Keys.VK_V, true);
        --按回车发送
        PressKey(Keys.VK_RETURN);
        ReleaseKey(Keys.VK_RETURN);

        return true; --返回值也保留,将来使用,请 return true。
    end
};

鼠标连点

Extension =
{
    Application   = "xlWarKey",
    Version       = "3.0",
    NameSpace     = "http://www.streamlet.org/Software/xlWarKey/",

    ExtensionName = "鼠标连点",                       --脚本名称
    Author        = "溪流",                           --脚本作者
    Description   = "该脚本可以用来在红警2中一次性造多个单位。",   --脚本描述

    --下面这个是参数配置信息,可以将一个脚本用于多种场景
    Configuration =
    {
        --第一个参数,连点次数
        Count    =
        {
            Type  = "number",
            Desc  = "连点次数"
        }
    },

    --入口函数
    Entrance      = function (id)   --参数 id 仅仅是保留着以便将来使用,目前请忽略

        local config = Extension.Configuration;

        --上面这一行是载入参数配置,接下来使用的话,
        --config.Count 就是用户在软件界面上设置的连点次数

        for i = 1,config.Count,1
        do 
            PressMouseButton(Mouse.LBUTTON);
            ReleaseMouseButton(Mouse.LBUTTON);
        end

        return true;    --返回值也保留,将来使用,请 return true。
    end
};

©2004-2025 溪流网站 保留所有权利