Advertisement
Guest User

Apokah - Test

a guest
Aug 21st, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.45 KB | None | 0 0
  1. myform.RichTextBox1.AppendText("Nombre de monstres : " & Account.Game.Fight.GetFighters(True).Count & vbCrLf)
  2.  
  3.         Dim lowestDistance As Integer = 99
  4.         Dim closerMonsterCell As Integer = 99
  5.  
  6.         For Each Fighter In Account.Game.Fight.GetFighters(True)
  7.             Dim fPoint As MapPoint = New MapPoint(Fighter.CellId)
  8.             Dim mPoint As MapPoint = New MapPoint(Account.Game.Fight.Fighter.CellId)
  9.  
  10.             Dim distance As Integer = mPoint.DistanceToCell(fPoint)
  11.  
  12.             If distance < lowestDistance Then
  13.                 lowestDistance = distance
  14.                 closerMonsterCell = fPoint.CellId
  15.             End If
  16.  
  17.         Next
  18.  
  19.         myform.RichTextBox1.AppendText("lowestDistance : " & lowestDistance & vbCrLf)
  20.  
  21.         If myform.CheckBox1.Checked Then
  22.  
  23.             Dim runAwayCell As Integer = 0
  24.  
  25.             For Each cell In Account.Game.Fight.GetReachableCells
  26.                 Dim cPoint As MapPoint = New MapPoint(cell)
  27.                 Dim closerMonsterMP As MapPoint = New MapPoint(closerMonsterCell)
  28.  
  29.                 Dim distance As Integer = cPoint.DistanceToCell(closerMonsterMP)
  30.  
  31.                 If distance > lowestDistance Then
  32.                     runAwayCell = cell
  33.                 End If
  34.             Next
  35.  
  36.             Account.Game.Fight.MoveToCell(runAwayCell)
  37.             myform.RichTextBox1.AppendText("Moved to : " & runAwayCell & vbCrLf)
  38.             Account.Wait(1000, 1500)
  39.  
  40.         End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement