• Welcome to Valhalla Legends Archive.
 

Queue Sharing

Started by TriCk, November 08, 2003, 05:38 AM

Previous topic - Next topic

TriCk

vb6,
  ok heres the lowdown, i made the bot connect 4 bots using

For i = 1 = Winsock.UBound
Load winsock(i) type code.
Next i

Now i need a queue, or help with queueing, so all the bots dont send the same data, but share it.

So...
?say hello
would only send it once instead of a spam.

Soul Taker

A simple thing to do would be check how many things are being queued, and if they are over some amount, divide the messages amongst the bots.

TriCk

True, except i only want 1 bot to send something
for example

in the queue theres

/ban bob1
/ban bob2
/ban bob3
/ban bob4


Each of the 4 bots that are connected send 1 of those
not all 4 so they get banned 4 times as fast

iago

If this is C++ or Java, I would recommend using a static object.  I would suspect that Visual Basic has something similar to that, too.

Another option is to have a global buffer class (again, not sure about vb) and have each bot read from that buffer.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


TriCk

hmm, yea i tried using a listbox and that didnt work, bcoz the bot cant tell when and what bot sends it that way.

Tuberload

#5
You are going to have to be a little more specific in you replies if you want help, and English is preferred. ;D

iago's idea was that you create an object/class that queue's all outgoing messages, and then have your different bot instances pull messages out of the queue and send them. Should not be hard to implement.

Or, you could use a event system. Have a manager determine what messages need to be sent and by who. Then trigger the specified event.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

TriCk

Yeah i used iago's idea, using Collections
I made 4 collections (because i only want 4 bots connecting) and depending on what the integer (of the incoming bot) is it will add to that collection, and if one collection has > 0 Then it goes to the next collection and adds to that one. Then after 1000 (Timer) it sends the Integer (i) to another sub which finally sends off the data.

Kp

To just have a single collection into which all operator commands are dumped, and any bot which is ready to send a message and has operator status pulls from that queue.  Thus you don't become dependent upon your algorithm picking an available bot, since available bots pick messages when they know themselves to be available (using your method, as described, it's possible that an offline bot would be picked to send it, and would therefore not send it til it got back online; using my method, only online bots pull from the collection, so messages go out as soon as possible).
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

TriCk

Hmm, my way didn't work anyway...
Now none of the bots send the data >:(

Banana fanna fo fanna

1 buffer, 1 int variable: sockid

Have a timer or something which empties the buffer. Have it fire like every 10ms or something.

Inside event handler, pop next message off the buffer, send the message on winsock(sockid). If sockid == max, sockid = 1, otherwise sockid = sockid + 1.

Now if you're going to ask how to antiflood each individual message, I'll help you some other time when I feel like thinking :)