Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Yegg on September 14, 2004, 04:17 PM

Title: My channellist is messed up!
Post by: Yegg on September 14, 2004, 04:17 PM
I have a problem with my channel list for my CSB bot, my channel list (its listview) shows all the usernames, but, it shows them so that they are all scrambled. The names r over-lining eachother and going in all kidns of weird directions, longer names take up 3 lines. I think this only happens because i made my bot not to recognize icons. Any one know wut to do to help me? (i can show u the needed code if u need it to help me)
Title: Re:My channellist is messed up!
Post by: Networks on September 14, 2004, 05:27 PM
Make your channellist longer or wider and maybe show us some code?

Maybe your column header is to small?
Title: Re:My channellist is messed up!
Post by: MyndFyre on September 14, 2004, 06:12 PM
Have you successfully added items to your list in design-time mode?  If not, there's a problem with your properties in design that have nothing to do with any code whatsoever.

I would look into that first.
Title: Re:My channellist is messed up!
Post by: LordNevar on September 14, 2004, 06:23 PM
When you scroll through your channellist do the names fix?
Title: Re:My channellist is messed up!
Post by: Yegg on September 14, 2004, 07:02 PM
No scrolling through them does not fix the problem.
Ok, hers my code for users alread in a channel:


Private Sub CleanSlateBot1_UserInChannel(ByVal username As String, ByVal flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, StatUpdate As Boolean, SimulatedEvent As Boolean)
   strJSTR = Product
   strSexp = Product
   strSTAR = Product
   strd2 = Product
   strD2XP = Product
   strW2BN = Product
   strw3 = Product
   strDiablo = Product
Dim icon As Integer
Dim lagicoN As Integer
If icon = ICON_GAVEL Then
With Form1.lvChannel.ListItems.Add(1, username, username, , icon)
   .ListSubItems.Add lvChannel.FindItem(username).Index, , , lagicoN
   End With
End If
If icon <> ICON_GAVEL Then
   With Form1.lvChannel.ListItems.Add(, , username, , icon)
   .ListSubItems.Add , , , lagicoN
   End With
End If
Label2 = lvChannel.ListItems.Count
End Sub


Im not sure what im doing wrong but im sure its a code problem now, because now (after i tried fixing something) my channel list if blank, and if i randomly click around it, I can see a users name.
Any1 know wut i do now?  (I don't think the channellists size should matter, but i did make it pretty small, like flawed bot)

Added [ code ] tags.
- Spht
Title: Re:My channellist is messed up!
Post by: LordNevar on September 14, 2004, 08:01 PM
Try adding this

Form1.lvChannel.Refresh at the end of your code.
Title: Re:My channellist is messed up!
Post by: Stealth on September 14, 2004, 08:53 PM
While that is a horribly-written piece of code, I would venture a guess that the problem lies with your ListView properties. Click on it and press SHIFT+F4, and look for options that might be set incorrectly.

Edit: Didn't see MyndFyre's post. Apparently you didn't, either.
Title: Re:My channellist is messed up!
Post by: Networks on September 15, 2004, 08:57 AM
I am thinking the simplest way to deal with this is to delete the listview your using and create a new one by dragging and dropping it from the toolbar to the form and setting the properties yourself. I am sure this will work.
Title: Re:My channellist is messed up!
Post by: LivedKrad on September 15, 2004, 05:51 PM
Learn properties.

[Note: I want NO REPLIES FROM STEALTH TO MY RESPONSE!]
Title: Re:My channellist is messed up!
Post by: Yegg on September 15, 2004, 06:04 PM
Ok, i did what networks said to do, i just re-created my listview, which that allowed me to see the users in the channel again, only they're stil all over the place, the usernames r scrambled everywhere, and im sure that my listview's properties r correct, bcuz i copied them from my old bot. So for now if ne1 thinks something is nwrong with my code or stil something wrong with the properties, you can help, if i figure the problem out, i'll reply back.
Title: Re:My channellist is messed up!
Post by: LivedKrad on September 15, 2004, 06:09 PM
First of all, you need to set the view to Report. Something required for report however, is a column. Try right clicking on the listview and selecting Properties. Go over to 'Column Headers', (or whatever it's called), and add a column. Unless you're able to create an owner drawn listbox, I'd just set the column to about 200-300 less than the width of the listview. As long as you do not attempt to set it is Icon or Small Icon, I do not forsee a problem after taking these steps.