Advertisement
Riremito

狩り用スクリプト

Jan 18th, 2015
815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. X = Attack
  3. Z = PickUp
  4. 指定足場のPrev/Nextがない場合クラッシュする場合有
  5. */
  6. [Enable]
  7. Alloc(AutoMove, 512)
  8. Label(AutoMove_Ending)
  9. Label(SetDirection)
  10. Label(SD_Ending)
  11. Label(TurnLeft)
  12. Label(AutoAttack)
  13. Label(AutoPickUp)
  14. Label(SD_Attack)
  15. Label(TurnRight)
  16. Label(SD_Turn)
  17. Label(SetRight)
  18. Label(SetLeft)
  19. Label(SetTimer)
  20.  
  21. Alloc(MoveFlag, 12)
  22.  
  23. MoveFlag:
  24. dd 1//Flag
  25. dd 0//Time
  26. dd 0//Last
  27.  
  28. AutoMove:
  29. call SetDirection
  30. mov [esp+20],eax
  31. AutoMove_Ending:
  32. jmp 01517433
  33.  
  34. SetDirection:
  35. push ecx
  36. push edx
  37. push ebx
  38. push [MyPlatformID]
  39. call PlatformFinder
  40. test eax,eax
  41. je SD_Ending
  42. /*
  43. mov edx,[eax+10]//Left
  44. mov ebx,[eax+18]//Right
  45. */
  46. //this code may cause crashes
  47. mov edx,[eax+64]//Prev
  48. mov edx,[edx+10]
  49. mov ebx,[eax+68]//Next
  50. mov ebx,[ebx+18]
  51.  
  52. mov ecx,[01CCBC74]
  53. test ecx,ecx
  54. je SD_Ending
  55. cmp [MoveFlag],1
  56. je SetRight
  57. cmp [MoveFlag],-1
  58. je SetLeft
  59. jmp SD_Attack
  60.  
  61. SetRight:
  62. call AutoPickUp
  63. cmp [ecx+4C80],ebx
  64. jl SD_Ending
  65. mov [MoveFlag+8],-1
  66. call SetTimer
  67. jmp TurnLeft
  68. SetLeft:
  69. call AutoPickUp
  70. cmp [ecx+4C80],edx
  71. jg SD_Ending
  72. mov [MoveFlag+8],1
  73. call SetTimer
  74. jmp TurnRight
  75.  
  76. SetTimer:
  77. mov [MoveFlag],0
  78. call winmm.timeGetTime
  79. mov [MoveFlag+4],eax
  80. ret
  81.  
  82. TurnLeft:
  83. mov eax,-1
  84. pop ebx
  85. pop edx
  86. pop ecx
  87. ret
  88. TurnRight:
  89. mov eax,1
  90. pop ebx
  91. pop edx
  92. pop ecx
  93. ret
  94. SD_Turn:
  95. mov eax,[MoveFlag+8]
  96. mov [MoveFlag],eax
  97. jmp SD_Ending
  98.  
  99. SD_Attack:
  100. call winmm.timeGetTime
  101. sub eax,[MoveFlag+4]
  102. cmp eax,BB8
  103. ja SD_Turn
  104. call AutoAttack
  105. SD_Ending:
  106. mov eax,[MoveFlag]
  107. pop ebx
  108. pop edx
  109. pop ecx
  110. ret
  111.  
  112. AutoAttack:
  113. pushad
  114. push 58
  115. push 002D0000
  116. mov ecx,[01CCBC74]
  117. call 0140AA10
  118. popad
  119. ret
  120.  
  121. AutoPickUp:
  122. pushad
  123. push 5A
  124. push 002C0000
  125. mov ecx,[01CCBC74]
  126. call 0140AA10
  127. popad
  128. ret
  129.  
  130.  
  131. 01517003:
  132. jmp AutoMove
  133. db 90 90 90
  134.  
  135. [Disable]
  136. 01517003:
  137. cmp eax,edi
  138. jne 01517433
  139.  
  140. DeAlloc(AutoMove)
  141. DeAlloc(MoveFlag)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement