Valhalla Legends Forums Archive | Battle.net Bot Development | inserting * in / commands

AuthorMessageTime
Camel
this is for you, paid:
(he wanted to know how to add whispers to a text box box seperate from the one used for normal chat)

[code]Public Sub SendText(strText As String, Optional WhisperBack As String = "", Optional ForceTimerUse As Long, Optional DontChange As Boolean = False)
Const m = 200

#If DEBUG_ <> 0 Then
If InStr(strText, Chr(0)) <> 0 Then Debug.Assert False
#End If

If DontChange Then GoTo sendnow

If InStr(strText, "%ver%") Then strText = Replace(strText, "%ver%", version)
If InStr(strText, "%running%") Then strText = Replace(strText, "%running%", GetTime(GetTickCount - StartTime))
If InStr(strText, "%connected%") Then strText = Replace(strText, "%connected%", GetTime(GetTickCount - LogTime))
If InStr(strText, "%uptime%") Then strText = Replace(strText, "%uptime%", GetTime(GetTickCount))
strText = Replace(strText, "%channel%", Channel)
strText = Replace(strText, "%server%", frmSetup.SAddr)
If InStr(strText, "%mp3%") Then strText = Replace(strText, "%mp3%", winamp.GetSongTitle(False))
If InStr(strText, "%mp3full%") Then strText = Replace(strText, "%mp3full%", winamp.GetSongTitle(True))
If InStr(strText, "%cpu%") Then strText = Replace(strText, "%cpu%", GetCPUInfo)

If (WhisperBack = MyName) And (MyName <> "") Then
Addtext D2LtYellow, strText & vbCrLf, True
Exit Sub
End If

If (Left(strText, 1) <> "/") And (WhisperBack <> "") Then
strText = "/m " & WhisperBack & " " & strText
End If

Select Case StrReverse(GetID)
Case "D2DV", "D2XP"
If (Left(strText, 1) = "/") And (InStr(1, strText, " ") > 0) Then
Dim s() As String
s = Split(strText, " ", 2)

Dim Name As String
Name = s(1)
If InStr(1, Name, " ") Then Name = Left(Name, InStr(1, Name, " ") - 1)

If (InStr(Name, "*") = 0) Then
Select Case s(0)
Case "/w", "/m", "/msg", "/whisper", "/whois", "/kick", "/ban", "/unban", "/designate", "/ignore", "/squelch", "/unignore", "/unsquelch"
strText = s(0) & " *" & s(1)
End Select
End If
End If
End Select

sendnow:

SendBuf = SendBuf & MakePacket(&HE, Left(strText, m) & Chr(0))
CheckSend ForceTimerUse
End Sub[/code]
May 4, 2003, 2:21 AM
turtles
*sigh
i recently discovered the Modify option. didnt notice it b4 cuz i was logged on as guest when i was examining the forums.

groks post that comes after this was questioning the post i made. and not the one b4 mine.

inserting * in / commands

is title of discussion

when i first saw it i thought he meant
/ban *username*

so i posted a sub i made to handle wildcards :-\ give me break. i misunderstood the post. :-X

at least the code works. ;D

as some of the other members/moderators suggested. my code could be improved using the LIKE statement. ill look further into it

and for those who still dont have the flood protection algorithm. refer to my other posts.. so far. my algorithm hasnt failed me yet. ;D
May 8, 2003, 10:04 AM
Grok
[quote author=turtles link=board=17;threadid=1225;start=0#msg9385 date=1052388475]
im sure there is a much shorter way to do this.. and... i think i misunderstood the post.. but o well
[/quote]

Ummm, what the hell does that do? If it is just Instr(), I will have to archive this post to the hall-of-coding-shame.
May 8, 2003, 5:19 PM
Yoni
Have you tested it?
May 8, 2003, 9:39 PM
turtles
yea i have :-\
May 8, 2003, 9:52 PM
Yoni
IIRC, your anti-flood algorithm was something like "wait 3 seconds before messages"?
That doesn't work. Test it.
May 8, 2003, 10:33 PM
turtles
[quote author=Yoni link=board=17;threadid=1225;start=0#msg9457 date=1052433226]
IIRC, your anti-flood algorithm was something like "wait 3 seconds before messages"?
That doesn't work. Test it.
[/quote]

if u were thinking the flood protection is for IIRC
erm. sorry. the flood protection is for bnet chat client. i dunno about IIRC
May 8, 2003, 10:44 PM
Yoni
Try using 66 characters per message instead of 65.
May 8, 2003, 10:46 PM
turtles
[quote author=Yoni link=board=17;threadid=1225;start=0#msg9467 date=1052433963]
Try using 66 characters per message instead of 65.
[/quote]

im assuming u are talking about bnet chat and yea. i tried 66. it flooded out b4 the 50th send
May 8, 2003, 10:59 PM
Yoni
Err... IIRC stands for "if I recall correctly". It's an Internet abbreviation.

And if your algorithm floods off, it doesn't exactly work, does it?
May 9, 2003, 12:00 AM
Camel
[quote author=turtles link=board=17;threadid=1225;start=0#msg9465 date=1052433858]
[quote author=Yoni link=board=17;threadid=1225;start=0#msg9457 date=1052433226]
IIRC, your anti-flood algorithm was something like "wait 3 seconds before messages"?
That doesn't work. Test it.
[/quote]

if u were thinking the flood protection is for IIRC
erm. sorry. the flood protection is for bnet chat client. i dunno about IIRC
[/quote]

+1 to turtles for making me fall off my chair laughing
May 9, 2003, 12:26 AM
turtles
mm. oops. i thought it was some type of internet relay chat =P

im not familiar with all the slangs used on the interenet.. glad i can make ya laugh camel =)

and yea. i did test it... and it does work. if u want a shorter delay. u increase the number. the MSperBYTE or w/e name i gave it. should be between .06 and .07

the smaller the number. the less likely u are to flood out.

and i have tested with 66 characters..
i was well aware of it b4 i posted my script.. thats why its included in my post.
https://davnit.net/bnet/vL/phpbbs/index.php?board=17;action=display;threadid=1249

even a delay of 10 seconds wont save u. i dont think 20 seconds would save u either. u would never reach the 500th send. IIRC =) i said it involves a second algorithm. and i dont kno it. and its not worth the hassle to figure out

and i did mention it would flood off if it was more then 65 characters. so cant say i didnt take that into account. the algorithm is made to handle regular messaging. for my bot.. i have setup a limiter that chops off anything past 65 characters.
May 9, 2003, 1:28 AM
tA-Kane
[quote]i have setup a limiter that chops off anything past 65 characters.[/quote]Chopping off characters is eww++
May 9, 2003, 2:14 AM
turtles
[quote author=tA-Kane link=board=17;threadid=1225;start=0#msg9511 date=1052446482]
[quote author=turtles link=board=17;threai have setup a limiter that chops off anything past 65 characters.[quote][/quote]Chopping off characters is eww++
[/quote]

heh. not a bright idea? =\ well. I HATE THE IDEA TOO :'( but its part of the flood protection scheme. i cant help it.. unless someone else can tell me the second algorithm involved in the determining the time to wait...
just a thought... but the second algorithm for sends over 65 characters in length would have wait times that are too long to be called efficient. would get more info sent out safely using the given algorithm and character limit i have set..

with the second algorithm wait times would be around a minute or more?

I remembered testing it once..

i dont remember what i did exactly.. ill give general idea.

pseudo fact1: ;)
bot floods out on 48th send of 200 characters per send

pseudo fact2:
bot will not flood out if u stop at 47th send of 200 characters per send

pseudo test:

47 sends of 200 characters per send

+

10 minutes of me watching tV
(delay time)

+

20 more sends placed into query

=

result:
bot flood outs on the 10th of the 20 sends

the time at which it took to recover enough to send 10 sends of 200 character per send was about 10 minutes.. not worth ur effort to figure out the algorithm now is it =\ get more information sent out if u stick with 65 characters per send

if u want efficiency for your bot. u will stick with the 65 character send limit
May 9, 2003, 2:41 AM
Camel
...
just freakin' reconnect automaticly when you flood off!
May 9, 2003, 5:52 AM
turtles
[quote author=Camel link=board=17;threadid=1225;start=0#msg9530 date=1052459567]
...
just freakin' reconnect automaticly when you flood off!
[/quote]

well. the idea behind this is to not flood off. if u flood off, all that u have banned b4 will become unbanned..
May 9, 2003, 4:59 PM
tA-Kane
[quote author=turtles link=board=17;threadid=1225;start=15#msg9557 date=1052499598]
[quote author=Camel link=board=17;threadid=1225;start=0#msg9530 date=1052459567]
...
just freakin' reconnect automaticly when you flood off!
[/quote]

well. the idea behind this is to not flood off. if u flood off, all that u have banned b4 will become unbanned..
[/quote]

Even if you do figure out Battle.net's flood algorithm, it will still be improbable that you will never ever flood off, simply because of latency.

As such, this is why most bots today remember who's been banned, and ban them again when they reconnect.
May 9, 2003, 7:55 PM
Skywing
[quote author=tA-Kane link=board=17;threadid=1225;start=15#msg9566 date=1052510110]
[quote author=turtles link=board=17;threadid=1225;start=15#msg9557 date=1052499598]
[quote author=Camel link=board=17;threadid=1225;start=0#msg9530 date=1052459567]
...
just freakin' reconnect automaticly when you flood off!
[/quote]

well. the idea behind this is to not flood off. if u flood off, all that u have banned b4 will become unbanned..
[/quote]

Even if you do figure out Battle.net's flood algorithm, it will still be improbable that you will never ever flood off, simply because of latency.

As such, this is why most bots today remember who's been banned, and ban them again when they reconnect.
[/quote]Might I point out that I long ago perfected a very effective method of detecting and accounting for lag for purposes of flood protection over Battle.net?
May 9, 2003, 8:45 PM
tA-Kane
[quote author=Skywing link=board=17;threadid=1225;start=15#msg9571 date=1052513157]
[quote author=tA-Kane link=board=17;threadid=1225;start=15#msg9566 date=1052510110]
[quote author=turtles link=board=17;threadid=1225;start=15#msg9557 date=1052499598]
[quote author=Camel link=board=17;threadid=1225;start=0#msg9530 date=1052459567]
...
just freakin' reconnect automaticly when you flood off!
[/quote]

well. the idea behind this is to not flood off. if u flood off, all that u have banned b4 will become unbanned..
[/quote]

Even if you do figure out Battle.net's flood algorithm, it will still be improbable that you will never ever flood off, simply because of latency.

As such, this is why most bots today remember who's been banned, and ban them again when they reconnect.
[/quote]Might I point out that I long ago perfected a very effective method of detecting and accounting for lag for purposes of flood protection over Battle.net?
[/quote]Oh well. It's still a good idea to remember who you've banned.
May 9, 2003, 9:20 PM

Search