請問一下我現在掛迷藏森林三樓要怎麼迴避mvp巴風特???
以下是我設定的巨集請知道的大大麻煩幫我看一下那裡有改錯嗎,遇到巴風特都不會迴避一直被打掛
14. automacro avoidmon {
15. monster 巴風特 20
16. timeout 0.5
17. exclusive 1
18. run-once 1
19. call check
20. }
21. macro check {
22. [
23. $mapE = prt_maze02
24. $mapW = prt_maze02
25. $map = $.map
26. $mon = $.lastMonster
27. $monID = $.lastMonsterID
28. $monpos = $.lastMonsterPos
29. $dist = $.lastMonsterDist
30. $mypos = $.pos
31. $myx = @arg ("$mypos", 1)
32. $myy = @arg ("$mypos", 2)
33. $monx = @arg ("$monpos", 1)
34. $mony = @arg ("$monpos", 2)
35. $sign = @random ("+", "-")
36. $time = $.datetime
37. do eval message T("Macro avoidmon: $::Macro::Data::varStack{mon} \($::Macro::Data::varStack{monID}\)\n"), "teleport"; message T("魔物距離\= $::Macro::Data::varStack{dist} \, 魔物座標\: \($::Macro::Data::varStack{monx},$::Macro::Data::varStack{mony}\) 地圖名\= $::Macro::Data::varStack{map}\n"), "teleport";
38. logAvoidMob("$mypos","$dist","$mon","$monID","$monpos","$time",)
39. do eval AI::clear("move", "route", "take", "items_take", "attack", "skill_use");
40. do conf attackAuto 0
41. do as
42. ]
43. if ($monx < $myx) goto east
44. if ($monx > $myx) goto west
45.
46. :east
47. if ($mony > $myy) goto southeast
48. if ($mony < $myy) goto northeast
49. [
50. $direction = 東→→→→→
51. $x = @eval ($myx + 50)
52. $y = $myy
53. do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
54. ]
55. if ($walkable == 1) goto move0
56. goto move1
57. stop
58.
59. :southeast
60. [
61. $direction = 東南↘↘↘↘↘
62. $x = @eval ($myx + 50)
63. $y = @eval ($myy - 50)
64. do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
65. ]
66. if ($walkable == 1) goto move0
67. goto move1
68. stop
69.
70. :northeast
71. [
72. $direction = 東北↗↗↗↗↗
73. $x = @eval ($myx + 50)
74. $y = @eval ($myy + 50)
75. do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
76. ]
77. if ($walkable == 1) goto move0
78. goto move1
79. stop
80.
81.
82. :west
83. if ($mony > $myy) goto southwest
84. if ($mony < $myy) goto northwest
85. [
86. $direction = 西←←←←←
87. $x = @eval ($myx - 50)
88. $y = $myy
89. do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
90. ]
91. if ($walkable == 1) goto move0
92. goto move2
93. stop
94.
95. :southwest
96. [
97. $direction = 西南↙↙↙↙↙
98. $x = @eval ($myx - 50)
99. $y = @eval ($myy - 50)
100. do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
101. ]
102. if ($walkable == 1) goto move0
103. goto move2
104. stop
105.
106. :northwest
107. [
108. $direction = 西北↖↖↖↖↖
109. $x = @eval ($myx - 50)
110. $y = @eval ($myy + 50)
111. do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
112. ]
113. if ($walkable == 1) goto move0
114. goto move2
115. stop
116.
117. :move0
118. [
119. do eval AI::clear("move", "route", "take", "items_take", "attack", "skill_use");
120. do eval warning "迴避移動: 從 ($myx, $myy) 移往 $direction ($x, $y) 閃避 $.lastMonster ($monx, $mony)\n";
121. do move $x $y
122. ]
123. goto end
124. stop
125.
126. :move1
127. [
128. $direction = 隨機移東:
129. $x1 = @eval ($myx + 50)
130. $y1 = @eval ($myy $sign 50)
131. do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x1, $y1) ? 1 : 0
132. ]
133. if ($walkable == 0) goto movemapE
134. [
135. do eval AI::clear("move", "route", "take", "items_take", "attack", "skill_use");
136. do eval warning "$direction ($myx, $myy) 至($x1, $y1) 閃避 $.lastMonster ($monx, $mony)\n";
137. do move $x1 $y1
138. ]
139. goto end
140. stop
141.
142. :move2
143. [
144. $direction = 隨機移西:
145. $x2 = @eval ($myx - 50)
146. $y2 = @eval ($myy $sign 50)
147. do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x2, $y2) ? 1 : 0
148. ]
149. if ($walkable == 0) goto movemapW
150. [
151. do eval AI::clear("move", "route", "take", "items_take", "attack", "skill_use");
152. do eval warning "$direction ($myx, $myy) 至($x2, $y2) 閃避 $.lastMonster ($monx, $mony)\n";
153. do move $x2 $y2
154. ]
155. goto end
156. stop
157.
158. :movemapE
159. [
160. $direction = 地圖移東:
161. do eval AI::clear("move", "route", "take", "items_take", "attack", "skill_use");
162. do eval warning "$direction $map 至 $map1 閃避 $.lastMonster ($monx, $mony)\n";
163. do move $mapE
164. ]
165. goto end
166. stop
167.
168. :movemapW
169. [
170. $direction = 地圖移西:
171. do eval AI::clear("move", "route", "take", "items_take", "attack", "skill_use");
172. do eval warning "$direction $map 至 $map2 閃避 $.lastMonster ($monx, $mony)\n";
173. do move $mapW
174. ]
175.
176. :end
177.
178. do eval warning "目前座標:($.pos) 怪物座標:($.lastMonsterPos)\n";
179. do a yes
180. release all
181. stop
182. }
183. sub logAvoidMob {
184. my ($mypos,$dist,$mon,$monID,$monpos,$time,) = @_;
185. open(F, ">>:utf8", "$Settings::logs_folder/avoidedmonsters.txt"); {
186. print F "[迴避]座標:$mypos 距離:$dist | 發現:$mon<$monID> at $monpos || $time \n";
187. close(F);
188. }
189. }
|