So I'm writing a moderation bot that supports multiple sockets. Once loaded, the bots are expected to act as a single entity; instead of three bots responding to a command, only one would - on the next command, the next bot would respond to that command, and so on. The problem I'm having is, I've been thus far unable to force only one bot to respond, and I'm not sure as to how to do so. The socket receives the Talk event from 0x0F, passes it to an instance-specific class, and acts on it. How would I go about getting it to work?
Quote from: Topaz on April 06, 2006, 10:41:13 PM
So I'm writing a moderation bot that supports multiple sockets. Once loaded, the bots are expected to act as a single entity; instead of three bots responding to a command, only one would - on the next command, the next bot would respond to that command, and so on. The problem I'm having is, I've been thus far unable to force only one bot to respond, and I'm not sure as to how to do so. The socket receives the Talk event from 0x0F, passes it to an instance-specific class, and acts on it. How would I go about getting it to work?
...you're the one writing the bot for CeLe?
Quote from: Topaz on April 06, 2006, 10:41:13 PM
So I'm writing a moderation bot that supports multiple sockets. Once loaded, the bots are expected to act as a single entity; instead of three bots responding to a command, only one would - on the next command, the next bot would respond to that command, and so on. The problem I'm having is, I've been thus far unable to force only one bot to respond, and I'm not sure as to how to do so. The socket receives the Talk event from 0x0F, passes it to an instance-specific class, and acts on it. How would I go about getting it to work?
I was going to do something like this in CookieBot for bans/kicks. Though not with multiprofiles, so more than one person could be loading the bot. :/
I was going to seperate the message of who sent the ban/kick. Depending on the order of ops in the channel would depend on who sent the next message. For instance:
[Operator 1]
[Operator 2]
[Operator 3]
[Operator 4]
If Operator 1 sent the ban/kick message, all the ops would seperate the operator from the ban message to see who sent the ban/kick. It would then see who was next in line for sending the next ban/kick, which would be Operator 2. All bots except it would send the next command.
However, I never got around to adding this feature. If you need some more info, just ask. :P
I'd personally ignore all EID's except for EID_USERTALKS (or whatever it's called), and pass that to a non-instance command parser with a static variable to see what bot should act on it.
Quote from: Furious on April 06, 2006, 11:18:49 PM
Quote from: Topaz on April 06, 2006, 10:41:13 PM
So I'm writing a moderation bot that supports multiple sockets. Once loaded, the bots are expected to act as a single entity; instead of three bots responding to a command, only one would - on the next command, the next bot would respond to that command, and so on. The problem I'm having is, I've been thus far unable to force only one bot to respond, and I'm not sure as to how to do so. The socket receives the Talk event from 0x0F, passes it to an instance-specific class, and acts on it. How would I go about getting it to work?
...you're the one writing the bot for CeLe?
No.
Does anyone else have any idea as to how to do it? I'm really mixed up; I've tried passing the commands to an array, checking for multiple instances, and then pass it to the command checking function.
Public LastBotToBanSomone As String
Public BanOrder() As String
Quote from: rabbit on April 07, 2006, 12:11:30 PM
Public LastBotToBanSomone As String
Public BanOrder() As String
Not viable, since the events are sent simultaneously - and it wouldn't do anything to help me, anyway.
Quote from: Topaz on April 07, 2006, 07:37:09 PM
Quote from: rabbit on April 07, 2006, 12:11:30 PM
Public LastBotToBanSomone As String
Public BanOrder() As String
Not viable, since the events are sent simultaneously - and it wouldn't do anything to help me, anyway.
Check to see who sends the next message.
EDIT: Maybe I'm not understanding what you're trying to do. Can you give an example of how it should work?
Quote from: WiReS on April 07, 2006, 11:03:20 PM
Quote from: Topaz on April 07, 2006, 07:37:09 PM
Quote from: rabbit on April 07, 2006, 12:11:30 PM
Public LastBotToBanSomone As String
Public BanOrder() As String
Not viable, since the events are sent simultaneously - and it wouldn't do anything to help me, anyway.
Check to see who sends the next message.
EDIT: Maybe I'm not understanding what you're trying to do. Can you give an example of how it should work?
<topaz> ?sweepban clan recruitment
<bot1> /ban recruitmentbot1
<bot2> /ban recruitmentbot2
<bot3> /ban recruitmentbot3
<bot1> /ban recruitmentbot4
[.etc]
Where what it currently does now is
<bot1> /ban recruitmentbot1
<bot2> /ban recruitmentbot1
<bot3> /ban recruitmentbot1
<bot1> /ban recruitmentbot2
[.etc]
Use a global queue which has a very small delay which does not change. You can use a Type (see below) which determines message priority and who sends it. Each time the global queue is checked (every 100ms or whatever), messages meant for specific bots will be sent to specific queues and removed from the global.
I'm assuming you're using VB. If not, just tell me.
Public Enum MessagePriority
High
Normal
Low
End Enum
Public Type GlobalQueueMessage
ToBot As Variant
Message As String
Priority As MessagePriority
End Type
I set ToBot as a Variant because you can do a lot of things with it. You can make it an integer or long and use the index if you're using an array of bot objects, or you can do something else (IE: bot's name).
I told him to ignore EID_USERTALKS on bots 2 and 3 and only call the global command parser on bot 1. Then, send the command responces to the next bot in line and increment.
Quote from: Topaz on April 07, 2006, 11:31:55 PM
<topaz> ?sweepban clan recruitment
<bot1> /ban recruitmentbot1
<bot2> /ban recruitmentbot2
<bot3> /ban recruitmentbot3
<bot1> /ban recruitmentbot4
[.etc]
Where what it currently does now is
<bot1> /ban recruitmentbot1
<bot2> /ban recruitmentbot1
<bot3> /ban recruitmentbot1
<bot1> /ban recruitmentbot2
[.etc]
That's sort of what my first post said. Store each operator in an array in the order they appear in the channel list. Check to see who sent the last message. Make the next bot in the array send the next one. If none of them have sent a message, make the first bot send it, or if a message hasn't been sent by any of the bots in say 5 minutes do the same thing.