Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: ______ on April 09, 2003, 04:17 PM

Title: anti flood with list view
Post by: ______ on April 09, 2003, 04:17 PM
so far it works but the thing is it sends all the listview items if there is more than 1. I just want to send 1 at a time.



Private Sub Que_Timer()

Dim quetick As Integer
Dim queinterval As Integer

quetick = quetick + 1
If quetick >= queinterval Then
For i = 1 To LvQueMsg.ListItems.Count
If LvQueMsg.ListItems.Count = 0 Then
Exit Sub
End If



sckbnet.Send LvQueMsg.ListItems(i).Text

Addtext vbWhite, LvQueMsg.ListItems(i).Text

LvQueMsg.ListItems.Remove LvQueMsg.ListItems(i).Index

quetick = 0


i = i - 1



Next i







End If


could anyone help me make it so it sends one at a time instead all the messages at once.
Title: Re:anti flood with list view
Post by: ______ on April 09, 2003, 07:10 PM
Nvm , it was easy to fix thx anyways.
Title: Re:anti flood with list view
Post by: Smurfling on April 10, 2003, 09:15 AM
Why don't just use an array to store the messages and proceed from there?
Title: Re:anti flood with list view
Post by: ______ on April 10, 2003, 11:09 AM
cause i wanna be creative and diffrent.. ;D
Title: Re:anti flood with list view
Post by: Skywing on April 10, 2003, 11:50 AM
Quote from: ______ on April 10, 2003, 11:09 AM
cause i wnna be creative and diffrent.. ;D
ListViews are much slower.  You'll really be throwing performance out the window...
Title: Re:anti flood with list view
Post by: ______ on April 10, 2003, 12:19 PM
doesnt seem to be slow for me.
Title: Re:anti flood with list view
Post by: Yoni on April 10, 2003, 12:25 PM
Quote from: ______ on April 10, 2003, 12:19 PM
doesnt seem to be slow for me.
Your listview has a relatively very low number of items, so you aren't noticing the difference.
Try to benchmark listview vs. array with many items (10000+).
In general, you shouldn't be using a listview for internal storage. That's what arrays and collections are for!
Title: Re:anti flood with list view
Post by: ______ on April 10, 2003, 12:42 PM
oh..... well least im happy with it for now. it does its job. and thats what i wanted instead of no anti flood.
Title: Re:anti flood with list view
Post by: Mesiah / haiseM on April 10, 2003, 03:34 PM
Speed shouldnt matter as far as performance goes, unless you have massive amounts of items in the queue, which should never happen, because your obviously trying to slow down the rate at which messages are sent, but arrays or stacks are they way to go, safer, smarter, more functionable, and just plain smarter, but hey if your a beginner, a listbox would be a nice way to start...
Title: Re:anti flood with list view
Post by: tA-Kane on April 11, 2003, 07:52 AM
Quote from: MesiaH on April 10, 2003, 03:34 PMbut hey if your a beginner, a listbox would be a nice way to start...

When I first started with RB, I'd use an editfield (textfield/textbox?) to store data, instead of variables and properties.
Title: Re:anti flood with list view
Post by: Mesiah / haiseM on April 11, 2003, 01:56 PM
heh now its not too bad of an idea to do something like that, like before i knew what booleans where, i used checkbox's, they do the same thing all in all, but slow down your program, and make it a bit larger than nescisary