吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1022|回复: 6
收起左侧

[其他原创] [Keyboard Maestro] 挂机原地攻击宏

[复制链接]
turato 发表于 2024-9-16 15:35
本帖最后由 turato 于 2024-9-16 15:42 编辑

需求分析

通过键盘控制角色原地攻击,攻击达到一定的次数时,需要移动一下,否则客户端会限制角色的攻击行为,禁止玩家继续攻击。上述流程需要通过快捷键触发和停止。

执行流程解释

  • 脚本每次触发 A 键攻击,并保持 1 秒,然后暂停 1 秒,循环此过程。
  • 攻击计数达到 80 次后,会执行一次特定的操作,包括按住 X 键保持 5 秒(使用金钱炸弹技能),以及使用左右方向键进行短暂的按键操作。
  • 这个流程循环执行,直到满足提前退出条件。

伪代码

  1. 脚本由 {动作} 触发:该脚本的执行将由某个特定的“动作”触发,可以是按键、事件或系统信号等。
  2. 脚本开始:脚本初始化后立即开始运行。
  3. 初始化变量:一个名为 attackCount 的变量被创建并初始化为 0,这个变量用于记录攻击次数。
  4. 循环9999次:脚本将在一个大循环中运行,最多执行 9999 次循环。
    1. 检查{动作}:每次循环开始时,都会检查某个动作是否触发,如果触发则退出循环,不再执行下面的步骤。
    2. 增加攻击计数:每次循环执行,攻击计数 attackCount 增加 1。
    3. 显示攻击计数:当前的攻击计数值将被显示出来,可能是在某个界面或日志中输出。
    4. 按下 A 键:脚本模拟按住 A 键,保持此动作。
    5. 暂停 1 秒:按下 A 键后,脚本会暂停 1 秒钟。
    6. 释放 A 键:暂停后,A 键将被释放。
    7. 再次暂停 1 秒:在释放 A 键后,脚本再等待 1 秒钟。
    8. 检查攻击计数:当攻击计数达到或超过 80 时,进入一个特定的分支,执行额外的操作。   
      1. 按下 X 键:脚本模拟按住 X 键,保持该动作。   
      2. 暂停 5 秒:按下 X 键后,脚本会等待 5 秒钟。   
      3. 释放 X 键:5 秒钟后,X 键将被释放。   
      4. 暂停 1 秒:释放 X 键后,暂停 1 秒钟。   
      5. 按下左方向键:按下左方向键并保持。   
      6. 暂停 0.1 秒:按下左方向键后,等待 0.1 秒。   
      7. 释放左方向键:等待结束后,左方向键被释放。   
      8. 暂停 0.2 秒:接着暂停 0.2 秒。   
      9. 按下右方向键:按下右方向键并保持。   
      10. 暂停 0.1 秒:按下右方向键后,等待 0.1 秒。  
      11. 释放右方向键:0.1 秒后,右方向键被释放。

结果展示:文末的图2024091601.png

参考文档

[1] 官方使用手册:快速入门 https://wiki.keyboardmaestro.com/manual/Quick_Start

[2] 官方使用手册:变量 https://wiki.keyboardmaestro.com/manual/Variables

附录

a.软件图形代码

见文末的图:2024091601.png

