Valhalla Legends Forums Archive | Visual Basic Programming | Visual Basic Bot Flood Protection

AuthorMessageTime
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.
October 21, 2003, 10:06 PM
Adron
this is probably safe flood protection:

if len(txt) > 60 then txt = left(txt, 60)
sleep 3000
October 21, 2003, 10:14 PM
St0rm.iD
But terrible.

Add all send events to a queue and have a timer empty it and write to bnet.
October 22, 2003, 12:43 AM
iago
[quote author=St0rm.iD link=board=31;threadid=3185;start=0#msg24922 date=1066783412]
But terrible.

Add all send events to a queue and have a timer empty it and write to bnet.
[/quote]

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! :)
October 22, 2003, 4:09 AM
Yoni
[quote author=Adron link=board=31;threadid=3185;start=0#msg24904 date=1066774472]
this is probably safe flood protection:

if len(txt) > 60 then txt = left(txt, 60)
sleep 3000
[/quote]

You can also get a funny version of the same protection method if you replace "left" with "right"
October 22, 2003, 6:43 AM
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%!
October 22, 2003, 7:41 AM
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.
October 22, 2003, 7:39 PM
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.
October 22, 2003, 8:35 PM
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.
October 22, 2003, 11:09 PM
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
October 23, 2003, 7:13 AM
iago
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!

[quote]If frmMain.FloodC.Text >= "1" Then
Do Until frmMain.FloodC.Text = "0"
DoEvents
Loop
End If[/quote]
I'm confused; why are you checking if the text > "1"? That makes no sense..
October 23, 2003, 7:22 AM
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.
October 23, 2003, 8:05 AM
Adron
[quote author=pyropk link=board=31;threadid=3185;start=0#msg25194 date=1066896318]
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.
[/quote]

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.
October 23, 2003, 10:23 AM
St0rm.iD
Don't use a textbox, use a variable.
October 23, 2003, 7:00 PM
bmwrb16
Ditto!
October 24, 2003, 2:53 AM
Tuberload
[quote author=bmwrb16 link=board=31;threadid=3185;start=0#msg25304 date=1066963980]
Ditto!
[/quote]
May I ask what the purpose of this post was?
October 24, 2003, 8:34 AM
Hitmen
[quote author=Tuberload link=board=31;threadid=3185;start=15#msg25334 date=1066984444]
[quote author=bmwrb16 link=board=31;threadid=3185;start=0#msg25304 date=1066963980]
Ditto!
[/quote]
May I ask what the purpose of this post was?
[/quote]

Making a useless post asking why someone made a useless post is a waste of time.

I suppose this post is rather useless too.
October 24, 2003, 7:33 PM
Tuberload
[quote author=Hitmen link=board=31;threadid=3185;start=15#msg25440 date=1067024022]
[quote author=Tuberload link=board=31;threadid=3185;start=15#msg25334 date=1066984444]
[quote author=bmwrb16 link=board=31;threadid=3185;start=0#msg25304 date=1066963980]
Ditto!
[/quote]
May I ask what the purpose of this post was?
[/quote]

Making a useless post asking why someone made a useless post is a waste of time.

I suppose this post is rather useless too.
[/quote]
Mine wasn't really a useless post because I was trying to figure something out. He clearly was not and neither were you. So you guys posted the useless posts. My curiosity gave mine a point. ;D
October 24, 2003, 10:16 PM
-MichaeL-
Here is a queue system i designed for my zonebot use it if you like its very stable note set timer5.interval to 100 and timer2.interval to 4000

[code]
Public Sub Send(ByVal strText As String)
On Error Resume Next
QueueCount = QueueCount + 1
Bot.mnuQ.Caption = "Queue(" & QueueCount & ")"
Bot.List1.AddItem strText
End Sub
Public Sub QueueClear()
QueueCount = 0
Bot.List1.Clear
LastQueue = ""
Bot.mnuQ.Caption = "Queue(" & QueueCount & ")"
End Sub
'no double ban queue
Public Sub CheckQueue(Queue1 As String, Queue2 As String)
If LCase(Left(Queue1, 4)) = "/ban" And LCase(Left(Queue2, 4)) = "/ban" Then
If LCase(Queue1) = LCase(Queue2) Then
Allowed = flase
Else
Allowed = True
End If
Else
Allowed = True
End If
End Sub
Private Sub Timer5_Timer()
If Timer2.Enabled = True Then
Else
If List1.ListCount = "0" Then
Else
QueueCount = QueueCount - 1
Bot.mnuQ.Caption = "Queue(" & QueueCount & ")"
Call CheckQueue(LastQueue, Bot.List1.List(0))
If Allowed = True Then
'AddChat "<" & varuser & ">", vbYellow, Bot.List1.List(0), vbWhite
CleanSlateBot1.Send Bot.List1.List(0)
If LCase(Left(Bot.List1.List(0), 1)) = "/" Then
'
Else
AddChat "<" & varUsername & ">", vbYellow, Bot.List1.List(0) & vbNewLine, vbWhite
End If
LastQueue = Bot.List1.List(0)
Bot.List1.RemoveItem (0)
Timer2.Enabled = True
End If
If Allowed = False Then
Bot.List1.RemoveItem (0)
Call CheckQueue(LastQueue, Bot.List1.List(0))
End If
End If
End If
End Sub
[/code]
November 2, 2003, 2:37 AM
Antarctica
Michael... your code is pretty hard 2 read u know.  You have no enters in any of it or indentations.
September 8, 2006, 12:49 AM
rabbit
WOW!  Two years dead.
September 8, 2006, 1:04 AM
Topaz
The nested ifs are pretty ugh too.
September 8, 2006, 1:16 AM
MyStiCaL
[quote author=rabbit link=topic=3185.msg157648#msg157648 date=1157677470]
WOW!  Two years dead.
[/quote]

3 years dead.. :P
September 8, 2006, 4:39 AM
MysT_DooM
[quote author=MyStiCaL link=topic=3185.msg157666#msg157666 date=1157690356]
[quote author=rabbit link=topic=3185.msg157648#msg157648 date=1157677470]
WOW!  Two years dead.
[/quote]

3 years dead.. :P
[/quote]

2 years and 9 months
September 8, 2006, 11:36 AM
l2k-Shadow
oh dear! 2 years 10 months 6 days dead.
September 8, 2006, 7:39 PM
MyStiCaL
thats right break it down!!
September 8, 2006, 8:18 PM
ImaWh0re
-Mouse drifts around for the lock topic button as if it were really there-
September 22, 2006, 5:54 PM
Myndfyr
[quote author=ImaWh0re link=topic=3185.msg158685#msg158685 date=1158947673]
-Mouse drifts around for the lock topic button as if it were really there-
[/quote]
You're not a moderator.  Stop bitching about it.  You're just contributing to the problem.
September 22, 2006, 5:56 PM
ImaWh0re
I wasn't bitching I was putting my 2 cents in. Hence why I said 'as if it were really there', being I am obviously NOT a moderator. It was a joke, you understand that right?
September 22, 2006, 5:59 PM
rabbit
hehehe....newbie talks back to Myndy :P
September 22, 2006, 10:38 PM
ImaWh0re
I'm not a newbie :( I'm not gosu but defiantly far from a newbie. And my tag lies.
September 23, 2006, 12:37 AM
rabbit
ROFL..."gosu".... I can't believe that's still floating around...
September 23, 2006, 12:59 AM
HeRo
[quote author=rabbit link=topic=3185.msg158741#msg158741 date=1158973188]
ROFL..."gosu".... I can't believe that's still floating around...
[/quote]
I thought it died as well.
September 23, 2006, 1:41 AM
MyStiCaL
im a newbie so what. =P
September 23, 2006, 9:17 AM

Search