• Welcome to Valhalla Legends Archive.
 

anti flood with list view

Started by ______, April 09, 2003, 04:17 PM

Previous topic - Next topic

______

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.

______

Nvm , it was easy to fix thx anyways.

Smurfling

Why don't just use an array to store the messages and proceed from there?

______

#3
cause i wanna be creative and diffrent.. ;D

Skywing

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

______

doesnt seem to be slow for me.

Yoni

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!

______

oh..... well least im happy with it for now. it does its job. and thats what i wanted instead of no anti flood.

Mesiah / haiseM

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...
]HighBrow Innovations
Coming soon...

AIM Online Status: 

tA-Kane

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.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

Mesiah / haiseM

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
]HighBrow Innovations
Coming soon...

AIM Online Status: