• Welcome to Valhalla Legends Archive.
 

problem preventing double sends

Started by Gangz, February 04, 2004, 08:21 PM

Previous topic - Next topic

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.
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"


that would by the userjoin
and this next aprt is the send
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


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

Mesiah / haiseM

Quote from: Gangz on February 04, 2004, 08:21 PM
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.
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"


that would by the userjoin
and this next aprt is the send
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


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


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.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Fr0z3N

#2
Quote from: Gangz on February 04, 2004, 08:21 PM
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.
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"


that would by the userjoin
and this next aprt is the send
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


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


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


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


That should work

Edit:
lastmsg would be "/ban "
lastmsg2 would be " Lockdown"

Mesiah / haiseM

Now frozen, how is that going to help him learn his mistake, if you just re-write it for him?
]HighBrow Innovations
Coming soon...

AIM Online Status: 

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?
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Spht

Quote from: iago on February 05, 2004, 06:12 PM
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?

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

Quote from: iago on February 05, 2004, 06:12 PMMy shoes keep falling off, but I don't want to use shoe-laces, how can I make them stay on?

You could try duct tape.

Quote from: iago on February 05, 2004, 06:12 PMAnd my car won't move and I don't want to put gas in it, got a solution for me?

Walk you bum.

iago

Quote from: Spht on February 05, 2004, 06:37 PM
Quote from: iago on February 05, 2004, 06:12 PMAnd my car won't move and I don't want to put gas in it, got a solution for me?

Walk you bum.

The place I work is a 45 minute drive :(
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Stealth

Quote from: iago on February 05, 2004, 07:25 PM
Quote from: Spht on February 05, 2004, 06:37 PM
Quote from: iago on February 05, 2004, 06:12 PMAnd my car won't move and I don't want to put gas in it, got a solution for me?

Walk you bum.

The place I work is a 45 minute drive :(

Better start walking! ;)
- Stealth
Author of StealthBot

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

effect

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 from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

Gangz

#10
Quote from: NuLL on February 05, 2004, 09:45 PM
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.

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

Edit: thats what it has done so far

Tuberload

What happens when you send to much to fast and you are booted from battle.net?
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

Spht

Maybe you should use a queue but not have a send delay if the queue is empty and idle?

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.
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.