Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Yegg on November 12, 2004, 02:21 PM

Title: A "massload" question.
Post by: Yegg on November 12, 2004, 02:21 PM
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.

        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"


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.
Title: Re: A "massload" question.
Post by: The-FooL on November 12, 2004, 02:56 PM
wsBNET.close will only close wsBNET, nothing more.
Title: Re: A "massload" question.
Post by: Dyndrilliac on November 12, 2004, 03:42 PM
Quote from: Yegg on November 12, 2004, 02:21 PM
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.

        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"


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.

You will be using a seperate socket for each connection. Eight bots = Eight seperate sockets, minimum.
Title: Re: A "massload" question.
Post by: Yegg on November 12, 2004, 09:41 PM
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?
Title: Re: A "massload" question.
Post by: Warrior on November 12, 2004, 10:36 PM
Index a winsock.
Title: Re: A "massload" question.
Post by: The-FooL on November 13, 2004, 05:40 AM
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?
Title: Re: A "massload" question.
Post by: Minux on November 15, 2004, 08:28 PM
Yegg use index and do something like this


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


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.
Title: Re: A "massload" question.
Post by: LivedKrad on November 17, 2004, 11:13 AM
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.

Private Sub Command1_Click()
'wsBNET(IndexOfDesiredConnection).Close
End sub

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.