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.

Small script request?

Old posts that have not been replied to for several years.
Locked
A
Abbaddon

Small script request?

Post by Abbaddon »

Hello thar.

This is what I want done.

I run a fairly decent size channel that requires a bot to be oped pretty much all the time.

Lets call Bot 1 "Asmodeus" and Bot 2 "Liana"

Now Asmodeus is the main bot. But sometimes it may go down do to ping timeout, netsplit or even peer. Now when this happends and I want Liana to be able to op itself and take over. Of course it'll have to have the same settings set (Users, same scripts loaded ect.) Liana will need to op itself temporarily until Asmodeus returns in which Liana will deop itself and let Asmodeus resume.


I hope that explained it.

Help wouild gladly be appreciated.

Thanks
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Something like this should do it.
You would need to insert this script into your 2nd bot "Liana".

Code: Select all

bind sign - "*" quit:asmodeus
bind mode - "+o" reop:asmodeus

proc quit:asmodeus {nick uhost hand chan {reason ""}} {
 global botnick
  if {([string equal -nocase "Asmodeus" $nick]) && (![botisop $chan])} {
   putquick "PRIVMSG ChanServ :OP $chan $botnick"
   return 0
   }
}

proc reop:asmodeus {nick uhost hand chan mode target} {
 global botnick
  if {([string equal "+o" $mode]) && ([string equal "ChanServ" $nick]) && ([string equal -nocase "Asmodeus" $target]) && ([botisop $chan])} {
  putquick "MODE $chan -o $botnick"
  return 0
  }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
A
Abbaddon

Post by Abbaddon »

awyeah wrote:Something like this should do it.
You would need to insert this script into your 2nd bot "Liana".

Code: Select all

bind sign - "*" quit:asmodeus
bind mode - "+o" reop:asmodeus

proc quit:asmodeus {nick uhost hand chan {reason ""}} {
 global botnick
  if {([string equal -nocase "Asmodeus" $nick]) && (![botisop $chan])} {
   putquick "PRIVMSG ChanServ :OP $chan $botnick"
   return 0
   }
}

proc reop:asmodeus {nick uhost hand chan mode target} {
 global botnick
  if {([string equal "+o" $mode]) && ([string equal "ChanServ" $nick]) && ([string equal -nocase "Asmodeus" $target]) && ([botisop $chan])} {
  putquick "MODE $chan -o $botnick"
  return 0
  }
}
Thanks!

Okay, it works when Asmodeus leaves. But when he rejoins Liana doesn't deop.

And when Liana get d/c and joins the room and Asmodeus is there. Liana doesn't deop.

Thanks again!
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

The logic is that Liana will only deop herself when Asmodeus is opped. Whether he is opped when he joins, or if he's opped if he's in the channel since a long time we dont care.

One bot will deop, if the other bot is op. This is only for Liana. For Asmodeus you can do the same tcl, by replacing the nicks in the string equal and matching functions and by placing them in Asmodeus.
And when Liana get d/c and joins the room and Asmodeus is there. Liana doesn't deop.
Use this:

Code: Select all

bind mode - "+o" deop:liana

proc deop:liana {nick uhost hand chan mode target} {
 global botnick
  if {([string equal "+o" $mode]) && ([string equal "ChanServ" $nick]) && ([isbotnick $target]) && ([onchan Asmodeus $chan]) && ([isop Asmodeus $chan])} {
  putquick "MODE $chan -o $botnick"
  return 0
  }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked