首页 > 解决方案 > 为什么这个脚本运行,然后说没有响应?

问题描述

我正在使用 PyQt5 并将此功能连接到一个复选框。当我选中该框时,它会运行,但程序显示“没有响应”,然后我所能做的就是重新启动整个程序。

def glowEsp(self, state):
        if state == QtCore.Qt.Checked:
            print('Glow ESP enabled...')
            pm = pymem.Pymem('csgo.exe')
            client = pymem.process.module_from_name(pm.process_handle, 'client.dll').lpBaseOfDll

            while True:
                glow_manager = pm.read_int(client + dwGlowObjectManager)

                for i in range(1,32):
                    entity = pm.read_int(client + dwEntityList + i * 0x10)

                    if entity:
                        entity_team_id = pm.read_int(entity + m_iTeamNum)
                        entity_glow = pm.read_int(entity + m_iGlowIndex)

                        if entity_team_id == 2:
                            pm.write_float(glow_manager + entity_glow * 0x38 + 0x8, float(1))   # R
                            pm.write_float(glow_manager + entity_glow * 0x38 + 0xC, float(0))   # G
                            pm.write_float(glow_manager + entity_glow * 0x38 + 0x10, float(0))  # B
                            pm.write_float(glow_manager + entity_glow * 0x38 + 0x14, float(1))  # Alpha
                            pm.write_int(glow_manager + entity_glow * 0x38 + 0x28, 1)

                        elif entity_team_id == 3:
                            pm.write_float(glow_manager + entity_glow * 0x38 + 0x8, float(0))   # R
                            pm.write_float(glow_manager + entity_glow * 0x38 + 0xC, float(1))   # G
                            pm.write_float(glow_manager + entity_glow * 0x38 + 0x10, float(0))  # B
                            pm.write_float(glow_manager + entity_glow * 0x38 + 0x14, float(1))  # Alpha
                            pm.write_int(glow_manager + entity_glow * 0x38 + 0x28, 1)```

标签: pythonpyqt5

解决方案


推荐阅读