Hello I'm trying to make the target all like NG
But I give a small problem
If I active my walcker and press "Target All" My character attack the monster, but him not stiop walking, for example to loot items
He attack monster but not stop walcking
Ths is the Thread configs
[code=vbnet] Public Sub New()
InitializeComponent()
WaypointWalcker = New ThreadTimer(500)
TargetAll = New ThreadTimer(2000)
End Sub[/code]
[code=vbnet]
Public WithEvents WaypointWalcker As ThreadTimer
Public WithEvents TargetAll As ThreadTimer[/code]
This is my Target All (not use Timers, it use ThreadTimer)
[code=vbnet] Private Sub TargetAll_OnExecute() Handles TargetAll.OnExecute
If client.LoggedIn = True Then
Dim Bl As New BattleList(client)
Dim BLMonsters As List(Of Creature) = Bl.GetCreatures().ToList
Dim aux As String = ""
For ind As Integer = 0 To BLMonsters.Count - 1
If BLMonsters(ind).Z <> player.Z Then Continue For
If Not BLMonsters.Item(ind).IsSelf Then
aux = BLMonsters(ind).Name.ToLower
If BLMonsters(ind).IsAttacking AndAlso BLMonsters(ind).IsReachable Then
BLMonsters(ind).Attack()
End If
Exit For
End If
Next ind
End If
End Sub[/code]
This is My Checkbox to active target all
[code=vbnet] Private Sub btnAttack_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAttack.CheckedChanged
If btnAttack.Checked = True Then
TargetAll.StartTimer()
Else
TargetAll.StopTimer()
End If
End Sub[/code]
And to finish it's my walcker code
[code=vbnet] Private Sub WaypointWalcker_OnExecute() Handles WaypointWalcker.OnExecute
If client.LoggedIn = True Then
If listWaypoints.SelectedItem.ToString() <> "North" AndAlso listWaypoints.SelectedItem.ToString() <> "South" AndAlso listWaypoints.SelectedItem.ToString() <> "West" AndAlso listWaypoints.SelectedItem.ToString() <> "East" Then
Dim chek As String() = listWaypoints.SelectedItem.ToString().Split("|"c)
Dim pos As String = chek(1)
Dim output As String = pos.Substring(pos.IndexOf("(") + 1, pos.IndexOf(")") - pos.IndexOf("(") - 1)
arrayWalker = output.Split(","c)
If player.Location = New Location(Convert.ToInt32(arrayWalker(0)), Convert.ToInt32(arrayWalker(1)), Convert.ToInt32(arrayWalker(2))) Or player.Location.Z <> Convert.ToInt32(arrayWalker(2)) Then
If listWaypoints.SelectedIndex >= (listWaypoints.Items.Count - 1) Then
listWaypoints.SelectedIndex = 0
Else
listWaypoints.SelectedIndex = listWaypoints.SelectedIndex + 1
End If
End If
If chek(0) = "Waypoint" Then
player.[GoTo] = New Location(Convert.ToInt32(arrayWalker(0)), Convert.ToInt32(arrayWalker(1)), Convert.ToInt32(arrayWalker(2)))
Else
If chek(0) = "Rope" Then
Dim rope__1 As New Location(Convert.ToInt32(arrayWalker(0)), Convert.ToInt32(arrayWalker(1)), Convert.ToInt32(arrayWalker(2)))
Dim tile As Tile = client.Map.GetTile(rope__1)
client.Inventory.UseItemOnTile(Rope.Id, tile)
Thread.Sleep(500)
Else
If chek(0) = "Shovel" Then
Dim shovel__2 As New Location(Convert.ToInt32(arrayWalker(0)), Convert.ToInt32(arrayWalker(1)), Convert.ToInt32(arrayWalker(2)))
Dim tile As Tile = client.Map.GetTile(shovel__2)
client.Inventory.UseItemOnTile(Shovel.Id, tile)
Thread.Sleep(500)
listWaypoints.SelectedIndex = listWaypoints.SelectedIndex + 1
End If
End If
End If
Else
If listWaypoints.SelectedItem.ToString() = "North" Then
player.Walk(Direction.Up)
Thread.Sleep(1000)
If listWaypoints.SelectedIndex >= (listWaypoints.Items.Count - 1) Then
listWaypoints.SelectedIndex = 0
Else
listWaypoints.SelectedIndex = listWaypoints.SelectedIndex + 1
End If
Else
If listWaypoints.SelectedItem.ToString() = "South" Then
player.Walk(Direction.Down)
Thread.Sleep(1000)
If listWaypoints.SelectedIndex >= (listWaypoints.Items.Count - 1) Then
listWaypoints.SelectedIndex = 0
Else
listWaypoints.SelectedIndex = listWaypoints.SelectedIndex + 1
End If
Else
If listWaypoints.SelectedItem.ToString() = "East" Then
player.Walk(Direction.Right)
Thread.Sleep(1000)
If listWaypoints.SelectedIndex >= (listWaypoints.Items.Count - 1) Then
listWaypoints.SelectedIndex = 0
Else
listWaypoints.SelectedIndex = listWaypoints.SelectedIndex + 1
End If
Else
If listWaypoints.SelectedItem.ToString() = "West" Then
player.Walk(Direction.Left)
Thread.Sleep(1000)
If listWaypoints.SelectedIndex >= (listWaypoints.Items.Count - 1) Then
listWaypoints.SelectedIndex = 0
Else
listWaypoints.SelectedIndex = listWaypoints.SelectedIndex + 1
End If
End If
End If
End If
End If
End If
End If
End Sub[/code]
And I nneed to make my character stop the walcker if he is attacking a monster
Sorry for my english ;/
But I realy need help