whats the best way to have a bunch of messages queued then sent every 1250 ms?
ive looked everywhere for a way to do this...but i cant find any, and my attempts have failed, and nobody i kno can help make it work..
Printable View
whats the best way to have a bunch of messages queued then sent every 1250 ms?
ive looked everywhere for a way to do this...but i cant find any, and my attempts have failed, and nobody i kno can help make it work..
what type of messages?
either text from a textbox (the send function is in a module) or encrypted data is what calls the send function
if a user sends too many messages in too short a time, they are disconnected from the server and ipbanned
oh winsock. ok.
you make a collection that holds the strings the guy sends,you could have a time run at 1250 ms, then whenever the timer sub is called you remove the next item to be sent and Send it.
im using
the bold gets a 'Subscript out of range'VB Code:
Private Sub SendQueue_Timer() If SendMessage(x) <> "" Then CleanSlateBot1.Send SendMessage(x) If left(SendMessage(x), 1) <> "/" Then If left(SendMessage(x), 3) <> "AB " And left(SendMessage(x), 4) <> "CBE " _ And left(SendMessage(x), 4) <> "RBE " And left$(SendMessage(x), 2) <> "H&" _ And left$(SendMessage(x), 5) <> "cHEX " And left$(SendMessage(x), 1) <> "£" Then AddChat &H8000000D, "<", vbWhite, lblMe.Caption, &H8000000D, "> ", vbWhite, SendMessage(x) End If End If SendMessage(x) = "" If x = 500 Then x = 0 x = x + 1 End Sub Public Function Send(message As String) checkmsg: If x > 0 And x < 501 Then If [b]SendMessage(x) = ""[/b] Then SendMessage(x) = message Else x = x + 1 GoTo checkmsg End If Else SendMessage(1) = message x = 1 End If End Function
the reason i said to use collections was because it is easier than to move items down the list using an array. with collections you could just remove any item and the rest of the items shift accordingly, but with arrays you need to do all that yourself.
but looking at your code.... what is 'x'?
x is an integer thats dimmed in option explicit
ps: i fixed this a different way