i did say it already, just in a round about way.
anyway, i dont know how to do it, which is why im here
any ideas or a script that could give me an example
of how to do it so they decide which bot is the main one?
global botrespond
if {![info exists botrespond([set ct [string tolower $chan,$text]])]} {
putallbots "itsmine $ct" ;# tell all other bots that this bot is calling dibs..
set botrespond($ct) 1
utimer 10 [list unset botrespond($ct)] ;# gotta unset it
} else {
return ;# another bot has called dibs, let's exit ...
}
.. bot code to process the text ..
and you would also need to bind to the botnet communication:
Creating an *list* with what bot is the first, the second and etc., then do a check and see if the 1st one is missing then continue checking if the second bot is also missing, etc. until one before it is not missing and stop the check and let it send the msg. In case he is in line and all the bots before him are missing then he will send the msg.
Once the game is over, the king and the pawn go back in the same box.
caesar wrote:Creating an *list* with what bot is the first, the second and etc., then do a check and see if the 1st one is missing then continue checking if the second bot is also missing, etc. until one before it is not missing and stop the check and let it send the msg. In case he is in line and all the bots before him are missing then he will send the msg.
That's inefficient.. the way already described is better as the first bot to see the text will indicate that is the least laggiest relative to the source of where the text originated, thus giving it a better reaction time.
With a list of predetermined bots, you'd have to account for bots that are down, recently went down, etc... And you would not be able to determine if one of the predetermined bots is on a lagged server and about to split, thus not responding at all.