Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: dodge on June 19, 2004, 10:57 PM

Title: Channel List Problems
Post by: dodge on June 19, 2004, 10:57 PM
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:

   If Flags = "2" Then
       lstChannel.AddItem UserName, 1
   Else
       lstChannel.AddItem UserName
   End If


If I set

   If Flags = "2" Then
       lstChannel.AddItem UserName, 0


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...

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

Title: Re:Channel List Problems
Post by: BinaryzL on June 19, 2004, 11:03 PM
Wow I think there is a post about this like 7 subjects done and probably on the forum a million times!

http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=7313
Title: Re:Channel List Problems
Post by: dodge on June 19, 2004, 11:06 PM
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.
Title: Re:Channel List Problems
Post by: LordNevar on June 20, 2004, 07:43 AM
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.
Title: Re:Channel List Problems
Post by: TeEhEiMaN on June 20, 2004, 01:41 PM
you cant add images to a list box, you need to use a list view.


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

Elesif client = "PXES" then
form1.lvChannel.ListItems.Add , , username, , 2


and so on
Title: Re:Channel List Problems
Post by: StepAside on June 20, 2004, 08:46 PM
QuoteCode:

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


Odd sort of "If" statement with a "For" loop eh?
Anyway, I'd recommend a ListView if you are unfamiliar with ListBox indexes.
Title: Re:Channel List Problems
Post by: dodge on June 20, 2004, 09:47 PM
thanks for the help guys.. I used a listview and solved the problem lol. Next onto icons ;)
Title: Re:Channel List Problems
Post by: TeEhEiMaN on June 21, 2004, 09:14 PM
lol, yes!!!! this was probably the first thing that i helped some buddy with. Im gettin better!