Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: PaiD on March 24, 2003, 09:05 PM

Title: Massloading?
Post by: PaiD on March 24, 2003, 09:05 PM
How would you massload? Like zds and chewy can massload an unlimited amout of times. How did they do that? I am not talking about the copying and pasting the exe to a different stop and load them at the same time.
Title: Re:Massloading?
Post by: Camel on March 24, 2003, 11:25 PM
well, you could start out with mdi windows
create a new mdi form, just like you would create a new form, but select mdi form instead. then, make your frmmain or whatever form you want to massload an mdi child. then change your startup form to the mdi form.

to load new windows in the mdi form, run this code from somewhere in the mdi form
Dim NewForm as frmWhatever
Set NewForm = New frmWhatever




or something like that...entirely from memory
Title: Re:Massloading?
Post by: n00blar on March 25, 2003, 12:19 AM
Yes, however chewbacca bot did use multiple forms, it used multiple threads... look up information on CreateThread() in the Windows API.  You should also read up on how to _safely_ use multithreading inside of Visual Basic 6.0 or you will run into some _serious_ problems.  Alternately, if you know the language well changing to .NET shouldn't be to hard and it supports free threading.
Title: Re:Massloading?
Post by: Skywing on March 25, 2003, 11:47 AM
Quote from: n00blar on March 25, 2003, 12:19 AM
Yes, however chewbacca bot did use multiple forms, it used multiple threads... look up information on CreateThread() in the Windows API.  You should also read up on how to _safely_ use multithreading inside of Visual Basic 6.0 or you will run into some _serious_ problems.  Alternately, if you know the language well changing to .NET shouldn't be to hard and it supports free threading.
It's not always necessary or even desirable to create one thread for each bot instance.  Each thread takes up a signifigant amount of overhead, and unless you're using a multiprocessor system, that will only translate to lost performance.  Even if you're using a multiprocessor system, creating more threads than the number of available processors will generally still be hurting performance.

BinaryChat, for example, allows you to start any number of bot instances from one thread - as long as you use asynchronous operations, this poses no problem.

Additionally, it might be a good idea to make the bot's user interface separable from the bot connection.  For instance, you might not want each bot to have it's own window - you might want to share one window for all bots, and switch which bot's information is being displayed based on some user command.
Title: Re:Massloading?
Post by: Camel on March 25, 2003, 02:35 PM
Quote from: Skywing on March 25, 2003, 11:47 AMAdditionally, it might be a good idea to make the bot's user interface separable from the bot connection.  For instance, you might not want each bot to have it's own window - you might want to share one window for all bots, and switch which bot's information is being displayed based on some user command.

in vb, the best way to do that is probably to make the winsock control an array
click on the socket at design time, and set it's "index" property to "0", and then load sockets: Load sckWhatever(Index) then every sckWhatever_event will have index as the first paramater