Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: TriCk on May 22, 2003, 04:44 AM

Title: Flood Protection With CSB
Post by: TriCk on May 22, 2003, 04:44 AM
Hey i'm fairly new to this... Ok
I got my bot bannin flood bots when they join but if I get a big spam like 10 rejoins it floods itself out from so many bans... How do I fix this remember I'm using CleanSlateBot.

- TriCk
Title: Re:Flood Protection With CSB
Post by: Tuberload on May 22, 2003, 11:30 AM
Queue the messages, and send them using some sort of anti-flood scheme.
Title: Re:Flood Protection With CSB
Post by: Banana fanna fo fanna on May 22, 2003, 03:57 PM
This is what got most of the old-school newb chatbot developers stuck. You'll actually have to figure something out. It'll be really hard if you've been having CSB do your bitchwork for you, since oldschool chatbot developers did a lot of stuff for themselves. Good luck to you.

SUGGESTION: Collection.
Title: Re:Flood Protection With CSB
Post by: Etheran on May 22, 2003, 04:15 PM
I used a listbox, back in the day~
Title: Flood Protection With CSB
Post by: TriCk on May 23, 2003, 12:34 AM
Ok... Well the thing i've done is when chkAutoBan is vbChecked
In the CleanSlateBot_UserJoins
Ive added the code CleanSlateBot1.Send "/ban " & username & "AutoBan"
Is there a way to make sure it doesnt flood out from sending bans though ???
Like a WAIT somehow ?

- TriCk
Title: Re:Flood Protection With CSB
Post by: Noodlez on May 23, 2003, 12:48 AM
Maybe you should read the replies to your own post? Do exactly what Tuberload said.
Title: Re:Flood Protection With CSB
Post by: Kp on May 23, 2003, 12:48 AM
Quote from: TriCk on May 23, 2003, 12:34 AM
Ok... Well the thing i've done is when chkAutoBan is vbChecked
In the CleanSlateBot_UserJoins
Ive added the code CleanSlateBot1.Send "/ban " & username & "AutoBan"
Is there a way to make sure it doesnt flood out from sending bans though ???
Like a WAIT somehow ?

- TriCk
Yes.  Queue the event if you've sent something recently.  I believe Tuberload mentioned this earlier.
Title: Re:Flood Protection With CSB
Post by: tA-Kane on May 23, 2003, 12:50 AM
Quote from: TriCk on May 23, 2003, 12:34 AMLike a WAIT somehow ?
The code to WAIT for someone who doesn't know how to do something by themselves:Sub Wait(Time As Integer)
 Dim Start As Integer
 'Time is the number of seconds you wish to wait for
 Start = GetTickCount()  'You'll likely need to declare GetTickCount(), I don't know the correct declare for it though.
 Do Until (GetTickCount()-Start) >= Time*60
 Loop
End Sub
Title: Polling time? ewwww :)
Post by: Kp on May 23, 2003, 10:47 AM
Quote from: tA-Kane on May 23, 2003, 12:50 AM
Quote from: TriCk on May 23, 2003, 12:34 AMLike a WAIT somehow ?
The code to WAIT for someone who doesn't know how to do something by themselves:Sub Wait(Time As Integer)
 Dim Start As Integer
 'Time is the number of seconds you wish to wait for
 Start = GetTickCount()  'You'll likely need to declare GetTickCount(), I don't know the correct declare for it though.
 Do Until (GetTickCount()-Start) >= Time*60
 Loop
End Sub
If you're going to do a blocking wait, wouldn't it be better to Sleep() through that time, rather than spinning the CPU checking if you've slept long enough? :p  Under Win32, Sleep takes an argument in milliseconds and should not return until at least that much time has passed.  Note that I say "at least" -- it is possible for the OS to sleep *longer* than you asked.  However, this is rarely a problem.  Sleeping instead of polling ought to free up your CPU, too.
Title: Re:Polling time? ewwww :)
Post by: tA-Kane on May 23, 2003, 04:21 PM
Quote from: Kp on May 23, 2003, 10:47 AMIf you're going to do a blocking wait, wouldn't it be better to Sleep() through that time, rather than spinning the CPU checking if you've slept long enough?

Quote from: tA-Kane on May 23, 2003, 12:50 AMThe code to WAIT for someone who doesn't know how to do something by themselves: