第一后裔脚本

-- 全局计数器
local gjCounter = 0
local isGJRunning = false

-- 配置参数
local config = {
    startButton = 9,
    stopKey = "scrolllock",
    runKey = {"w", "lshift"},
    skillKeys = {"c", "v"},
    inventoryKey = "b",
    sleepTimes = {
        runDelay = 2000,
        moveDelay = 200,
        taskStartDelay = 600,
        taskEndDelay = 1200,
        inventoryClearDelay = 1200,
        escapeDelay = 1000
    },
    coordinates = {
        inventoryClick1 = {8000, 24000},
        inventoryClick2 = {58739, 14400},
        inventoryClick3 = {28140, 25692}
    }
}

-- 主要挂机函数
function gj()
    -- 执行一系列游戏内操作
    executeGameActions()
--
--     -- 更新计数器
--     gjCounter = gjCounter + 1
--     if gjCounter >= 10 then
--         clearInventory()
--         gjCounter = 0
--     end
end

-- 游戏内操作
function executeGameActions()
    -- 封装的跑步函数
    run(config.sleepTimes.runDelay)
    an("e", 600)
    an("d", 1500)
    PressAndReleaseKey("c")
    run(4100)
    Sleep(500)
    MoveMouseRelative(700, 0)
    run(2600)
    an("e", 600)
    Sleep(100)
    MoveMouseRelative(-500, 0)
    Sleep(500)
    PressAndReleaseKey("v")
    PressAndReleaseMouseButton(5)
    run(2000)
    Sleep(100)
    MoveMouseRelative(450, -100)
    Sleep(300)
    run(2250)
    Sleep(300)
    MoveMouseRelative(520, 100)
    Sleep(300)
    run(3100)
    Sleep(300)
    MoveMouseRelative(-550, -50)
    PressAndReleaseKey("c")
    Sleep(1200)
    run(3500)
    Sleep(1500)
    MoveMouseRelative(-1100, 0)
    Sleep(300)
    run(5000)
    PressAndReleaseKey("escape")
    Sleep(100)
    MoveMouseTo(4680, 20000)
    Sleep(100)
    PressAndReleaseMouseButton(1)
    Sleep(100)
    PressAndReleaseKey("spacebar")
    Sleep(1000)
end

-- -- 清理背包函数
-- function clearInventory()
--     PressAndReleaseKey(config.inventoryKey)
--     Sleep(config.sleepTimes.escapeDelay)
--     for _, coord in ipairs({config.coordinates.inventoryClick1, config.coordinates.inventoryClick2, config.coordinates.inventoryClick3}) do
--         MoveMouseTo(coord[1], coord[2])
--         Sleep(config.sleepTimes.moveDelay)
--         PressAndReleaseMouseButton(1)
--         Sleep(config.sleepTimes.inventoryClearDelay)
--         an("lshift", config.sleepTimes.inventoryClearDelay)
--         Sleep(config.sleepTimes.moveDelay)
--         an("lctrl", config.sleepTimes.inventoryClearDelay)
--         Sleep(config.sleepTimes.moveDelay)
--         PressAndReleaseKey("spacebar")
--         Sleep(config.sleepTimes.escapeDelay)
--     end
-- end

-- 封装的跑步函数
function run(t)
    PressKey(config.runKey[1])
    Sleep(10)
    PressKey(config.runKey[2])
    Sleep(t)
    ReleaseKey(config.runKey[1])
    ReleaseKey(config.runKey[2])
end

-- 封装的长按键位函数
function an(key, time)
    PressKey(key)
    Sleep(time)
    ReleaseKey(key)
end


-- 事件处理函数
function OnEvent(event, arg)
    if event == "MOUSE_BUTTON_RELEASED" and config.startButton == arg and not isGJRunning then
        isGJRunning = true
        while isGJRunning do
            gj()
        end
    end
    if event == "MOUSE_BUTTON_RELEASED" and config.stopKey == arg and not isGJRunning then
        isGJRunning = false
    end
end

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值