Author Topic: [VB6] I need help!  (Read 6409 times)

0 Members and 1 Guest are viewing this topic.

Offline igimo1

  • Full Member
  • ***
  • Posts: 420
    • View Profile
[VB6] I need help!
« 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?
« Last Edit: April 06, 2006, 10:43:10 pm by Topaz »

Offline Furious

  • Hero Member
  • *****
  • Posts: 1833
  • I hate rabbits
    • View Profile
Re: [VB6] I need help!
« Reply #1 on: April 06, 2006, 11:18:49 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
[23:04:34] <deadly7[x86]> Newby[x86]
[23:04:35] <deadly7[x86]> YOU ARE AN EMO
[23:04:39] <Newby[x86]> shush it woman

Quote
[17:53:31] InsaneJoey[e2] was banned by x86 (GO EAT A BAG OF FUCK ASSHOLE (randomban)).

Quote from: Ergot
Put it this way Joe... you're on my Buddy List... if there's no one else on an you're the only one, I'd rather talk to myself.

Offline wires

  • Pwnage
  • x86
  • Hero Member
  • *****
  • Posts: 1103
  • cocaine is fun!
    • View Profile
    • Weapon Of Mass Destruction
Re: [VB6] I need help!
« Reply #2 on: April 06, 2006, 11:29:14 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

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [VB6] I need help!
« Reply #3 on: April 07, 2006, 01:14:48 am »
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.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline igimo1

  • Full Member
  • ***
  • Posts: 420
    • View Profile
Re: [VB6] I need help!
« Reply #4 on: April 07, 2006, 03:46:11 am »
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.

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: [VB6] I need help!
« Reply #5 on: April 07, 2006, 12:11:30 pm »
Code: [Select]
Public LastBotToBanSomone As String
Public BanOrder() As String

Offline igimo1

  • Full Member
  • ***
  • Posts: 420
    • View Profile
Re: [VB6] I need help!
« Reply #6 on: April 07, 2006, 07:37:09 pm »
Code: [Select]
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.

Offline wires

  • Pwnage
  • x86
  • Hero Member
  • *****
  • Posts: 1103
  • cocaine is fun!
    • View Profile
    • Weapon Of Mass Destruction
Re: [VB6] I need help!
« Reply #7 on: April 07, 2006, 11:03:20 pm »
Code: [Select]
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?

Offline igimo1

  • Full Member
  • ***
  • Posts: 420
    • View Profile
Re: [VB6] I need help!
« Reply #8 on: April 07, 2006, 11:31:55 pm »
Code: [Select]
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]

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: [VB6] I need help!
« Reply #9 on: April 08, 2006, 07:02:13 am »
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.
Code: [Select]
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).

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [VB6] I need help!
« Reply #10 on: April 08, 2006, 12:20:52 pm »
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.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline wires

  • Pwnage
  • x86
  • Hero Member
  • *****
  • Posts: 1103
  • cocaine is fun!
    • View Profile
    • Weapon Of Mass Destruction
Re: [VB6] I need help!
« Reply #11 on: April 08, 2006, 12:44:12 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.