• Welcome to Valhalla Legends Archive.
 

Need help with script

Started by TeEhEiMaN, June 10, 2003, 07:28 PM

Previous topic - Next topic

TeEhEiMaN

ok im trying to get count users from list to work, I can only get hone channel to work for some reason tho, but heres the code

[\code]
lchan.Text = ChannelName & " (" & lvChannel.ListItems.Count & ")"


im not sure why it dont work....

______

u need to put on user joins,leaves,userin channel

lchan.Text = ""
lchan.Text =  lchan.Text & " (" & lvChannel.ListItems.Count & ")"


A very simple way to do it, a better way is to have another textbox to hold the channelname also on your channel join.
exp

lchan.Text = ""
lchan.Text =  NewtxtBox.Text & " (" & lvChannel.ListItems.Count & ")"

this would be    Channeljoined (any#)

Stealth

If lchan is a label, you need to use the Caption property to edit its text.
- Stealth
Author of StealthBot

______

#3
Quote from: Stealth on June 10, 2003, 08:06 PM
If lchan is a label, you need to use the Caption property to edit its text.
he said he gets the hone channel to work 'home
so i think its not a label.

Camel

you dont need to set it to "" first

TeEhEiMaN

Alright I did exacly what u told me, but its still kinda messed up
Problems:
Counts all the users but 1.
When user joins -1
When user Leaves +1

Kinda weird but im not sure what i should do...

SNiFFeR

#6
Quote from: TeEhEiMaN on June 11, 2003, 07:10 PM
When user joins -1
When user Leaves +1
maybe switch the codes in each event...Join and Leave...

Banana fanna fo fanna

Quote from: TeEhEiMaN on June 10, 2003, 07:28 PM
ok im trying to get count users from list to work, I can only get hone channel to work for some reason tho, but heres the code

[\code]
lchan.Text = ChannelName & " (" & lvChannel.ListItems.Count & ")"


im not sure why it dont work....


At least he tried. +1

TeEhEiMaN

what would switchin the same code do?.....

Eternal

#9
Is it because the index of listboxes/views start with a 0 perhaps? If the Count starts at 0, the first name in the list = 0 not 1.

:P
^-----silly Brit
-----------------------------
www.brimd.com

Camel

Quote from: Eternal on June 18, 2003, 10:50 AM
Is it because the index of listboxes/views start with a 0 perhaps? If the Count starts at 0, the first name in the list = 0 not 1.

:P
no. if the count is zero, the list is empty. otherwise it wouldnt be able to speicify zero entries. besides, vb isn't zero-based.

Eternal

Hmm, I thought they started at -1?
^-----silly Brit
-----------------------------
www.brimd.com

Skywing

Quote from: Eternal on June 18, 2003, 06:16 PM
Hmm, I thought they started at -1?
Win32 ListBoxes use -1 to mean 'no item' - however, they index items starting at 0.  Of course, "VB ListBoxes" could differ in how they present methods to the user.

Stealth

When dealing with ListViews, however, 0 means no items; they begin at 1.

God bless VB.
- Stealth
Author of StealthBot

Yoni

Yes, enjoy diversity within one language.