- 安裝AutoHotKey,下載地址:https://www.autohotkey.com/download/
- 新建文本文檔,粘貼下面的掛機(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
- 打開(kāi)陰陽(yáng)師桌面版,并登陸到庭院場(chǎng)景,將庭院皮膚切換成默認(rèn)皮膚
- 使用AutoHotKey打開(kāi)剛剛保存的腳本,點(diǎn)擊刷玉魂,腳本將模擬玩家的鼠標(biāo)操作
- 使用Ctrl+Shift+Q可退出掛機(jī)腳本
- 該腳本僅供參考學(xué)習(xí)

掛機(jī)腳本效果圖