This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

one command lots of bots how to make only one respond

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

one command lots of bots how to make only one respond

Post by Ofloo »

if i where to have a cmd !help

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 ..
XplaiN but think of me as stupid
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

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 ;)
Elen sila lúmenn' omentielvo
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

like :

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 ..
XplaiN but think of me as stupid
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

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
.... etc

something like this :)
Elen sila lúmenn' omentielvo
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

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
XplaiN but think of me as stupid
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

ive done few things but not mutch results is there some one who has made an script like this so i can see how they did it ..? just wondering ..
XplaiN but think of me as stupid
User avatar
TALES
Halfop
Posts: 59
Joined: Sun Nov 09, 2003 8:45 am
Location: Netherlands
Contact:

Post by TALES »

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 }
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

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.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

sounds like it but not sur if that is what i mean .. could be tho .. but not sur hehe
XplaiN but think of me as stupid
Locked