Postado Agosto 17, 2011 13 anos Imports Tibia Imports Tibia.Util Imports Tibia.Objects Imports Tibia.Constants Imports System.Collections.Generic Imports System.Collections Imports System.ComponentModel Imports System.Data Imports System.Diagnostics Imports System.Drawing Imports System.Linq Imports System.IO Imports System.Runtime.InteropServices Imports System.Text Imports System.Windows.Forms Public Class Form4 Public Pick As Item = Items.Tool.Pick Public Rope As Item = Items.Tool.Rope Public Shovel As Item = Items.Tool.LightShovel Public arrayWalker As String() Dim p As Player Dim c As Client Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load c = Client.GetClients()(0) p = c.GetPlayer() End Sub Private Sub CaveBot_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CaveBot.Tick If Waypoint.SelectedItem.ToString() <> "MoveN" AndAlso Waypoint.SelectedItem.ToString() <> "MoveS" AndAlso Waypoint.SelectedItem.ToString() <> "MoveW" AndAlso Waypoint.SelectedItem.ToString() <> "MoveE" Then Dim arrayWalker As String() = Waypoint.SelectedItem.ToString().Split("|"c) Dim pos As String = arrayWalker(1) Dim output As String = pos.Substring(pos.IndexOf("(") + 1, pos.IndexOf(")") - pos.IndexOf("(") - 1) arrayWalker = output.Split(","c) If p.Location = New Location(Convert.ToInt32(arrayWalker(0)), Convert.ToInt32(arrayWalker(1)), Convert.ToInt32(arrayWalker(2))) Or p.Location.Z <> Convert.ToInt32(arrayWalker(2)) Then If Waypoint.SelectedIndex >= (Waypoint.Items.Count - 1) Then Waypoint.SelectedIndex = 0 Else Waypoint.SelectedIndex = Waypoint.SelectedIndex + 1 End If End If If arrayWalker(0) = "Walk" Then p.[GoTo] = New Location(Convert.ToInt32(arrayWalker(0)), Convert.ToInt32(arrayWalker(1)), Convert.ToInt32(arrayWalker(2))) Else If arrayWalker(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 = c.Map.GetTile(rope__1) c.Inventory.UseItemOnTile(Rope.Id, tile) Else If arrayWalker(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 = c.Map.GetTile(shovel__2) c.Inventory.UseItemOnTile(Shovel.Id, tile) Waypoint.SelectedIndex = Waypoint.SelectedIndex + 1 End If End If End If Else If Waypoint.SelectedItem.ToString() = "MoveN" Then p.Walk(Direction.Up) If Waypoint.SelectedIndex >= (Waypoint.Items.Count - 1) Then Waypoint.SelectedIndex = 0 Else Waypoint.SelectedIndex = Waypoint.SelectedIndex + 1 End If Else If Waypoint.SelectedItem.ToString() = "MoveS" Then p.Walk(Direction.Down) If Waypoint.SelectedIndex >= (Waypoint.Items.Count - 1) Then Waypoint.SelectedIndex = 0 Else Waypoint.SelectedIndex = Waypoint.SelectedIndex + 1 End If Else If Waypoint.SelectedItem.ToString() = "MoveE" Then p.Walk(Direction.Right) If Waypoint.SelectedIndex >= (Waypoint.Items.Count - 1) Then Waypoint.SelectedIndex = 0 Else Waypoint.SelectedIndex = Waypoint.SelectedIndex + 1 End If Else If Waypoint.SelectedItem.ToString() = "MoveW" Then p.Walk(Direction.Left) If Waypoint.SelectedIndex >= (Waypoint.Items.Count - 1) Then Waypoint.SelectedIndex = 0 Else Waypoint.SelectedIndex = Waypoint.SelectedIndex + 1 End If End If End If End If End If End If End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim loc As Tibia.Objects.Location loc.X = p.Location.X loc.Y = p.Location.Y loc.Z = p.Location.Z Waypoint.Items.Add(loc.X & "," & loc.Y & "," & loc.Z) End Sub Private Sub TargetAll_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TargetAll.Tick If c.LoggedIn = True Then Dim Bl As New BattleList© 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 <> p.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 Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged If CheckBox2.Checked Then TargetAll.Start() Else TargetAll.Stop() End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim x As Integer = p.Location.X Dim y As Integer = p.Location.Y Waypoint.Items.Add("Rope(" & x & ", " & y & ", " & p.Location.Z.ToString() & ")") Waypoint.SelectedIndex = 0 End Sub Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked Then CaveBot.Start() Else CaveBot.Stop() End If End Sub End Class Alguem pode me dizer oque esta de errado nesse code ? porque quando vou testar ele a linha : Dim pos As String = arrayWalker(1) fika amarela Vlws a todos (y~
Postado Agosto 17, 2011 13 anos O waypoint estava selecionado no momento que você pôs pra rodar? Ali esta pra variável receber o "valor" selecionado no listbox... # Regras Gerais - TibiaKing.com # Contato: [email protected]Não respondo dúvidas via MP.
Postado Agosto 17, 2011 13 anos Autor Sim e ainda continua o mesmo erro : pos As String = arrayWalker(1)
Postado Agosto 17, 2011 13 anos Posta uma SS do erro, que fica mais facil ajudar... # Regras Gerais - TibiaKing.com # Contato: [email protected]Não respondo dúvidas via MP.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.