• Welcome to Valhalla Legends Archive.
 

Another moderation bot...

Started by GSX, May 15, 2006, 07:12 PM

Previous topic - Next topic

GSX

I am currently a mediocore (at best) Visual Basic 6 programmer, and I have coded a bot for Bnet before, and I dislike most all moderation bots out there. So yes, I'm off to code yet ANOTHER one! I have a pretty general idea of how to do this, but I'm not 100% sure about all things, and I've researched all I could.

So here's my layout; moderation bot, no channel list, basic text viewing window (Showing Bnet info, issued commands, bot info), multiple profile loading (no tabbing, just simply loading them out of 1 exe), being able to have profiles respond both individually, and have some grouped bot commands (like NF has for loadbanning), and some other various things that are minor details to others, but are large reasons why I am coding this.

My issues arise at the connections/profile loading.

I currently use BNCSUtil to connect to Battle.net, and I am not sure how well this will work for multiple profile loading (I believe I read somewhere that it is not good at all for this purpose?). Another thing is how I will be loading the profiles. I am wondering if it would be best for me to do it all in one Config.ini, or maybe the way TriCk did it in Mirage with the Profiles folder, using an individual .ini for each one.

Well, this is just a basic overview, with my ideas and possible issues. What do you think of it, and any ideas about my issues are also appreciated. Oh, and I'm not looking for source code handouts, don't want 'em. I want to do this to actually EXCERCISE my Visual Basic skills.

Thanks!

warz

Just make all the bots respond to every command, and for an individual bot to respond to a command put it's name after the trigger..

ie: .ban anonymous - would make every bot try to ban anonymous
     .bot3 ban anonymous - would make only bot 3 try to ban.

topaz

Quote from: warz on May 15, 2006, 07:42 PM
Just make all the bots respond to every command, and for an individual bot to respond to a command put it's name after the trigger..

ie: .ban anonymous - would make every bot try to ban anonymous
     .bot3 ban anonymous - would make only bot 3 try to ban.

Difficult in action, since operator names can get rather long, as well as other users not knowing the indices of the various bots.
RLY...?

GSX

Yeah, right now I'm leaning towards a method of having all bots somehow set in an array I think it is? (Unsure, but here's how I'm sort of thinking)


'This would be like in a CheckCommand sub or something...

Select Case Mid(Message, 1, 1)

     Case Bot(1).Trigger
          'Have the bot check for commands and send it via Bot(1)'s command queue

     Case Bot(2).Trigger
          'Have the bot check for commands and send it via Bot(2)'s command queue

      Case Etc, etc.

End Select


Yeah, I couldn't describe it... But I don't know if this is even possible, so yeah... Thoughts? =/

l2k-Shadow

#4
Quote from: GSX on May 15, 2006, 08:50 PM
Yeah, right now I'm leaning towards a method of having all bots somehow set in an array I think it is? (Unsure, but here's how I'm sort of thinking)


'This would be like in a CheckCommand sub or something...

Select Case Mid(Message, 1, 1)

     Case Bot(1).Trigger
          'Have the bot check for commands and send it via Bot(1)'s command queue

     Case Bot(2).Trigger
          'Have the bot check for commands and send it via Bot(2)'s command queue

      Case Etc, etc.

End Select


Yeah, I couldn't describe it... But I don't know if this is even possible, so yeah... Thoughts? =/


Easiest way (not best) is to have all your crap in a class module and have like a seperate class module for each bot and indexed objects that you need.

You could also just do a user control, but that's worse than a class.
Declares:
Public BOT() as clsBOT
Main Form:
Private Sub Form_Load()
     Set BOT(0) = New clsBOT
End Sub

Unloading Profile:
Set BOT(i) = Nothing
Loading Profile:
ReDim Preserve BOT(i)
Set BOT(i) = New clsBOT


is kind of the thing you need for it... should be understandable enough. note it's not the best way to multi-profile but it's easy and efficient enough.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Eric

It would be cleaner to use a collection.

Hero

Doesn't a collection take up more memory?

rabbit

Yes, but it's also less hassle.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

shout

You could have a 'master bot' recieve all the commands, then have one of the other bots process and send it out.

Psuedocode:

function blahblahblah msg as whatever
If validmsg Then
AddToQueue msg

function otherblah
msg = GetMessageFromQueue
Bot = GetBestBotInstanceForTheJob
ProcessMsg Bot, msg


I don't really know if this is what you are inquirng about though...

GSX

All right, I think I am going to take the .cls method, as that sounds like something I could do...

Now about the multiple connections...

I am not sure as to how to have multiple connections run via 1 winsock. I was thinking of creating an array, but that's not possible (I don't think..., and I don't think that's even the right way to go about it). I have put some serious thought into it, and can't seem to figure it out, which sort of pisses me off.

Any suggestions/thoughts to kick me to the right path?

Networks

Quote from: HeRo on May 16, 2006, 01:13 AM
Doesn't a collection take up more memory?

If your computer can't handle a couple mb's of memory, sell it.

rabbit

Quote from: GSX on May 16, 2006, 07:12 PM
I am not sure as to how to have multiple connections run via 1 winsock.
It's not possible.

QuoteI was thinking of creating an array, but that's not possible
It is.  Control arrays behave differently than variable arrays.  You can't just instantiate a new index and have it poof into existance like you can in variable arrays, you must first create the new index and then Load it.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

warz

GSX, i think what rabbit is telling you is that you cannot use one socket to handle connections for multiple online bots. What you need to do is have multiple sockets. Now, in visual basic the winsock control is a wrapper around functions that handle winsock related tasks. You can create an array of winsock classes, which results in multiple sockets which can allow you to connection multiple clients to bnet at once. I'm sure there's enough code floating around these forums, and other sites, with examples of how to create an array of winsock controls.

You'll need some global identifier that lets you know how many sockets you currently have running, etc, in order to properly handle your array of winsock controls.

GSX

Yeah, I got what he was saying. Thanks much for all the help fellows, I'm now off to research how to create an array of winsock controls (creating/loading them, etc).

I'll post back whenever another issue arises.

Hero

Quote from: Networks on May 16, 2006, 07:28 PM
Quote from: HeRo on May 16, 2006, 01:13 AM
Doesn't a collection take up more memory?

If your computer can't handle a couple mb's of memory, sell it.
I never said it couldn't, I was just wondering if it did, and as rabbit confirmed, it does, good day sir :).