-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbattle_RunAway.py
40 lines (33 loc) · 935 Bytes
/
battle_RunAway.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from System.Collections.Generic import List
from System import Byte
def go(x, y):
route = PathFinding.Route()
route.X = x
route.Y = y
route.MaxRetry = 10
route.IgnoreMobile = True
PathFinding.Go(route)
def getAroundEnemies(range):
filter = Mobiles.Filter()
filter.RangeMax = range
filter.Notorieties = List[Byte](bytes([3,4,5,6])) #1:cyan 2:green 3:gray 4:criminal 5:orange 6:red 7:yellow
enemies = Mobiles.ApplyFilter(filter)
return len(enemies)
def stand(pos):
Misc.Pause(2000)
while True:
if 7 < getAroundEnemies(2):
break
if getAroundEnemies(10) < 20 and Player.Position != pos:
go(pos.X, pos.Y)
Misc.Pause(1000)
pos = Player.Position
while not Player.IsGhost:
stand(pos)
go(pos.X - 7, pos.Y)
stand(pos)
go(pos.X, pos.Y - 7)
stand(pos)
go(pos.X + 7, pos.Y)
stand(pos)
go(pos.X, pos.Y + 7)