Valhalla Legends Forums Archive | Battle.net Bot Development | problem preventing double sends

AuthorMessageTime
Gangz
i am trying to prevent double sending withought using a queue. and this is not been as easy at it seems. with the help of mr.punchy-face on west i came up with a bit of code.here is a little bit of code to see if anyone else can spot the trouble.
[code]Case ID_JOIN
Form1.ul.AddItem LCase(username)
If chklock = vbChecked And lastmsg = "/ban " & username & " Lockdown" Then Exit Sub
If chklock = vbChecked And lastmsg <> "/ban " & username & " Lockdown" Then Form1.Send "/ban " & username & " Lockdown"[/code]

that would by the userjoin
and this next aprt is the send
[code]Public Sub Send(ByVal strText As String)
On Error Resume Next
With tcp
TextAdd "[" & Time & "] " & strText
strText = Mid(strText, 1, 255)
.InsertNTString strText
.sendPacket &HE
End With
lastmsg = strsend
End Sub[/code]

its not bannign anyone now =\... got any ideas? and if i get it to actually ban will it work?
February 5, 2004, 2:21 AM
MesiaH
[quote author=Gangz link=board=17;threadid=5090;start=0#msg42621 date=1075947668]
i am trying to prevent double sending withought using a queue. and this is not been as easy at it seems. with the help of mr.punchy-face on west i came up with a bit of code.here is a little bit of code to see if anyone else can spot the trouble.
[code]Case ID_JOIN
Form1.ul.AddItem LCase(username)
If chklock = vbChecked And lastmsg = "/ban " & username & " Lockdown" Then Exit Sub
If chklock = vbChecked And lastmsg <> "/ban " & username & " Lockdown" Then Form1.Send "/ban " & username & " Lockdown"[/code]

that would by the userjoin
and this next aprt is the send
[code]Public Sub Send(ByVal strText As String)
On Error Resume Next
With tcp
TextAdd "[" & Time & "] " & strText
strText = Mid(strText, 1, 255)
.InsertNTString strText
.sendPacket &HE
End With
lastmsg = strsend
End Sub[/code]

its not bannign anyone now =\... got any ideas? and if i get it to actually ban will it work?
[/quote]


lastmsg = strsend, where is your declare for strsend? did you mean strtext? if lastmsg is a global or public variable, then you are setting it to nothing, because i don't see where you put your data in the strsend variable.
February 5, 2004, 4:19 AM
Fr0z3N
[quote author=Gangz link=board=17;threadid=5090;start=0#msg42621 date=1075947668]
i am trying to prevent double sending withought using a queue. and this is not been as easy at it seems. with the help of mr.punchy-face on west i came up with a bit of code.here is a little bit of code to see if anyone else can spot the trouble.
[code]Case ID_JOIN
Form1.ul.AddItem LCase(username)
If chklock = vbChecked And lastmsg = "/ban " & username & " Lockdown" Then Exit Sub
If chklock = vbChecked And lastmsg <> "/ban " & username & " Lockdown" Then Form1.Send "/ban " & username & " Lockdown"[/code]

that would by the userjoin
and this next aprt is the send
[code]Public Sub Send(ByVal strText As String)
On Error Resume Next
With tcp
TextAdd "[" & Time & "] " & strText
strText = Mid(strText, 1, 255)
.InsertNTString strText
.sendPacket &HE
End With
lastmsg = strsend
End Sub[/code]

its not bannign anyone now =\... got any ideas? and if i get it to actually ban will it work?
[/quote]


[code]Public Sub Send(ByVal strText As String)
On Error Resume Next
With tcp
TextAdd "[" & Time & "] " & strText
strText = Mid(strText, 1, 255)
.InsertNTString strText
.sendPacket &HE
End With
lastmsg = left(strtext, 5)
lastmsg2 = right(strtext, 9)
End Sub[/code]

[code]Case ID_JOIN
Form1.ul.AddItem LCase(username)
If chklock = vbChecked then
If lastmsg = "/ban " & lastmsg2 = " Lockdown" Then Exit Sub
If lastmsg <> "/ban " & lastmsg2 <> " Lockdown" Then Form1.Send "/ban " & username & " Lockdown"
end if[/code]

That should work

Edit:
lastmsg would be "/ban "
lastmsg2 would be " Lockdown"
February 5, 2004, 1:13 PM
MesiaH
Now frozen, how is that going to help him learn his mistake, if you just re-write it for him?
February 5, 2004, 7:27 PM
iago
btw, why wouldn't you want to use a queue? You have a problem, and you want to solve it without using the tool to do it?

My shoes keep falling off, but I don't want to use shoe-laces, how can I make them stay on?

And my car won't move and I don't want to put gas in it, got a solution for me?
February 6, 2004, 12:12 AM
Spht
[quote author=iago link=board=17;threadid=5090;start=0#msg42692 date=1076026357]
btw, why wouldn't you want to use a queue? You have a problem, and you want to solve it without using the tool to do it?[/quote]

He may not know how to build a queue. If that's the case, Gangz, someone here can help you out.

[quote author=iago link=board=17;threadid=5090;start=0#msg42692 date=1076026357]My shoes keep falling off, but I don't want to use shoe-laces, how can I make them stay on?[/quote]

You could try duct tape.

[quote author=iago link=board=17;threadid=5090;start=0#msg42692 date=1076026357]And my car won't move and I don't want to put gas in it, got a solution for me?
[/quote]

Walk you bum.
February 6, 2004, 12:37 AM
iago
[quote author=Spht link=board=17;threadid=5090;start=0#msg42696 date=1076027859]
[quote author=iago link=board=17;threadid=5090;start=0#msg42692 date=1076026357]And my car won't move and I don't want to put gas in it, got a solution for me?
[/quote]

Walk you bum.
[/quote]

The place I work is a 45 minute drive :(
February 6, 2004, 1:25 AM
Stealth
[quote author=iago link=board=17;threadid=5090;start=0#msg42705 date=1076030722]
[quote author=Spht link=board=17;threadid=5090;start=0#msg42696 date=1076027859]
[quote author=iago link=board=17;threadid=5090;start=0#msg42692 date=1076026357]And my car won't move and I don't want to put gas in it, got a solution for me?
[/quote]

Walk you bum.
[/quote]

The place I work is a 45 minute drive :(
[/quote]

Better start walking! ;)
February 6, 2004, 1:33 AM
Gangz
Ha ha ha

I do have a queue system. I just want to do the lockdown withought a queue kuz 95% of the time the floods are not fast enough to drop it with no queue if it only sends 1 time. And with no queue is the only way to catch the new flooders that are out there
February 6, 2004, 3:31 AM
Null
and it is also the easiest way to get flooded off battle.net and score a nice IP ban.

Good luck on your endeavour to make a queueless bot.
February 6, 2004, 3:45 AM
Gangz
[quote author=NuLL link=board=17;threadid=5090;start=0#msg42728 date=1076039148]
and it is also the easiest way to get flooded off battle.net and score a nice IP ban.

Good luck on your endeavour to make a queueless bot.
[/quote]

it as an option to turn the queue off.. That is a risk the user is takeing.

Edit: [img]http://www.sacred-soldiers.com/Bleh.bmp[/img] thats what it has done so far
February 6, 2004, 4:19 AM
Tuberload
What happens when you send to much to fast and you are booted from battle.net?
February 6, 2004, 4:54 AM
Spht
Maybe you should use a queue but not have a send delay if the queue is empty and idle?
February 6, 2004, 5:03 AM
Dyndrilliac
If the user had been banned, why could it return?

usually if your ban is IP Based(Squelches Banned User), and Key Based, the only thing left is name - add the names banned by the anti flood to the local shitlist and clear the ban list everytime a flooder is detected after they have ben banned but keep there IP's squelched, this avoids you filling up the maximum number of bans while keeping the flooders out - however I have no idea how to accomplish this without a queue.

The way mine is setup is it has a Lockdown 1, and a Lockdown 2 - the Lockdown 2 is for floods, Lockdown 1 is for meetings.

Safelisted users can enter Protoect 1 but not 2.

Flood bot enters
Spams
LEaves
Lockdown 2 is activated by the time that is between the join and leave; meaning instead of the regular method of discovering flooders by counting the times they join, it takes the time they left subtract the time they joined and if that time is less than a certain value, lockdown 2 kicks in automatically, and uses the method i explained above:

Adds Flooder's username to shitlist(first) *Note: this is to knock the idiots using floodbots that don't randomize names right off the bat

waits for next rejoin
waits for next rejoin
waits for next rejoin

takes the times the flooders joined, calculates the interval at which they join and leave, then instead of sending the banend when it recognizes they have entered the channel, the bot uses the recorded times and the interval it calculated to send the ban a few nanoseconds before the user actually joins in an effort to take into account network latency.

The result is that the user is usually banned, and squelched. as son as the bot has banned 50 people, it clears the ban lists but keeps the users squelched and shitlisted.

It is buggy at times but I did this using a queue and it works most of the time.
February 6, 2004, 5:07 AM

Search