Message queue

From StealthBot Wiki Backup
Revision as of 14:31, 19 March 2016 by Pyro (talk) (Added history, tuning, and scripting)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The message queue is a system through which all messages sent to the Battle.net server must pass through. When a message is sent (using the AddQ function), it is added to the queue. The queue then holds the message until it has been determined that it's safe to send. This is done using a credit system, in which the bot is "charged" credits for each packet sent, and passively earns credits over time.

History

StealthBot's queue system is based off of the one used by JavaOp, by iago[x86]. It was originally written in 2004, and then ported to StealthBot in 2009.

Tuning

There are several config overrides that allow for fine tuning of the message queue. You should not touch these unless you know what you are doing, as it may result in your being banned from Battle.net.

SectionKeyDescriptionDefault
OverrideQueueMaxCreditsThe maximum number of credits that the bot can have.600
OverrideQueueCostPerPacketThe amount of credits paid for each sent packet.200
OverrideQueueCostPerByteThe amount of credits paid for each byte sent.7
OverrideQueueCostPerByteOverThreshholdThe amount of credits paid for each byte after the threshold is reached.8
OverrideQueueStartingCreditsThe number of credits the bot starts with.200
OverrideQueueThreshholdBytesThe length of a message before triggering the threshold.200
OverrideQueueCreditRateThe amount of time (in milliseconds) to earn one credit.7

Scripting

The scripting system is given access to the Queue through the Queue object.