• Welcome to Valhalla Legends Archive.
 

Floodprotection

Started by DeSigN, January 25, 2003, 03:32 PM

Previous topic - Next topic

DeSigN

any0ne g0t a g00d c0de for fl00dpr0tecti0n?
its very c0nfusing, ive tried it  ??? ::)

Noodlez

   Dim delay As Double
    delay = (((Len(Data) * 15 + 1700) / 1000) + 1) * 1000

this is the algorithm i use, it will return the delay that you should use in miliseconds. then you would use CreateTimer() to make a timer with this delay and have it call your function to send the next message in queue.

dxoigmn

#2
Isn't that the same thing as saying:

Dim delay As Double
delay = Len(Data) * 15 + 2700

:-/

DeSigN

#3
is createtimer a vb function?

celluloid

#4
if i get this right, Noodlez was just saying make a function somewhat like Createtimer() (the concept)

Noodlez

#5
Er, I meant SetTimer. Not Create.

SetTimer is a function in user32.dll

Public Declare Function SetTimer Lib "user32" Alias "SetTimer" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long

That's how you declare it.

An example call would be:
SetTimer(Me.Hwnd,&H0,delay, AddressOf SendQueue)