Valhalla Legends Forums Archive | Battle.net Bot Development | Channel List Problems

AuthorMessageTime
dodge
I'm working on a simple channel list displaying the OPs first, then the rest. I've read the other posts and they've helped me out. I'm using a list, and I'm having a small irratating problem. When a user joins, I add them to the list no problem, but when I join a new channel, I clear it and add the OPs then the other people but the first one is always blank. This is what I have for when a user is in the channel:
[code]
If Flags = "2" Then
lstChannel.AddItem UserName, 1
Else
lstChannel.AddItem UserName
End If
[/code]

If I set
[code]
If Flags = "2" Then
lstChannel.AddItem UserName, 0
[/code]

After the OPs there is a space. I tried an if statement to increment the number after UserName but it didn't work, maybe I did it wrong not sure.

Note: Using CSB (I know, I'm sorry :'() and programming in VB. Thanks :)


EDIT:
My problem with the IF statement was setting the counter to go from 1 to the number of people in the channel...
[code]
For i = 1 To (whathere) Step 1
lstChannel.AddItem UserName, i
Next
[/code]
June 20, 2004, 3:57 AM
BinaryzL
Wow I think there is a post about this like 7 subjects done and probably on the forum a million times!

https://davnit.net/bnet/vL/phpbbs/index.php?board=17;action=display;threadid=7313
June 20, 2004, 4:03 AM
dodge
Like I said, I've read these posts. My problem is there is a blank before the OPs or after the OPs, I have the OPs thing completed but there is a blank space, or box in the list. That's what I'm trying to get rid of.
June 20, 2004, 4:06 AM
LordNevar
I use to have the same problem, It's your on flags event. It's not setting the icons properly when someone joins the channel. You have to go back and redo all your Flag call's, and your Flag event. Just set it to manually add the Icon, instead of trying to do it automatically.
June 20, 2004, 12:43 PM
TeEhEiMaN
you cant add images to a list box, you need to use a list view.

[code]
if flags = "2" Then
form1.lvChannel.ListItems.Add , , username, , 1

Elesif client = "PXES" then
form1.lvChannel.ListItems.Add , , username, , 2
[/code]

and so on
June 20, 2004, 6:41 PM
StepAside
[quote]Code:

For i = 1 To (whathere) Step 1
lstChannel.AddItem UserName, i
Next


[/quote]
Odd sort of "If" statement with a "For" loop eh?
Anyway, I'd recommend a ListView if you are unfamiliar with ListBox indexes.
June 21, 2004, 1:46 AM
dodge
thanks for the help guys.. I used a listview and solved the problem lol. Next onto icons ;)
June 21, 2004, 2:47 AM
TeEhEiMaN
lol, yes!!!! this was probably the first thing that i helped some buddy with. Im gettin better!
June 22, 2004, 2:14 AM

Search