b.导出脚本

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <array>
    <dict>
      <key>Activate</key>
      <string>Normal</string>
      <key>CreationDate</key>
      <real>748070114.26186502</real>
      <key>Macros</key>
      <array>
        <dict>
          <key>Actions</key>
          <array>
            <dict>
              <key>ActionUID</key>
              <integer>1617</integer>
              <key>MacroActionType</key>
              <string>SetVariableToText</string>
              <key>Text</key>
              <string>0</string>
              <key>Variable</key>
              <string>attackCount</string>
            </dict>
            <dict>
              <key>ActionUID</key>
              <integer>1210</integer>
              <key>Actions</key>
              <array>
                <dict>
                  <key>ActionUID</key>
                  <integer>1601</integer>
                  <key>Conditions</key>
                  <dict>
                    <key>ConditionList</key>
                    <array>
                      <dict>
                        <key>ConditionType</key>
                        <string>Key</string>
                        <key>KeyCode</key>
                        <integer>53</integer>
                        <key>KeyConditionType</key>
                        <string>Down</string>
                      </dict>
                    </array>
                    <key>ConditionListMatch</key>
                    <string>Any</string>
                  </dict>
                  <key>ElseActions</key>
                  <array>
                    <dict>
                      <key>ActionUID</key>
                      <integer>1607</integer>
                      <key>MacroActionType</key>
                      <string>SetVariableToText</string>
                      <key>Text</key>
                      <string>%Calculate%attackCount + 1%</string>
                      <key>Variable</key>
                      <string>attackCount</string>
                    </dict>
                    <dict>
                      <key>Action</key>
                      <string>DisplayLarge</string>
                      <key>ActionUID</key>
                      <integer>1616</integer>
                      <key>MacroActionType</key>
                      <string>InsertText</string>
                      <key>Text</key>
                      <string>攻击次数:【%attackCount%】</string>
                    </dict>
                    <dict>
                      <key>ActionUID</key>
                      <integer>1602</integer>
                      <key>KeyCode</key>
                      <integer>0</integer>
                      <key>MacroActionType</key>
                      <string>SimulateKeystroke</string>
                      <key>Modifiers</key>
                      <integer>0</integer>
                      <key>Press</key>
                      <string>PressAndHold</string>
                      <key>ReleaseAll</key>
                      <false/>
                      <key>TargetApplication</key>
                      <dict/>
                      <key>TargetingType</key>
                      <string>Front</string>
                    </dict>
                    <dict>
                      <key>ActionUID</key>
                      <integer>817</integer>
                      <key>MacroActionType</key>
                      <string>Pause</string>
                      <key>Time</key>
                      <string>1</string>
                      <key>TimeOutAbortsMacro</key>
                      <true/>
                    </dict>
                    <dict>
                      <key>ActionUID</key>
                      <integer>1604</integer>
                      <key>KeyCode</key>
                      <integer>0</integer>
                      <key>MacroActionType</key>
                      <string>SimulateKeystroke</string>
                      <key>Modifiers</key>
                                                                                <integer>0</integer>
                                                                                <key>Press</key>
                                                                                <string>Release</string>
                                                                                <key>ReleaseAll</key>
                                                                                <false/>
                                                                                <key>TargetApplication</key>
                                                                                <dict/>
                                                                                <key>TargetingType</key>
                                                                                <string>Front</string>
                                                                        </dict>
                                                                        <dict>
                                                                                <key>ActionUID</key>
                                                                                <integer>1608</integer>
                                                                                <key>Conditions</key>
                                                                                <dict>
                                                                                        <key>ConditionList</key>
                                                                                        <array>
                                                                                                <dict>
                                                                                                        <key>ConditionType</key>
                                                                                                        <string>Text</string>
                                                                                                        <key>Text</key>
                                                                                                        <string>%Variable%attackCount%</string>
                                                                                                        <key>TextConditionType</key>
                                                                                                        <string>GreaterThanOrEqual</string>
                                                                                                        <key>TextValue</key>
                                                                                                        <string>80</string>
                                                                                                </dict>
                                                                                        </array>
                                                                                        <key>ConditionListMatch</key>
                                                                                        <string>Any</string>
                                                                                </dict>
                                                                                <key>ElseActions</key>
                                                                                <array/>
                                                                                <key>MacroActionType</key>
                                                                                <string>IfThenElse</string>
                                                                                <key>ThenActions</key>
                                                                                <array>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1611</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>Pause</string>
                                                                                                <key>Time</key>
                                                                                                <string>1</string>
                                                                                                <key>TimeOutAbortsMacro</key>
                                                                                                <true/>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1609</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>SetVariableToText</string>
                                                                                                <key>Text</key>
                                                                                                <string>%Variable%attackCount%=0</string>
                                                                                                <key>Variable</key>
                                                                                                <string>attackCount</string>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1621</integer>
                                                                                                <key>KeyCode</key>
                                                                                                <integer>7</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>SimulateKeystroke</string>
                                                                                                <key>Modifiers</key>
                                                                                                <integer>0</integer>
                                                                                                <key>Press</key>
                                                                                                <string>PressAndHold</string>
                                                                                                <key>ReleaseAll</key>
                                                                                                <false/>
                                                                                                <key>TargetApplication</key>
                                                                                                <dict/>
                                                                                                <key>TargetingType</key>
                                                                                                <string>Front</string>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1622</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>Pause</string>
                                                                                                <key>Time</key>
                                                                                                <string>5</string>
                                                                                                <key>TimeOutAbortsMacro</key>
                                                                                                <true/>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1623</integer>
                                                                                                <key>KeyCode</key>
                                                                                                <integer>7</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>SimulateKeystroke</string>
                                                                                                <key>Modifiers</key>
                                                                                                <integer>0</integer>
                                                                                                <key>Press</key>
                                                                                                <string>Release</string>
                                                                                                <key>ReleaseAll</key>
                                                                                                <false/>
                                                                                                <key>TargetApplication</key>
                                                                                                <dict/>
                                                                                                <key>TargetingType</key>
                                                                                                <string>Front</string>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1624</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>Pause</string>
                                                                                                <key>Time</key>
                                                                                                <string>1</string>
                                                                                                <key>TimeOutAbortsMacro</key>
                                                                                                <true/>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1610</integer>
                                                                                                <key>KeyCode</key>
                                                                                                <integer>123</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>SimulateKeystroke</string>
                                                                                                <key>Modifiers</key>
                                                                                                <integer>196608</integer>
                                                                                                <key>Press</key>
                                                                                                <string>PressAndHold</string>
                                                                                                <key>ReleaseAll</key>
                                                                                                <false/>
                                                                                                <key>TargetApplication</key>
                                                                                                <dict/>
                                                                                                <key>TargetingType</key>
                                                                                                <string>Front</string>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1620</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>Pause</string>
                                                                                                <key>Time</key>
                                                                                                <string>0.1</string>
                                                                                                <key>TimeOutAbortsMacro</key>
                                                                                                <true/>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1612</integer>
                                                                                                <key>KeyCode</key>
                                                                                                <integer>123</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>SimulateKeystroke</string>
                                                                                                <key>Modifiers</key>
                                                                                                <integer>196608</integer>
                                                                                                <key>Press</key>
                                                                                                <string>Release</string>
                                                                                                <key>ReleaseAll</key>
                                                                                                <false/>
                                                                                                <key>TargetApplication</key>
                                                                                                <dict/>
                                                                                                <key>TargetingType</key>
                                                                                                <string>Front</string>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1625</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>Pause</string>
                                                                                                <key>Time</key>
                                                                                                <string>0.2</string>
                                                                                                <key>TimeOutAbortsMacro</key>
                                                                                                <true/>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1613</integer>
                                                                                                <key>KeyCode</key>
                                                                                                <integer>124</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>SimulateKeystroke</string>
                                                                                                <key>Modifiers</key>
                                                                                                <integer>196608</integer>
                                                                                                <key>Press</key>
                                                                                                <string>PressAndHold</string>
                                                                                                <key>ReleaseAll</key>
                                                                                                <false/>
                                                                                                <key>TargetApplication</key>
                                                                                                <dict/>
                                                                                                <key>TargetingType</key>
                                                                                                <string>Front</string>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1614</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>Pause</string>
                                                                                                <key>Time</key>
                                                                                                <string>0.1</string>
                                                                                                <key>TimeOutAbortsMacro</key>
                                                                                                <true/>
                                                                                        </dict>
                                                                                        <dict>
                                                                                                <key>ActionUID</key>
                                                                                                <integer>1618</integer>
                                                                                                <key>KeyCode</key>
                                                                                                <integer>124</integer>
                                                                                                <key>MacroActionType</key>
                                                                                                <string>SimulateKeystroke</string>
                                                                                                <key>Modifiers</key>
                                                                                                <integer>196608</integer>
                                                                                                <key>Press</key>
                                                                                                <string>Release</string>
                                                                                                <key>ReleaseAll</key>
                                                                                                <false/>
                                                                                                <key>TargetApplication</key>
                                                                                                <dict/>
                                                                                                <key>TargetingType</key>
                                                                                                <string>Front</string>
                                                                                        </dict>
                                                                                </array>
                                                                                <key>TimeOutAbortsMacro</key>
                                                                                <true/>
                                                                        </dict>
                                                                </array>
                                                                <key>MacroActionType</key>
                                                                <string>IfThenElse</string>
                                                                <key>ThenActions</key>
                                                                <array>
                                                                        <dict>
                                                                                <key>Action</key>
                                                                                <string>BreakFromLoop</string>
                                                                                <key>ActionUID</key>
                                                                                <integer>1603</integer>
                                                                                <key>MacroActionType</key>
                                                                                <string>Cancel</string>
                                                                        </dict>
                                                                </array>
                                                                <key>TimeOutAbortsMacro</key>
                                                                <true/>
                                                        </dict>
                                                </array>
                                                <key>CountExpression</key>
                                                <string>9999</string>
                                                <key>MacroActionType</key>
                                                <string>Repeat</string>
                                                <key>TimeOutAbortsMacro</key>
                                                <true/>
                                        </dict>
                                </array>
                                <key>CreationDate</key>
                                <real>748070226.17550302</real>
                                <key>ModificationDate</key>
                                <real>748078123.40468705</real>
                                <key>Name</key>
                                <string>AttackAndJump</string>
                                <key>Triggers</key>
                                <array>
                                        <dict>
                                                <key>FireType</key>
                                                <string>Pressed</string>
                                                <key>KeyCode</key>
                                                <integer>0</integer>
                                                <key>MacroTriggerType</key>
                                                <string>HotKey</string>
                                                <key>Modifiers</key>
                                                <integer>512</integer>
                                        </dict>
                                </array>
                                <key>UID</key>
                                <string>E1980A6E-1EDD-438F-AA3E-13BA68813CC3</string>
                        </dict>
                </array>
                <key>Name</key>
                <string>Global Macro Group</string>
                <key>ToggleMacroUID</key>
                <string>4A34E079-8BF0-42D7-BE2E-D87AD14ECE28</string>
                <key>UID</key>
                <string>804D32AF-0B39-439F-8EF3-493A833B14CA</string>
        </dict>
