Results 1 to 7 of 7

Thread: message queue [resolved]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    255

    message queue [resolved]

    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..
    Last edited by R.a.B.B.i.T; Sep 7th, 2003 at 09:03 PM.

  2. #2
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    what type of messages?
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    255
    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

  4. #4
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    255
    im using
    VB Code:
    1. Private Sub SendQueue_Timer()
    2. If SendMessage(x) <> "" Then
    3. CleanSlateBot1.Send SendMessage(x)
    4. If left(SendMessage(x), 1) <> "/" Then
    5.     If left(SendMessage(x), 3) <> "AB " And left(SendMessage(x), 4) <> "CBE " _
    6.         And left(SendMessage(x), 4) <> "RBE " And left$(SendMessage(x), 2) <> "H&" _
    7.         And left$(SendMessage(x), 5) <> "cHEX " And left$(SendMessage(x), 1) <> "£" Then
    8.         AddChat &H8000000D, "<", vbWhite, lblMe.Caption, &H8000000D, "> ", vbWhite, SendMessage(x)
    9.     End If
    10. End If
    11. SendMessage(x) = ""
    12. If x = 500 Then x = 0
    13. x = x + 1
    14. End Sub
    15.  
    16. Public Function Send(message As String)
    17. checkmsg:
    18. If x > 0 And x < 501 Then
    19.     If [b]SendMessage(x) = ""[/b] Then
    20.         SendMessage(x) = message
    21.     Else
    22.         x = x + 1
    23.         GoTo checkmsg
    24.     End If
    25. Else
    26.     SendMessage(1) = message
    27.     x = 1
    28. End If
    29. End Function
    the bold gets a 'Subscript out of range'

  6. #6
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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'?
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    255
    x is an integer thats dimmed in option explicit
    ps: i fixed this a different way

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width