Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: TeEhEiMaN on June 10, 2003, 07:28 PM

Title: Need help with script
Post by: 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....
Title: Re:Need help with script
Post by: ______ on June 10, 2003, 07:54 PM
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#)
Title: Re:Need help with script
Post by: Stealth on June 10, 2003, 08:06 PM
If lchan is a label, you need to use the Caption property to edit its text.
Title: Re:Need help with script
Post by: ______ on June 10, 2003, 08:08 PM
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.
Title: Re:Need help with script
Post by: Camel on June 10, 2003, 08:32 PM
you dont need to set it to "" first
Title: Re:Need help with script
Post by: TeEhEiMaN on June 11, 2003, 07:10 PM
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...
Title: Re:Need help with script
Post by: SNiFFeR on June 12, 2003, 02:19 PM
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...
Title: Re:Need help with script
Post by: Banana fanna fo fanna on June 12, 2003, 03:47 PM
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
Title: Re:Need help with script
Post by: TeEhEiMaN on June 12, 2003, 04:21 PM
what would switchin the same code do?.....
Title: Re:Need help with script
Post by: 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
Title: Re:Need help with script
Post by: Camel on June 18, 2003, 01:45 PM
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.
Title: Re:Need help with script
Post by: Eternal on June 18, 2003, 06:16 PM
Hmm, I thought they started at -1?
Title: Re:Need help with script
Post by: Skywing on June 18, 2003, 07:47 PM
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.
Title: Re:Need help with script
Post by: Stealth on June 18, 2003, 10:30 PM
When dealing with ListViews, however, 0 means no items; they begin at 1.

God bless VB.
Title: Re:Need help with script
Post by: Yoni on June 18, 2003, 11:05 PM
Yes, enjoy diversity within one language.
Title: Re:Need help with script
Post by: Eternal on June 19, 2003, 01:53 AM
Well, that's Microsoft for you...
Title: Re:Need help with script
Post by: Camel on June 19, 2003, 06:10 PM
Quote from: Yoni on June 18, 2003, 11:05 PM
Yes, enjoy diversity within one language.
yeah, it's like if one were to take a bunch of white people and a bunch of black people and put them on an island. with cameras. everywhere. said one would be rich! it's iron-tast-ic!



[edit] by the way, i appoligize if i offended anybody; i'm just white trash, you know! :)
Title: Re:Need help with script
Post by: Crypticflare on June 19, 2003, 11:41 PM
I'm quite offended you did not use any from the Czech culture, myself and my fellow People of the Czech would like this instance FIXED!!

btw j/k, I understand your point to it though