搜尋

暗黑4 自動檢查血條血量適當時機施放治療補血 AHK 自動化腳本輔助

瀏覽數: 1253 | 評論數: 1 | 收藏 0
關燈 | 提示:支援鍵盤翻頁<-左 右->
    組圖開啟中,請稍候......
發佈時間: 2023-7-28 10:56

正文摘要:

replyreload += ',' + 2324062; 腳本下載: 所有站內附件皆會附上安全掃描報告請會員查看純淨度百分比後判斷使用(adsbygoogle = window.adsbygoogle || []).push({});相關檔案須知:取得檔案前,請先詳細閱讀文

回覆

BASA無雙 發表於 2023-7-28 10:59:29
上面是 1440P 2K版本

請參考以下 方法調整成 1080P版本

在這個 AHK 腳本中,我們主要需要調整以下部分,以適應 1080P 解析度的遊戲畫面:

GUI 視窗位置:
在原始腳本中,視窗位置是通過 wx 和 wy 變量設置的,我們需要根據 1080P 解析度將這些值進行調整。在示例中,我將 wy 調整為 800,wx 調整為 10。您可能需要根據您的屏幕和遊戲窗口的位置進行調整。

PixelSearch 設置:
PixelSearch 是用來掃描指定區域的顏色,以檢測生命值條和菜單/商店的退出按鈕。在原始腳本中,這些座標是根據 1440P 解析度設定的,我們需要根據 1080P 解析度進行調整。在示例中,我們將生命值條的區域座標調整為 536, 862, 565, 877,將菜單關閉按鈕的區域座標調整為 1615, 12, 1685, 46,將商店退出按鈕的區域座標調整為 1627, 53, 1687, 76。您可能需要根據您的遊戲畫面的位置和大小進行微調。

這些是需要調整的主要部分。完成這些調整後,您的 AHK 腳本應該適用於 1080P 解析度的遊戲畫面。請記得進行適當的測試,以確保腳本在您的設置中正確運作。
  1. ; Diablo 4 HP (1080P)

  2. #NoEnv
  3. CoordMode, Mouse, Client
  4. #SingleInstance Force
  5. SetTitleMatchMode 2
  6. #WinActivateForce
  7. SetControlDelay 1
  8. SetWinDelay 0
  9. SetKeyDelay -1
  10. SetBatchLines -1
  11. SetMouseDelay, 0

  12. go:
  13. text1 = 開始...
  14. WinActivate, ahk_class SunAwtFrame
  15. WinGetPos, wx, wy, wwx, wwy, ahk_class SunAwtFrame
  16. Gui +ToolWindow -Caption +Owner +border +AlwaysOnTop
  17. Gui, Color, c262322
  18. Gui, Font, s10 cB5B5B5
  19. Gui Add, Text, x5 y-1 w120 h23 +0x200, Diablo 4 工具
  20. Gui Add, Button, x117 y54 w80 h23 gstart, 開始
  21. Gui Add, Text, x7 y28 w120 h24 +0x200, 狀態:
  22. Gui, Font, c00FF00
  23. Gui Add, Text, x58 y29 w120 h23 +0x200 vtext1, %text1%
  24. wy += 800 ; 調整視窗位置
  25. wx += 10 ; 調整視窗位置
  26. Gui Show, x%wx% y%wy% w206 h84, Tom 的靈巧
  27. return

  28. start:
  29. guicontrol,, text1, 正在取得生命值狀態...
  30. WinACtivate, ahk_class Diablo IV Main Window Class

  31. loop {
  32.     WinACtivate, ahk_class Diablo IV Main Window Class
  33.    
  34.     ; PixelSearch: Scans for a specific color (HP bar color) within a given area of the screen
  35.     PixelSearch, px, py, 536, 862, 565, 877, 0x9E3038, 25, Fast RGB ; 生命值的座標 (1080P)
  36.     If (errorlevel = 0) {
  37.         ; If the HP bar color is found, it means the character is healthy
  38.         guicontrol,, text1, 健康狀態...
  39.         WinACtivate, ahk_class Diablo IV Main Window Class
  40.     } Else If (errorlevel = 1) {
  41.         ; If the HP bar color is not found, check for menu or shop exit buttons
  42.         sleep 300
  43.         
  44.         ; Check for the menu exit button
  45.         Pixelsearch, px2, py2, 1615, 12, 1685, 46, 0xB64131, 15, Fast RGB ; 菜單關閉按鈕的座標 (1080P)
  46.         If (errorlevel = 0) {
  47.             guicontrol,, text1, 暫停中...
  48.             WinActivate, ahk_class Diablo IV Main Window Class
  49.         } Else If (errorlevel = 1) {
  50.             ; Check for the shop inventory exit button
  51.             Pixelsearch, px2, py2, 1627, 53, 1687, 76, 0x842422, 15, Fast RGB ; 商店退出按鈕的座標 (1080P)
  52.             If (errorlevel = 0) {
  53.                 guicontrol,, text1, 暫停中...
  54.                 WinACtivate, ahk_class Diablo IV Main Window Class
  55.             } Else If (errorlevel = 1) {
  56.                 ; If no menu or shop exit button is found, assume the character needs healing
  57.                 guicontrol,, text1, 正在治療...
  58.                 WinACtivate, ahk_class Diablo IV Main Window Class
  59.                 Send {XButton1} ; 發送 XButton1(額外滑鼠按鈕)輸入,觸發治療動作(喝藥水)
  60.             }
  61.         }
  62.     }
  63. }

  64. return

  65. ; F9 快捷鍵用於在按下時退出腳本
  66. F9::Exitapp
複製代碼



複製專屬你的推廣連結:發至FB與各論壇宣傳:累積點數換GP商品 & 藍鑽
每五點閱率就可以兌換藍鑽積分或遊戲點卡 夢遊推廣文章換GP商品

Copyright (C) 2010-2020 夢遊電玩論壇

廣告合作:請直接聯繫我們,並附上您預刊登位置的預算。  

快速回覆 返回頂端 返回清單