冰楓論壇

標題: TwMS_v196.3_ICS 座標左右走(指定範圍) [打印本頁]

作者: prt    時間: 2017-3-1 19:38
標題: TwMS_v196.3_ICS 座標左右走(指定範圍)
  1. //TwMS_v196.3_ICS 座標左右走(指定範圍)
  2. //Author: Onion
  3. //修改:   PearDelicious, Thx to MS88088
  4. //更新:prt

  5. [Enable]
  6. RegisterSymbol(SwitchLR)
  7. RegisterSymbol(X)
  8. RegisterSymbol(RBound)
  9. RegisterSymbol(LBound)
  10. Alloc(AutoLRICS,512)
  11. Alloc(MyLR,4)
  12. Alloc(X,4)        //初始位置
  13. Alloc(Step,4)
  14. Alloc(LBound,4)        //左方距離
  15. Alloc(RBound,4)        //右方距離
  16. Alloc(SwitchLR,4)
  17. Label(InitFun)
  18. Label(AutoLR)
  19. Label(GetWall)
  20. Label(GetChrX)
  21. Label(GoRight)
  22. Label(GoLeft)

  23. //-----------------------------------------------
  24. LBound:
  25. DD 80        //距離 16進制 1A=26
  26. RBound:
  27. DD 80       //距離 16進制 12C=300
  28. X:
  29. ReadMem([0214E60C]+000017B8, 4)
  30. //-----------------------------------------------

  31. SwitchLR:
  32. DD 01
  33. Step:
  34. DD 0
  35. MyLR:
  36. DD 1 //開啟後先向右走

  37. AutoLRICS:
  38. Cmp [Esp],012F4FDD
  39. Jne GetFocus
  40. Mov Eax,[Step]
  41. Cmp Eax,0
  42. je  InitFun
  43. Mov Eax,[SwitchLR]
  44. Cmp Eax,01
  45. jne GetFocus
  46. Mov [Esp],AutoLR
  47. Jmp GetFocus

  48. InitFun:
  49. Mov [Step],1
  50. Mov Eax,[X]
  51. Sub Eax,[LBound]
  52. Mov [LBound],Eax
  53. Mov Eax,[X]
  54. Add Eax,[RBound]
  55. Mov [RBound],Eax
  56. Ret

  57. AutoLR:
  58. Call GetWall
  59. Mov  [ebp-10],Eax
  60. Xor  Ecx,Ecx
  61. Xor  Eax,Eax
  62. Cmp  [ebp-10],Eax
  63. Jmp  0012F555A

  64. GetWall:
  65. call GetChrX
  66. Mov  Ecx,[LBound]
  67. Sub  Eax,Ecx
  68. Cmp  Eax,0
  69. Jle  GoRight
  70. call GetChrX
  71. Mov  Ecx,[RBound]
  72. sub  Ecx,Eax
  73. cmp  Ecx,0
  74. Jle  GoLeft
  75. Mov  Eax,[MyLR]
  76. Ret

  77. GetChrX:
  78. Mov Eax,[0214E60C]
  79. Mov Eax,[Eax+000017B8]
  80. ret

  81. GoRight:
  82. Mov [MyLR],1
  83. Mov Eax,1
  84. Ret

  85. GoLeft:
  86. Mov [MyLR],FFFFFFFF
  87. Mov Eax,FFFFFFFF
  88. Ret

  89. 02157888:
  90. DD AutoLRICS

  91. [Disable]
  92. 02157888:
  93. DD GetFocus

  94. DeAlloc(LBound)
  95. DeAlloc(RBound)
  96. DeAlloc(Step)
  97. DeAlloc(X)
  98. DeAlloc(MyLR)
  99. DeAlloc(AutoLRICS)
  100. UnRegisterSymbol(SwitchLR)
  101. UnRegisterSymbol(X)
  102. UnRegisterSymbol(RBound)
  103. UnRegisterSymbol(LBound)
複製代碼





歡迎光臨 冰楓論壇 (https://bingfong.com/) Powered by 冰楓