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.

Please help with Bot A and Bot B

Old posts that have not been replied to for several years.
Locked
t
therion

Post by therion »

I have a problem with 2 of my bots. I have a TCL script doing all those public commands like !OP !DEOP and I want Bot B to act as a backup for Bot A whenever Bot A is down Bot B will replace bot A's duty to carry out !OP !DEOP

How can that be possible?
E
EdGei

Post by EdGei »

I don't know if this may be right, but why not install that script into Bot B?

Anyone? I mean this seems logical.
f
fudded

Post by fudded »

I suppose you could use it on both bots and add a little code using [botonchan] to check which one to load, just an idea *shrug*
t
therion

Post by therion »

EdGei,

Yes I tried and both bots will like responsing to the particular user when they type !op !opme because I designed the TCL script to function in a way that, for example if they type !opme both bots will response like 'Sir, yes Sir!' I just want the Bot A to response and B as a backup service.

fudded, how to code that can roughly give me a guided on that?
f
fudded

Post by fudded »

As im learning TCL my self i wont embarass myself and confuse you with my code, but check out tcl-command.doc, the command i think you need is [botisop] not as i said in my last post.
Im sure that some guru will help better than me
User avatar
slennox
Owner
Posts: 593
Joined: Sat Sep 22, 2001 8:00 pm
Contact:

Post by slennox »

Here is something from an old script of mine.

First you set the order of priority for the bots with

Code: Select all

set prefix_priority "BotA BotB"
Then you place this proc somewhere in the script:

Code: Select all

proc prefix_priority {chan} {
  global botnet-nick prefix_priority
  if {$prefix_priority == ""} {return 1}
  foreach bot $prefix_priority {
    if {[string tolower $bot] == [string tolower ${botnet-nick}]} {return 1}
    if {[set nick [hand2nick $bot $chan]] != "" && [isop $nick $chan] && ![onchansplit $nick $chan]} {return 0}
  }
  return 1
}
Finally, in the procs that respond to the public command, you place the following check where appropriate:

Code: Select all

if {![prefix_priority $chan]} {return 0}
This will stop the script at that point if another bot which has priority is present on the channel. You might want to return 1 in some cases, depending on the type of bind the proc is called from.

Also, you should replace "prefix_" with a name appropriate to your script.
t
therion

Post by therion »

fudded,

Thanks anyway. I try to do some reading in that file u stated.

Meantime anyone can give a better suggestion?
t
therion

Post by therion »

A big thanks to you! YES YOU! Slennox! you solve my problem!

Thanks a trillion!

t
therion

Post by therion »

slennox,

so how do I make Bot B change it nick to Bot A's nick when Bot A is down?
Locked