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.

autop after voice by chanserv

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

setudef flag voiceop

set chanserv_host "services.somenetwork.net"

bind mode * "% +v" chanserv:voice

proc chanserv:voice {nick uhost hand chan mode target} {
   if {[channel get $chan voiceop] && [string equal -nocase "ChanServ" $nick] && ![isop $target $chan] && [botisop $chan] && [string equal -nocase $::chanserv_host [lindex [split $uhost @] 1]]} {
      foreach n [chanlist $chan] {
         if {![isbotnick $n] && ![string equal -nocase "ChanServ" $n] && [isop $n $chan]} { break } { continue }
         pushmode $chan +o $target
      }
   }
}
ChanServ is there because possibly one day, ChanServ might be in the channel. The script will only OP those ChanServ has voiced.. IF... only the bot or ChanServ are the only things opped.

Final Edit: I may have went over-board on security checks, but that's a good thing.. Isn't it? :?
Last edited by speechles on Mon Feb 21, 2011 4:36 pm, edited 2 times in total.
.
.pt
Halfop
Posts: 71
Joined: Wed Nov 16, 2005 10:14 am

Post by .pt »

yeah i rehashed and setted +voiceop before testing it
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I gave you a friendly tip and you jumped on with blazing guns. Should I laugh at that, considering it some sarcastic joke, or consider your remark as an insult? :roll:

Anyway, I admit at first was sloppy and took like forever to learn stuff, guess cos I was stubborn and didn't listened the people that helped me back then. Nobody is perfect. To be honest I'm not ashamed of my past, cos if I was, then rest assure that I would have removed all the stuff that made me ashamed of myself a long time ago.

I'm not here to race against you nor anybody else, I'm here for the pure pleasure of helping out the community, like IT once did with me. I wouldn't be here if guys like user and ppslim for instance (no offense for anyone not mentioned, I could fill a paper with names :P) patiently explained me stuff over and over again.

I haven't touched any TCL code for years up until recently, so my sloppiness shouldn't be a big surprise. :P

Sure, I had my share of mistakes, but I did had my share of glory too. :P Stupid, genius, dumbass... that's me. :D

Edit: Damn flue.. I've been so sloppy recently...

@.pt : Replace:

Code: Select all

if {[channel get $chan voiceop]} return
with:

Code: Select all

if {![channel get $chan voiceop]} return
and should work. I edited my previous post and fixed it there too.
Last edited by caesar on Mon Feb 21, 2011 7:13 pm, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
.
.pt
Halfop
Posts: 71
Joined: Wed Nov 16, 2005 10:14 am

Post by .pt »

perfect ty u so much for the patient :)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Just I thought, the mask should do the trick. If you plan on on using this only on one channel and can't be bothered with changing channel modes (the '+voiceop' flag) nor having it displayed for other channels too, use this code instead:

Code: Select all

bind mode * "#channel +v" chanserv:voice

proc chanserv:voice {nick uhost hand chan mode target} {
  if {$nick != "ChanServ"} return
  set count 0
  set users [chanlist $chan]
  foreach user $users {
    if {[isbotnick $user]} continue
    if {[isop $user $chan]} {
      incr count
      break
    }
  }
  if {!$count} {
    pushmode $chan +o $target
  }
}
Anyway, your welcome. This time I did my own tests and work flawlessly. :)
Once the game is over, the king and the pawn go back in the same box.
.
.pt
Halfop
Posts: 71
Joined: Wed Nov 16, 2005 10:14 am

new feature

Post by .pt »

could u pls make it so it ignores other bots while checking the users?

ty in advance
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You will have to use two functions for this: one that dose the flag matching (matchattr) and the second that grabs the handle of the user based on the nickname he has (nick2hand). Replace:

Code: Select all

if {[isbotnick $user]} continue 
with:

Code: Select all

if {[isbotnick $user] || [matchattr [nick2hand $user $chan] b|b $chan]} continue
Now your bots should have +b on the channel, or if they are known globally then remove the last '$chan' from the above code.
Once the game is over, the king and the pawn go back in the same box.
Post Reply