Valhalla Legends Forums Archive | Visual Basic Programming | A "massload" question.

AuthorMessageTime
Yegg
I just had a quick question before i have to leave. im currently making a small massload/moderation bot and when the bot detects a banned, invalid key or a username it cant connect with, when i remove that name/cdkey should i do wsBNET.Close after that and then WSBNET.Connect or would wsBNET.Close disconnect all the bots? i'll give an example.

[code]        Case Chr(4)
            On Error Resume Next
            AddChat "Key banned!" & vbNewLine, vbRed
            Open "badkeys.txt" For Append As #1
            Print #1, "lstKeys.List(keys)"
            Close #1
            lstKeys.RemoveItem (keys)
            wsBNET.Close
            wsBNET.Connect server, "6112"[/code]

This is the code i currently have, i jus need to know if i should have the wsBNET.Close or not. if ne1 can, please giv a respone soon.
November 12, 2004, 8:21 PM
The-FooL
wsBNET.close will only close wsBNET, nothing more.
November 12, 2004, 8:56 PM
Dyndrilliac
[quote author=Yegg link=topic=9524.msg88667#msg88667 date=1100290877]
I just had a quick question before i have to leave. im currently making a small massload/moderation bot and when the bot detects a banned, invalid key or a username it cant connect with, when i remove that name/cdkey should i do wsBNET.Close after that and then WSBNET.Connect or would wsBNET.Close disconnect all the bots? i'll give an example.

[code]        Case Chr(4)
            On Error Resume Next
            AddChat "Key banned!" & vbNewLine, vbRed
            Open "badkeys.txt" For Append As #1
            Print #1, "lstKeys.List(keys)"
            Close #1
            lstKeys.RemoveItem (keys)
            wsBNET.Close
            wsBNET.Connect server, "6112"[/code]

This is the code i currently have, i jus need to know if i should have the wsBNET.Close or not. if ne1 can, please giv a respone soon.
[/quote]

You will be using a seperate socket for each connection. Eight bots = Eight seperate sockets, minimum.
November 12, 2004, 9:42 PM
Yegg
when u say i'd need separate sockets, how does zds bot continuously connect, wouldn't my bot do the same until it ran out of accounts/cdkeys?
November 13, 2004, 3:41 AM
Quarantine
Index a winsock.
November 13, 2004, 4:36 AM
The-FooL
If he's using MDI childs, he may not have to index the winsocks.  But then he would have to reference each form in order to close all the connections down.  But what exactly is it hes getting at?
November 13, 2004, 11:40 AM
Minux
Yegg use index and do something like this

[code]
For i = 0 To GetINI("Main", "NumBots") - 1
Load wsBNET(i)
Next i
[/code]

It's been a while since I've done VB stuff but I think that hsould work for you to initialize the sockets for individual use for each cdkey/password/connection.
November 16, 2004, 2:28 AM
LivedKrad
Your question was how to close down the individual connection, right? Well, if you're indexing a winsock, (meaning you have only one parent form), then you'll need to close the socket of that individual index.
[code]
Private Sub Command1_Click()
'wsBNET(IndexOfDesiredConnection).Close
End sub
[/code]
I *think* that's the code to do it, I haven't done any VB6 programming in quite some time, so that may be the incorrect procedure (syntax-wise). You may be asking however, "How do I know which specific socket to close?". Well, each time you connect with a different username/password/cdkey combination, you'll need to index that current bot's Index ID. Then, when you decide which username to disconnect, you can just reference to that bot's Indedx number and close its connection.

As in my other posts, if there are any inconsistencies and/or mistakes, let me know.
November 17, 2004, 5:13 PM

Search