• Welcome to Valhalla Legends Archive.
 

Visual Basic Bot Flood Protection

Started by pyropk, October 21, 2003, 05:06 PM

Previous topic - Next topic

pyropk

Grok's code didn't work when I tested it.  I have a bot written by me, but I need Flood Protection.  Somone help!  Thanx.

Adron

this is probably safe flood protection:

if len(txt) > 60 then txt = left(txt, 60)
sleep 3000

Banana fanna fo fanna

But terrible.

Add all send events to a queue and have a timer empty it and write to bnet.

iago

Quote from: St0rm.iD on October 21, 2003, 07:43 PM
But terrible.

Add all send events to a queue and have a timer empty it and write to bnet.

nonono, use a stack! Then your messages will display backwards; but don't tell the person you send your bot to, have the messages displayed as soon as he hits send on the client side, then watch the hilarity ensue! :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Yoni

Quote from: Adron on October 21, 2003, 05:14 PM
this is probably safe flood protection:

if len(txt) > 60 then txt = left(txt, 60)
sleep 3000

You can also get a funny version of the same protection method if you replace "left" with "right"

Adron

For an infinite sequence of long messages, is the flood protection I suggested more than 20% off? For an infinite sequence of short messages, is it more than 30% off? I don't think it's that bad at all if it's within 30%!

pyropk

Well.. Using
if len(txt) > 60 then txt = left(txt, 60)
sleep 3000

Why only 60?  And...Should I put this for all the data sending?  Or..What?  Cause im slightly confused.

Tuberload

What that does is

If the length of 'txt' is greater than 60, replace text with the first 60 characters fro the left side of the string. Then pause for 3000 milliseconds before proceeding.
Basically he is saying you need that long of a duration before you send anymore data, for every 60 characters sent.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Adron

I'm saying that the ultra flood protection should be around 60 characters somewhere and that for 60 characters you get a waiting time that is somewhere close to 3 seconds anyway.

pyropk

While waiting, I came up with my own Flood Protection... Its rather 'Ghetto' if you will, and im sure buggy.. Buts it worked not bad so far.

Public Function SendData(Text As String)
frmMain.FloodC.Text = frmMain.FloodC.Text + 1

'Basicaly, just adds one digit to the Flood Counter Txt
'Then sends the actual text through Clean Slate...

frmMain.CSB1.Send Text

'But if the FloodC is >= 1, then it'll wait until it
'drops back down to 0, before it proceeds to send
'more data.

If frmMain.FloodC.Text >= "1" Then
   Do Until frmMain.FloodC.Text = "0"
       DoEvents
   Loop
End If

DoEvents
End Function

Private Sub FloodProtecion_Timer()
'Interval: 1300
'Slowely takes away the digit back down to 0,
'So it wont send until its 0...So gives time in between

If FloodC.Text > "0" Then FloodC.Text = FloodC.Text - 1
End Sub

iago

#10
The algorithm they use is actually rather complicated, but 60 characters is the most efficient length.  I would recommend figureing out what the lowest safe time/character is for each possible length and calculating the formula.  It will involve getting banned from b.net a lot, but it'll be fun!

Incidently, use [code ] and [/ code] tags around your source code to make it easier to read.  

Thanks!

QuoteIf frmMain.FloodC.Text >= "1" Then
   Do Until frmMain.FloodC.Text = "0"
       DoEvents
   Loop
End If
I'm confused; why are you checking if the text > "1"?  That makes no sense..
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


pyropk

No, if FloodC.Text is >= 1.  Thats the Flood Counter text box.  When you call the Send command, it adds 1 to that text box.  If the Text is greater than 0, it'll stall until its back to zero, causing the pause.  The timer checks to see if the Flood Counter is greater than 0 to know whether or not it should decrease at a rate before it sends the next set of data.

Adron

#12
Quote from: pyropk on October 23, 2003, 03:05 AM
No, if FloodC.Text is >= 1.  Thats the Flood Counter text box.  When you call the Send command, it adds 1 to that text box.  If the Text is greater than 0, it'll stall until its back to zero, causing the pause.  The timer checks to see if the Flood Counter is greater than 0 to know whether or not it should decrease at a rate before it sends the next set of data.

That's a nice idea. My original flood protection was something like:

Add 200 + the number of characters in the message to the flood counter when sending a message.
Decrease the flood counter by 1 every 11 ms.
Only send a message if the resulting flood counter after sending the message would be less than 600.


Edit:
You can't set a timer for 11 ms and get it to decrease the flood counter reliably, you'd have to set it for 110 ms and decrease by 10 or something like that.

Banana fanna fo fanna

Don't use a textbox, use a variable.