Valhalla Legends Forums Archive | Battle.net Bot Development References | Queue Sharing

AuthorMessageTime
TriCk
vb6,
ok heres the lowdown, i made the bot connect 4 bots using
[code]
For i = 1 = Winsock.UBound
Load winsock(i) type code.
Next i
[/code]
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.
November 8, 2003, 11:38 AM
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.
November 8, 2003, 12:44 PM
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
November 8, 2003, 12:48 PM
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.
November 8, 2003, 1:49 PM
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.
November 8, 2003, 10:01 PM
Tuberload
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.
November 8, 2003, 10:14 PM
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.
November 8, 2003, 10:43 PM
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).
November 8, 2003, 10:56 PM
TriCk
Hmm, my way didn't work anyway...
Now none of the bots send the data >:(
November 8, 2003, 11:00 PM
St0rm.iD
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 :)
November 9, 2003, 9:00 PM

Search