but all the bots have the script loaded there on a botnet linked to each other, now if i where to type !help all bots would show the msg but, i only wan't one to show it but that bot could time out or disconnect or what ever so how do i script it so that only one bot responds and if that one is gone other one takes over and so on and so on .. ?
so !help 5 bots have same script but only one shows they can use botnet but i have no clue how to do this so .. any help would be welcome ..
make the other bots check at different times if the bot that had the !help command is offline, store which bot is doing the !help in a global variable that you send out to the other bots, then when one bot notices that the !help bot is offline bind the !help command on that bot, at the same time ofc sending a msg over the botnet that "I'm now doing the !helping"
......
hehe... hope you understand what I'm trying to say
bot linking bot islinked when link putallbots msg if bot = global var 1 unbind all binds when global variable 0 keep binds && on split bind again .. on startup always bind or beter yet i set global var to botnick who has the binds so when its unlinked i can call up on an event .. maybe i could use flags some how .. not sur that i understand what is writen above ... maybe u can give me an example ..
hehe, I knew my explanation was somewhat unclear
example:
bot1 has !help
bot2 comes online and asks the botnet who has !help
botnet responds that it's bot1, and it also sends a list of ready bots
bot2 sends to botnet that he's now online and ready to handle the !help
botnet responds that bot2 can add itself to the list of ready bots
bot1 goes offline
the entire botnet updates the global variable and the bot that's first on the list now binds the !help
ok ic ..
so if bot 1 goes of line lets say tere is 5 bots ok .. well then they all set the new global var how u know that only one bot will do it and not all bots .. to gether .. to me its a mather of timeing so if bot 1 goes offline or if they all come online together .. and set it all to gether .. then what .. witch bot is to keep the variable .. and how u be doing that cause if the script is simular and one has the var then the other one would say unset it i got it then bot 2 tells that to bot 3 and bot 3 to bot 2 same story .. again none have set it ..
might be bit unclear but .. hope u understand hehe
maybe the next script of caesar is something your looking for. The bot keeps a list of ppl that join part etc.. the channel. if you only set the nick of you bot in the list: if {[matchattr $hand b]} { #add bot in list code }
is a start i think to get a list of the bots who are only in channel
then for help if {$1stbotnick == $botnick} { #code for help }
I can't find my code, however, there was a very kind fellow here last year working on a games module (he worked for a games designer near where I live). This main question was how to make a system that would do exactly the same but using C.
He kindly sent me the C code that handled this function.
It worked by holding an election each time a bot joined, parted, quited, aplit or rejoined the channel.
On leaving events, the list of elected bots is checked, if it is on the list, the list is deleted and a new election is held.
Only bots currently on the channel can be elected.
Each time a command is then called, you call a function to see if it is your turn.
The idea of the election, is to see what the starting order should be. From then on, you just cycle through the list of bots that have been elected, when it is your name that pops up, you reply.
I have found the code (still in amy inbox), though I am not too sure about releasing it. I do know I have permission to release any direct Tcl port, so if I ahve chance, that is what I will do.