Ir para conteúdo

Featured Replies

Postado

Alguem ai pode me passar 2 codigos tipo : 1 de Shovel e outro de Rope ? estou precisando , tentei lé umas apostila mais nao entendi mt e tentei axar uns tutorial so que tinha uns que n dava para entendar nada

Vlws a todos (y~

tk-melhor.png

KIIZH.png

  • Respostas 11
  • Visualizações 2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • é utilizando a TibiaAPI? se for segue o código Dim tile As Tile = c.Map.GetTile(coordenada) c.Inventory.UseItemOnTile(Rope.Id, tile) Onde em "coordenada" vai ser a coordenada no mapa.

  • Vocês estão fazendo errado pessoal Aqui está um exemplo:

Posted Images

Postado

é utilizando a TibiaAPI?

se for segue o código

Dim tile As Tile = c.Map.GetTile(coordenada)

c.Inventory.UseItemOnTile(Rope.Id, tile)

Onde em "coordenada" vai ser a coordenada no mapa.

Para o Shovel, troque o "Rope.Id" por "Shovel.Id".

# Regras Gerais - TibiaKing.com #
Contato: [email protected]
Não respondo dúvidas via MP.


1C2tu.png4Tlqo.png1C2tu.png


 

  • 1 year later...
Postado

Olá..

tava precisando de uma ajuda relacionada ao uso da rope

eu montei até agora o walker marcando a posição do char e posições norte, sul, leste e oeste..

coloquei o codigo pra rope, e como button funciona perfeitamente..

usei esse codigo do Augusto, e só alterei a rope.ID pelo próprio ID

to tentando fazer ele rodar pela listbox

ele segue as coordenadas normalmente por ela, mas qndo chega na rope dá um erro..

se puderem me dar uma ajuda, segue o codigo


Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

	 If c.LoggedIn Then

		 Dim loc As Tibia.Objects.Location

		 loc.X = p.Location.X

		 loc.Y = p.Location.Y

		 loc.Z = p.Location.Z

		 If ComboBoxa.SelectedItem = "Mine" Then

			 ListBox1.Items.Add(loc.X & "," & loc.Y & "," & loc.Z)

		 End If

		 If ComboBoxa.SelectedItem = "North" Then

			 ListBox1.Items.Add(loc.X & "," & (loc.Y - 1) & "," & loc.Z)

		 End If

		 If ComboBoxa.SelectedItem = "Soul" Then

			 ListBox1.Items.Add(loc.X & "," & (loc.Y + 1) & "," & loc.Z)

		 End If

		 If ComboBoxa.SelectedItem = "East" Then

			 ListBox1.Items.Add((loc.X + 1) & "," & loc.Y & "," & loc.Z)

		 End If

		 If ComboBoxa.SelectedItem = "West" Then

			 ListBox1.Items.Add((loc.X - 1) & "," & loc.Y & "," & loc.Z)

		 End If

		 If ComboBoxa.SelectedItem = "Rope" Then

			 ListBox1.Items.Add(ComboBoxa.Text)

		 End If

	 End If

End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick

	 Dim myArray() As String = ListBox1.SelectedItem.ToString().Split(",")

	 Dim tile As Tile = c.Map.GetTile(p.Location)

	 If ListBox1.SelectedIndex = "Rope" Then

		 c.Inventory.UseItemOnTile(3003, tile)

	 ElseIf p.IsWalking = False Then

		 c.GetPlayer.GoTo = New Location(CInt(myArray(0)), CInt(myArray(1)), CInt(myArray(2)))

		 If p.Location = New Location(CInt(myArray(0)), CInt(myArray(1)), CInt(myArray(2))) Then

			 If ListBox1.SelectedIndex >= (ListBox1.Items.Count - 1) Then

				 ListBox1.SelectedIndex = 0 

			 Else

				 ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1 

			 End If

		 End If

	 End If

End Sub

Eu faço a depuração normal, marco as posicoes e o uso da rope, mas qndo ativo e chega pra usar ela, da um erro marcando a parte seguinte no visual basic: If ListBox1.SelectedIndex = "Rope" Then e fala que "A conversão da seqüência de caracteres 'Rope' no tipo 'Double' não é válida." sei que falta colocar a posição em "Location", mas não to sabendo como pegar ela.. tentei outra maneira aqui, mas nao deu tb..


Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click


        If c.LoggedIn Then

            Dim loc As Tibia.Objects.Location

            Dim tile As Tile = c.Map.GetTile(p.Location)

            loc.X = p.Location.X

            loc.Y = p.Location.Y

            loc.Z = p.Location.Z

            If ComboBoxa.SelectedItem = "Mine" Then

                ListBox1.Items.Add(loc.X & "," & loc.Y & "," & loc.Z)

            End If

            If ComboBoxa.SelectedItem = "North" Then

                ListBox1.Items.Add(loc.X & "," & (loc.Y - 1) & "," & loc.Z)

            End If

            If ComboBoxa.SelectedItem = "Soul" Then

                ListBox1.Items.Add(loc.X & "," & (loc.Y + 1) & "," & loc.Z)

            End If

            If ComboBoxa.SelectedItem = "East" Then

                ListBox1.Items.Add((loc.X + 1) & "," & loc.Y & "," & loc.Z)

            End If

            If ComboBoxa.SelectedItem = "West" Then

                ListBox1.Items.Add((loc.X - 1) & "," & loc.Y & "," & loc.Z)

            End If

            If ComboBoxa.SelectedItem = "Rope" Then

                ListBox1.Items.Add((c.Inventory.UseItemOnTile(3003, tile)) & "," & loc.X & "," & loc.Y & "," & loc.Z)

            End If

        End If


    End Sub


    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick

        Dim myArray() As String = ListBox1.SelectedItem.ToString().Split(",")

        If p.IsWalking = False Then

            c.GetPlayer.GoTo = New Location(CInt(myArray(0)), CInt(myArray(1)), CInt(myArray(2)))

            If p.Location = New Location(CInt(myArray(0)), CInt(myArray(1)), CInt(myArray(2))) Then 

                If ListBox1.SelectedIndex >= (ListBox1.Items.Count - 1) Then 

                    ListBox1.SelectedIndex = 0 

                Else

                    ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1 

                End If

            End If

        End If

    End Sub

esse aparece erro na linha:

c.GetPlayer.GoTo = New Location(CInt(myArray(0)), CInt(myArray(1)), CInt(myArray(2)))

e diz "A conversão da seqüência de caracteres 'True' no tipo 'Integer' não é válida."

e se eu troco a posição no:

ListBox1.Items.Add((c.Inventory.UseItemOnTile(3003, tile)) & "," & loc.X & "," & loc.Y & "," & loc.Z)

para

ListBox1.Items.Add(loc.X & "," & loc.Y & "," & loc.Z & "," & (c.Inventory.UseItemOnTile(3003, tile)))

fica para e aparece a frase na parte debaixo do cliente: "First go upstairs."

obrigado pela atenção

Editado por iasbik (veja o histórico de edições)

Postado

Vocês estão fazendo errado pessoal

Aqui está um exemplo:

Imports Tibia.Util

Imports Tibia.Objects


Public Class Form1

Private p As Player

Private c As Client


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load



c = ClientChooser.ShowBox

p = c.GetPlayer


comboboxPos.SelectedIndex = 0

End Sub


Private Sub btnAddPos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddPos.Click

Select Case comboboxPos.Text.ToLower()

Case "center"

listboxWalker.Items.Add("Walk:" & p.X & "," & p.Y & "," & p.Z)

Case "north"

listboxWalker.Items.Add("Walk:" & p.X & "," & (p.Y - 1) & "," & p.Z)

Case "south"

listboxWalker.Items.Add("Walk:" & p.X & "," & (p.Y - 1) & "," & p.Z)

Case "east"

listboxWalker.Items.Add("Walk:" & (p.X + 1) & "," & p.Y & "," & p.Z)

Case "west"

listboxWalker.Items.Add("Walk:" & (p.X - 1) & "," & p.Y & "," & p.Z)

End Select

End Sub


Private Sub btnRope_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRope.Click

Select Case comboboxPos.Text.ToLower()

Case "center"

listboxWalker.Items.Add("Rope:" & p.X & "," & p.Y & "," & p.Z)

Case "north"

listboxWalker.Items.Add("Rope:" & p.X & "," & (p.Y - 1) & "," & p.Z)

Case "south"

listboxWalker.Items.Add("Rope:" & p.X & "," & (p.Y - 1) & "," & p.Z)

Case "east"

listboxWalker.Items.Add("Rope:" & (p.X + 1) & "," & p.Y & "," & p.Z)

Case "west"

listboxWalker.Items.Add("Rope:" & (p.X - 1) & "," & p.Y & "," & p.Z)

End Select

End Sub


Private Sub btnShovel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShovel.Click

Select Case comboboxPos.Text.ToLower()

Case "center"

listboxWalker.Items.Add("Shovel:" & p.X & "," & p.Y & "," & p.Z)

Case "north"

listboxWalker.Items.Add("Shovel:" & p.X & "," & (p.Y - 1) & "," & p.Z)

Case "south"

listboxWalker.Items.Add("Shovel:" & p.X & "," & (p.Y - 1) & "," & p.Z)

Case "east"

listboxWalker.Items.Add("Shovel:" & (p.X + 1) & "," & p.Y & "," & p.Z)

Case "west"

listboxWalker.Items.Add("Shovel:" & (p.X - 1) & "," & p.Y & "," & p.Z)

End Select

End Sub


Private Sub timerWalker_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timerWalker.Tick

Dim myArrayAction() As String = listboxWalker.SelectedItem.ToString().Split(":")

Dim myArrayLocation() As String = myArrayAction(1).Split(",")


Dim loc As Tibia.Objects.Location

loc.X = myArrayLocation(0)

loc.Y = myArrayLocation(1)

loc.Z = myArrayLocation(2)


Dim tile As Tile = c.Map.GetTile(loc)


If (myArrayAction(0) = "Rope") Then

c.Inventory.UseItemOnTile(3003, tile)

End If

End Sub


Private Sub chkEnable_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkEnable.CheckedChanged

If (chkEnable.Checked) Then

timerWalker.Start()

Else

timerWalker.Stop()

End If

End Sub

End Class

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo