Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myform.RichTextBox1.AppendText("Nombre de monstres : " & Account.Game.Fight.GetFighters(True).Count & vbCrLf)
- Dim lowestDistance As Integer = 99
- Dim closerMonsterCell As Integer = 99
- For Each Fighter In Account.Game.Fight.GetFighters(True)
- Dim fPoint As MapPoint = New MapPoint(Fighter.CellId)
- Dim mPoint As MapPoint = New MapPoint(Account.Game.Fight.Fighter.CellId)
- Dim distance As Integer = mPoint.DistanceToCell(fPoint)
- If distance < lowestDistance Then
- lowestDistance = distance
- closerMonsterCell = fPoint.CellId
- End If
- Next
- myform.RichTextBox1.AppendText("lowestDistance : " & lowestDistance & vbCrLf)
- If myform.CheckBox1.Checked Then
- Dim runAwayCell As Integer = 0
- For Each cell In Account.Game.Fight.GetReachableCells
- Dim cPoint As MapPoint = New MapPoint(cell)
- Dim closerMonsterMP As MapPoint = New MapPoint(closerMonsterCell)
- Dim distance As Integer = cPoint.DistanceToCell(closerMonsterMP)
- If distance > lowestDistance Then
- runAwayCell = cell
- End If
- Next
- Account.Game.Fight.MoveToCell(runAwayCell)
- myform.RichTextBox1.AppendText("Moved to : " & runAwayCell & vbCrLf)
- Account.Wait(1000, 1500)
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement