Ir para conteúdo

Featured Replies

Postado

Olá pessoal Vou mostrar como ler as hotkeys do tibia através da configuração dele "Tibia.cfg"

Bem segue o Codigo em Vb.net

hotkey.png

Imports System.IO


Dim Tibiahotkey = System.Environment.GetFolderPath((System.Environment.SpecialFolder.ApplicationData)) & "\Tibia\Tibia.cfg"

	 Dim readerlinha As New System.IO.StringReader(Tibiahotkey)

	 Using reader As StreamReader = New StreamReader(Tibiahotkey)

		 Dim line As String

		 line = reader.ReadLine

		 Do While (Not line Is Nothing)

			 line = reader.ReadLine

			 If Mid(line, 1, 6) = "Hotkey" Then

				 line = line.Replace("Hotkey = (", "")

				 line = line.Replace(")", "")

				 Dim text() As String = line.Split(",")

				 Dim keyw = text(0)

				 Dim magia = text(1).Replace("\n", "")

				 Dim Useitem = text(4)

				 Dim itemid = text(2)

				 'magia = magia.Remove(0, 1)

				 Dim count = magia.Length

				 'magia = magia.Remove(count - 1, count)

				 ' magia = magia.Substring(count - 1, count)

				 MsgBox("Key: " & key(keyw) & vbNewLine & "Magia: " & magia & vbNewLine & "Item ID: " & itemid & vbNewLine & "Use item: " & useon(Useitem))

			 End If

		 Loop

	 End Using


Public Function useon(ByVal Tipo As Integer)

	 Dim Usee As String = ""

	 Select Case Tipo

		 Case 0

			 Usee = "No Use"

		 Case 1

			 Usee = "UseOnTarget"

			 Exit Select

		 Case 2

			 Usee = "UseOnYourself"

			 Exit Select

		 Case 3

			 Usee = "WithCrosshairs"

			 Exit Select

	 End Select

	 Return Usee

End Function


Public Function key(ByVal Tipo As Integer)

	 Tipo = Tipo + 1

	 Dim Usee As String = ""

	 Select Case Tipo

		 Case 1

			 Usee = "F1"

			 Exit Select

		 Case 2

			 Usee = "F2"

			 Exit Select

		 Case 3

			 Usee = "F3"

			 Exit Select

		 Case 4

			 Usee = "F4"

			 Exit Select

		 Case 5

			 Usee = "F5"

			 Exit Select

		 Case 6

			 Usee = "F6"

			 Exit Select

		 Case 7

			 Usee = "F7"

			 Exit Select

		 Case 8

			 Usee = "F8"

			 Exit Select

		 Case 9

			 Usee = "F9"

			 Exit Select

		 Case 10

			 Usee = "F10"

			 Exit Select

		 Case 11

			 Usee = "F11"

			 Exit Select

		 Case 12

			 Usee = "F12"

			 Exit Select

	 End Select

	 Return Usee

End Function

End Class

:)

duvida ? posta ai !

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

  • Respostas 5
  • Visualizações 1.5k
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor

hueheuheuehuehuheuheuheuhuehuehuheuheuheuheuheuuheuheuhuehuheuheuheuheuheuheuheuhueh

me deicho louco, lol vou perde a acc ! heuheuhe

intao falto o Imports System.IO mesmo ,i tbn nao sei c++ :/ so vb.net

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo