AutoHotKey陰陽(yáng)師刷玉魂腳本

  1. 安裝AutoHotKey,下載地址:https://www.autohotkey.com/download/
  2. 新建文本文檔,粘貼下面的掛機(jī)腳本,修改文件名為yysgj.ahk
; Create by Gxy

global _width = 1152
global _height = 678

; 程序入口
Gui, New
Gui, Add, Text,, 刷玉魂次數(shù):
Gui, Add, Edit, yp xp+110 w60 Number vCtrl_Count, 20
Gui, Add, Text, xm, 刷玉魂間隔(秒):
Gui, Add, Edit, yp xp+110 w60 Number vCtrl_Interval, 40
Gui, Add, Radio, xm Checked Group vRadio_YuHunLevel1, 壹層
Gui, Add, Radio, yp xp+55 vRadio_YuHunLevel2, 貳層
Gui, Add, Radio, yp xp+55 vRadio_YuHunLevel3, 叁層
Gui, Add, Radio, yp xp+55 vRadio_YuHunLevel4, 肆層
Gui, Add, Radio, yp xp+55 vRadio_YuHunLevel5, 伍層
Gui, Add, Radio, xm vRadio_YuHunLevel6, 陸層
Gui, Add, Radio, yp xp+55 vRadio_YuHunLevel7, 柒層
Gui, Add, Radio, yp xp+55 vRadio_YuHunLevel8, 捌層
Gui, Add, Radio, yp xp+55 vRadio_YuHunLevel9, 玖層
Gui, Add, Radio, yp xp+55 vRadio_YuHunLevel10, 拾層
Gui, Add, Button, xm h26 w268 Default, 刷玉魂
Gui, Show,,陰陽(yáng)師掛機(jī)
return

; 通用方法 - 在坐標(biāo)范圍內(nèi)隨機(jī)
GetRandomPos(x1, y1, x2, y2)
{
    ; 獲取窗口系數(shù)比
    WinGetPos, winX, winY, winW, winH, 陰陽(yáng)師-網(wǎng)易游戲
    coe := winW / _width

    Random, rx, 1, (x2 - x1) * coe
    Random, ry, 1, (y2 - y1) * coe

    return {x: (x1 + rx) * coe, y: (y1 + ry) * coe}
}

; 在游戲內(nèi)隨機(jī)移動(dòng)鼠標(biāo)
RandomMoveMouse()
{
    ; 獲取窗口系數(shù)比
    WinGetPos, winX, winY, winW, winH, 陰陽(yáng)師-網(wǎng)易游戲
    coe := winW / _width

    Random, moveSpeed, 10, 30
    movePos := GetRandomPos(20 * coe, 20 * coe, (_width - 20) * coe, (_height - 20) * coe)
    MouseMove, movePos.x, movePos.y, moveSpeed
}

ClickAtPoint(x1, y1, x2, y2, speed:=5)
{
    pos := GetRandomPos(x1, y1, x2, y2)
    MouseMove, pos.x, pos.y, speed
    Click pos.x, pos.y
}

Drag(x1, y1, x2, y2, speed:=5)
{
    tx1 := x1
    ty1 := y1   
    Point(tx1, ty1)
    tx2 := x2
    ty2 := y2
    Point(tx2, ty2)

    MouseClickDrag, Left, tx1, ty1, tx2, ty2, speed 
}

; 按窗口的縮放系數(shù),獲得指定點(diǎn)
Point(ByRef x, ByRef y)
{
    ; 獲取窗口系數(shù)比
    WinGetPos, winX, winY, winW, winH, 陰陽(yáng)師-網(wǎng)易游戲
    coe := winW / _width

    x := x * coe
    y := y * coe
}

; 激活游戲窗口
ActivateGame()
{
    IfWinExist, 陰陽(yáng)師-網(wǎng)易游戲
    {
        WinActivate
        Sleep 500
        return true
    }
    Else
    {
        MsgBox 0, 提示, 請(qǐng)先登錄游戲
        return false
    }
}
 
; 從主界面進(jìn)到探索界面
GoTanSuo()
{
    ; 拖動(dòng)界面,以確定探索按鈕位置
    Drag(1100, 375, 60, 350)
    Drag(1100, 375, 60, 350)

    ; 點(diǎn)擊探索按鈕
    ClickAtPoint(431, 134, 481, 205)

    Sleep 2000
}

; 從探索界面到玉魂挑戰(zhàn)界面
GoYuHunTiaoZhan()
{
    ; 探索界面的玉魂按鈕
    ClickAtPoint(142, 588, 221, 667)

    ; 點(diǎn)擊玉魂后出現(xiàn)的選擇界面
    ClickAtPoint(164, 160, 552, 477)
}

; 選擇具體那一層玉魂挑戰(zhàn)
SelectYuHunLevel()
{
    ; 先滾動(dòng)到頂部
    Drag(355, 180, 360, 376)
    Sleep 1000

    GuiControlGet, Radio_YuHunLevel1
    GuiControlGet, Radio_YuHunLevel2
    GuiControlGet, Radio_YuHunLevel3
    GuiControlGet, Radio_YuHunLevel4
    GuiControlGet, Radio_YuHunLevel5
    GuiControlGet, Radio_YuHunLevel6
    GuiControlGet, Radio_YuHunLevel7
    GuiControlGet, Radio_YuHunLevel8
    GuiControlGet, Radio_YuHunLevel9
    GuiControlGet, Radio_YuHunLevel10

    if Radio_YuHunLevel10
    {
        Drag(360, 376, 360, 376 - 33 * 6, 40)
        ClickAtPoint(236, 364, 489, 392)
    }
    else if Radio_YuHunLevel9
    {
        Drag(360, 376, 360, 376 - 33 * 5, 40)
        ClickAtPoint(236, 364, 489, 392)
    }
    else if Radio_YuHunLevel8
    {
        Drag(360, 376, 360, 376 - 33 * 4, 40)
        ClickAtPoint(236, 364, 489, 392)
    }
    else if Radio_YuHunLevel7
    {
        Drag(360, 376, 360, 376 - 33 * 3, 40)
        ClickAtPoint(236, 364, 489, 392)
    }
    else if Radio_YuHunLevel6
    {
        Drag(360, 376, 360, 376 - 33 * 2, 40)
        ClickAtPoint(236, 364, 489, 392)
    }
    else if Radio_YuHunLevel5
    {
        Drag(360, 376, 360, 376 - 33 * 1, 40)
        ClickAtPoint(236, 364, 489, 392)
    }
    else if Radio_YuHunLevel4
    {
        ClickAtPoint(236, 364, 489, 392)
    }
    else if Radio_YuHunLevel3
    {
        ClickAtPoint(236, 364 - 66 * 1, 489, 392 - 66 * 1)
    }
    else if Radio_YuHunLevel2
    {
        ClickAtPoint(236, 364 - 66 * 2, 489, 392 - 66 * 2)
    }
    else 
    {
        ClickAtPoint(236, 364 - 66 * 3, 489, 392 - 66 * 3)
    }
}

; 單刷玉魂循環(huán)
YuHunSimpleLoop() 
{
    GuiControlGet, Ctrl_Count
    GuiControlGet, Ctrl_Interval

    Loop, %Ctrl_Count%
    {
        ; 隨機(jī)移動(dòng)鼠標(biāo)
        RandomMoveMouse()

        ; 點(diǎn)擊挑戰(zhàn)按鈕
        ClickAtPoint(792, 456, 905, 507)

        ; 點(diǎn)擊準(zhǔn)備按鈕
        Sleep 5000
        ClickAtPoint(960, 450, 1130, 546)

        ; 等待戰(zhàn)斗結(jié)束
        Random, randInvertal, 0, 3000
        Sleep randInvertal + Ctrl_Interval

        ; 戰(zhàn)斗結(jié)束的點(diǎn)擊
        Click

        ; 界面加載時(shí)間
        Sleep 2000
    }
}

; 啟動(dòng)刷玉魂腳本
Button刷玉魂:
If !ActivateGame()
    return
GoTanSuo()
GoYuHunTiaoZhan()
SelectYuHunLevel()
YuHunSimpleLoop()
return


GuiClose:
ExitApp
return


^+q::ExitApp
return
  1. 打開(kāi)陰陽(yáng)師桌面版,并登陸到庭院場(chǎng)景,將庭院皮膚切換成默認(rèn)皮膚
  2. 使用AutoHotKey打開(kāi)剛剛保存的腳本,點(diǎn)擊刷玉魂,腳本將模擬玩家的鼠標(biāo)操作
  3. 使用Ctrl+Shift+Q可退出掛機(jī)腳本
  4. 該腳本僅供參考學(xué)習(xí)
掛機(jī)腳本效果圖
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 注:中文應(yīng)用部分仍需更新。轉(zhuǎn)者按:本文屬于零基礎(chǔ)入門(mén)專(zhuān)題教程,原發(fā)表于 Download!網(wǎng)絡(luò)密技王第三期,后轉(zhuǎn)載...
    amnesiac閱讀 3,722評(píng)論 0 6
  • AutoHotkey是一個(gè)windows下的開(kāi)源、免費(fèi)、自動(dòng)化軟件工具。它由最初旨在提供鍵盤(pán)快捷鍵的腳本語(yǔ)言驅(qū)動(dòng)(...
    晚晴幽草閱讀 5,656評(píng)論 16 89
  • 轉(zhuǎn)者按:本文屬于零基礎(chǔ)入門(mén)專(zhuān)題教程,原發(fā)表于博客中國(guó)(已失效),我曾轉(zhuǎn)載到中文論壇,作者 yonken(此處是他現(xiàn)...
    amnesiac閱讀 3,161評(píng)論 0 17
  • 搜索 Eclipse常用快捷鍵 編輯 查看 窗口 導(dǎo)航 文本編輯 文件 項(xiàng)目 源代碼 運(yùn)行 重構(gòu) 其他Eclips...
    CarlosLynn閱讀 1,890評(píng)論 0 7
  • Eclipse常用快捷鍵 1幾個(gè)最重要的快捷鍵 代碼助手:Ctrl+Space(簡(jiǎn)體中文操作系統(tǒng)是Alt+/)快速...
    山不轉(zhuǎn)人自轉(zhuǎn)閱讀 1,638評(píng)論 0 10

友情鏈接更多精彩內(nèi)容