tags:

views:

35

answers:

0

Well, my project is an IRC Bot. and all outgoing information gets controlled and formatted to raw data by methods, and then gets sent to one main void, which then sends the data to the server. Im looking for a way to create a SendQ, if that is the correct term for all out going information, here is an example:

Id want say, if i sent 20 messages to the void the first 3-4 messages to be send immediately, then the 4-10 would have a slight pause, and a greater pause, untill everything has a chance to catch up...

so my origanal thought, was have each message add 10 seconds to a clock, and if the time reachs over 30 seconds then start slowing down the send-rate untill the clock reachs under 30 seconds again, and have other intervals as well... like have sendrate 0 be under 30, sendrate 1 would be over 30, then sendrate 2 would be 60 etc... and then like, every second, it would -1 the clock. so, if i send 4 messages in succession, id have to wait 10 seconds untill sendrate was instant again.

summary: im looking a way to slow raw message sending for my bot, so that my bot will not flood off of the server.

PS: id also like to add some sort of (optional) message priority setting somehow, so that higher priority messages in the Que will get sent before others