|

楼主 |
发表于 2025-1-16 13:26:22
|
显示全部楼层
本帖最后由 zhuertie888 于 2025-1-18 14:37 编辑
各位前辈大神,体验后给个建议或帮助,,弄好了按键定义判断,直接更换文件夹动作包,就可以对应连招,MOD是方便大家以后使用的。动作包再不需要乱七八糟的前置了
不知道上古卷轴库函数是否有,
按键判定,如果有就不用弄脚本了 。以下AI给的方案,不是DAR语句还没弄好
import pygameimport randomdef IsWornHasKeyword(file, item_id): # 这里需要根据具体的实现添加逻辑 return Falsedef IsActorBase(file, actor_id): # 这里需要根据具体的实现添加逻辑 return Falsedef Random(threshold): return random.random() < thresholddef main(): pygame.init() screen = pygame.display.set_mode((800, 600)) pygame.display.set_caption("Game Example") running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # 获取鼠标按键状态 mouse_buttons = pygame.mouse.get_pressed() # 检查鼠标左键是否被按下 mouse_left_pressed = mouse_buttons[0] # 原有的逻辑 result1 = IsWornHasKeyword("Skyrim.esm", 0x0006C0EC) result2 = IsActorBase("Skyrim.esm", 0x00000007) result3 = Random(0.25) # 最终结果结合鼠标左键状态 final_result = result1 and result2 and result3 and mouse_left_pressed print("最终结果:", final_result) pygame.display.flip() pygame.quit()if __name__ == "__main__": main()
方向判断
using UnityEngine;public class KeyCountHandler : MonoBehaviour{ private int wCount = 0; private int aCount = 0; private int dCount = 0; private int sCount = 0; void Update() { if (Input.GetKeyDown(KeyCode.W)) { wCount++; } if (Input.GetKeyDown(KeyCode.A)) { aCount++; } if (Input.GetKeyDown(KeyCode.D)) { dCount++; } if (Input.GetKeyDown(KeyCode.S)) { sCount++; } // 假设 IsEquippedRightType 和 IsActorBase 是已有的函数或方法,这里需要根据实际情况实现 if (IsEquippedRightType(6) && IsActorBase("Skyrim.esm", 0x00000007)) { if (wCount > 10) { // 执行一些操作,例如移动速度加快等 Debug.Log("W key pressed more than 10 times"); } if (aCount > 5) { // 执行一些操作,例如向左转向等 Debug.Log("A key pressed more than 5 times"); } if (dCount > 5) { // 执行一些操作,例如向右转向等 Debug.Log("D key pressed more than 5 times"); } if (sCount > 10) { // 执行一些操作,例如后退速度加快等 Debug.Log("S key pressed more than 10 times"); } } } // 这里需要根据实际情况实现 IsEquippedRightType 函数 private bool IsEquippedRightType(int type) { // 示例实现,实际情况需根据具体需求修改 return false; } // 这里需要根据实际情况实现 IsActorBase 函数 private bool IsActorBase(string esm, int value) { // 示例实现,实际情况需根据具体需求修改 return false; }}
|
|