Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: DeSigN on January 25, 2003, 03:32 PM

Title: Floodprotection
Post by: DeSigN on January 25, 2003, 03:32 PM
any0ne g0t a g00d c0de for fl00dpr0tecti0n?
its very c0nfusing, ive tried it  ??? ::)
Title: Re: Floodprotection
Post by: Noodlez on January 25, 2003, 05:36 PM
   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.
Title: Re: Floodprotection
Post by: dxoigmn on January 25, 2003, 08:31 PM
Isn't that the same thing as saying:

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

:-/
Title: Re: Floodprotection
Post by: DeSigN on January 26, 2003, 07:01 AM
is createtimer a vb function?
Title: Re: Floodprotection
Post by: celluloid on January 26, 2003, 06:32 PM
if i get this right, Noodlez was just saying make a function somewhat like Createtimer() (the concept)
Title: Re: Floodprotection
Post by: Noodlez on January 26, 2003, 08:22 PM
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)