• Welcome to Valhalla Legends Archive.
 

ListView Problem

Started by BaDDBLooD, October 31, 2004, 10:40 AM

Previous topic - Next topic

BaDDBLooD

I am trying to add packet MCP_CHARCREATE 0x02 to my bot

I add some characters at the start:



Private Sub Form_Load()
    lstCharacters.ListItems.Add , , "Amazon", ICON_AMAZON
    lstCharacters.ListItems.Add , , "Sorceress", ICON_SORCERESS
    lstCharacters.ListItems.Add , , "Necromancer", ICON_NECROMANCER
    lstCharacters.ListItems.Add , , "Paladin", ICON_PALADIN
    lstCharacters.ListItems.Add , , "Barbarian", ICON_BARBARIAN
    lstCharacters.ListItems.Add , , "Druid", ICON_DRUID
    lstCharacters.ListItems.Add , , "Assassin", ICON_ASSASSIN
End Sub

Public Const ICON_AMAZON As Integer = 1
Public Const ICON_ASSASSIN As Integer = 2
Public Const ICON_BARBARIAN As Integer = 3
Public Const ICON_DRUID As Integer = 4
Public Const ICON_NECROMANCER As Integer = 5
Public Const ICON_PALADIN As Integer = 6
Public Const ICON_SORCERESS As Integer = 7



THey are in the image list as follows:

Amazon
Assassin
Barbarian
Druid
Necromancer
Paladin
Sorceress

Than when i send character class, i just use the index of the selected item.

However, as you might have guessed, the character i want to create is not the one that get's created :)

There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Newby

Try sending Index + 1. IIRC, the index of the first item is 0.
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

BaDDBLooD

Tried it, that was not the problem.
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Newby

Public Function GetChar(ByVal CharType As String) As Byte
    Select Case LCase(CharType)
        Case "barbarian": GetChar = 4
        Case "druid": GetChar = 5
        Case "assassin": GetChar = 6
        Case "amazon": GetChar = 0
        Case "sorceress": GetChar = 1
        Case "paladin": GetChar = 3
        Case "necromancer": GetChar = 2
        Case Else: GetChar = 4
    End Select
End Function

That's what I had in a bot I coded over half a year ago. I'm going with the assumption that your character values are wrong.
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.