Skip to content

Commit

Permalink
Disclaimers
Browse files Browse the repository at this point in the history
  • Loading branch information
SkywalkerJi committed Jan 24, 2022
1 parent db48432 commit 3f00c21
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 21 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
# Yu-Gi-Oh! Master Duel 中文卡查

## Download

你可以在[Releases](https://github.com/SkywalkerJi/mdt/releases/latest)下载预打包的版本。

## Usage
```
打开游戏后,运行mdt.exe,根据提示使用快捷键。
卡组界面和决斗界面需要 ctrl+s 切换模式。
```
## Contributing

有其他指针可以提交[issue](https://github.com/SkywalkerJi/mdt/issues/new)或PR。

## License
```

GPLv3
```

## Disclaimers
```
This project is not affiliated with or sponsored by Konami or its licensors.
```

<ins>This project is not affiliated with or sponsored by Konami or its licensors.</ins>

## Assets
```
Translated text come from [ygocdb.com](https://ygocdb.com)
```

Card texts come from [ygocdb.com](https://ygocdb.com)
37 changes: 24 additions & 13 deletions mdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@

cards_dir = "./cards.json"

cid_temp = 0

# 清理终端
def cls():
os.system("cls" if os.name == "nt" else "clear")


def read_longlongs(pm, base, offsets):
value = pm.read_longlong(base)
for offset in offsets:
value = pm.read_longlong(value + offset)
return value


def get_cid(type: int):
global pm
global deck_addr
Expand Down Expand Up @@ -49,41 +53,42 @@ def get_cid(type: int):
print({"duel_cid not_found"})
return 0


def translate(type: int):
global cid_temp
global baseAddress
if baseAddress is None:
print("地址没找到,不执行检测")
return
cls()
get_at = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
print(f"检测时间:{get_at}")
start_time = time.time()
if type == 1:
print("翻译卡组卡片")
# print("翻译卡组卡片")
cid = get_cid(type)
elif type == 2:
print("翻译决斗卡片")
# print("翻译决斗卡片")
cid = get_cid(type)
else:
print("not support")
return

end_time = time.time()
print("匹配用时: %.6f 秒" % (end_time - start_time))
if(cid):
if cid and cid_temp != cid:
cls()
get_at = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
print(f"检测时间:{get_at}")
cid_temp = cid
card_t = cards_db[str(cid)]
print(
f"{card_t['cn_name']}(密码:{card_t['id']})\n英文名:{card_t['en_name']}\n日文名:{card_t['jp_name']})\n{card_t['text']['types']}\n{card_t['text']['desc']}\n"
)
print("-----------------------------------")
print(f"{switch_hotkey}切换检测卡组/决斗详细卡片信息,{pause_hotkey}暂停检测,{exit_hotkey}退出程序\n")
print("-----------------------------------")
print(f"{switch_hotkey}切换检测卡组/决斗详细卡片信息,{pause_hotkey}暂停检测,{exit_hotkey}退出程序\n")


# 循环
translate_type = 0
pause = True
process_exit = False
enable_debug = False


def translate_check_thread():
global translate_type
global pause
Expand All @@ -104,6 +109,7 @@ def translate_check_thread():
time.sleep(1)
print("程序结束")


def status_change(switch: bool, need_pause: bool, exit: bool):
global translate_type
global pause
Expand All @@ -113,6 +119,11 @@ def status_change(switch: bool, need_pause: bool, exit: bool):
pause = need_pause
if switch:
translate_type = int(not bool(translate_type))
if translate_type == 1:
print("翻译卡组卡片")
elif translate_type == 0:
print("翻译决斗卡片")


if __name__ == "__main__":
with open("cards.json", "rb") as f:
Expand All @@ -129,7 +140,7 @@ def status_change(switch: bool, need_pause: bool, exit: bool):
duel_addr = baseAddress + int("0x01cb2b90", base=16)
except:
print("baseAddress not_found")

keyboard.add_hotkey(switch_hotkey, status_change, args=(True, False, False))
keyboard.add_hotkey(exit_hotkey, status_change, args=(False, False, True))
keyboard.add_hotkey(pause_hotkey, status_change, args=(False, True, False))
Expand Down

0 comments on commit 3f00c21

Please sign in to comment.