</array>
</plist>
2024091601.png
20240916_2 (1).png

免费评分

参与人数 2吾爱币 +7 热心值 +2 收起 理由
F14990A + 1 我很赞同!
苏紫方璇 + 7 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

fly5cc 发表于 2024-9-16 15:58
没看图就猜到是冒险岛
65302666 发表于 2024-9-16 22:41
CMS079内存版本
//cms~079 攻击不停
[Enable]
registersymbol(CSX)
alloc(CSX,128)
label(CSXReturn)

CSX:
push eax
mov eax,[00bdd490]   
mov eax,[eax+2964]   
cmp eax,32   
pop eax
jg CSXReturn

push eax
mov eax,[00bdd490]                  
mov eax,[eax+2974]  
cmp eax,32
pop eax
jg CSXReturn

push eax
mov eax,[00bdd490]               
mov eax,[eax+0f28]               
cmp esi,eax
pop eax
jne CSXReturn
add eax,10
jmp CSXReturn

CSXReturn:
mov [ebx], eax
mov edi,[ebp+10]
test edi,edi
je 009C15E8            
jmp 009C158A      

009C1581:
jmp CSX
[Disable]
009C1581:   
db 89 03 8B 7D 10  
unregistersymbol(CSX)
dealloc(CSX)
laoser 发表于 2024-9-17 10:29
吾爱蛋蛋 发表于 2024-9-17 10:46
谢谢分享
 楼主| turato 发表于 2024-9-23 13:19
65302666 发表于 2024-9-16 22:41
CMS079内存版本
//cms~079 攻击不停
[Enable]

谢谢大佬分享,这个汇编代码应该何如使用呢(版本对上了,是GMS079)。因为我不懂逆向,所以简单找个按键脚本来玩
65302666 发表于 2024-9-23 18:02
turato 发表于 2024-9-23 13:19
谢谢大佬分享,这个汇编代码应该何如使用呢(版本对上了,是GMS079)。因为我不懂逆向,所以简单找个按键脚 ...

版本没对上,你那是GMS079 是国际服,CMS是国服,所以地址对不上无法使用
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-10-19 22:23

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表