| View previous topic :: View next topic |
| Author |
Message |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Feb 21, 2011 4:26 pm Post subject: |
|
|
| Code: | 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?  _________________ speechles' eggdrop tcl archive
Last edited by speechles on Mon Feb 21, 2011 4:36 pm; edited 2 times in total |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Mon Feb 21, 2011 4:31 pm Post subject: |
|
|
| yeah i rehashed and setted +voiceop before testing it |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Feb 21, 2011 4:40 pm Post subject: |
|
|
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?
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 ) 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.
Sure, I had my share of mistakes, but I did had my share of glory too. Stupid, genius, dumbass... that's me.
Edit: Damn flue.. I've been so sloppy recently...
@.pt : Replace:
| Code: |
if {[channel get $chan voiceop]} return
|
with:
| Code: |
if {![channel get $chan voiceop]} return
|
and should work. I edited my previous post and fixed it there too. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Mon Feb 21, 2011 7:13 pm; edited 1 time in total |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Mon Feb 21, 2011 4:52 pm Post subject: |
|
|
perfect ty u so much for the patient  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Feb 21, 2011 5:12 pm Post subject: |
|
|
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: |
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. |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Sun Feb 27, 2011 2:39 pm Post subject: new feature |
|
|
could u pls make it so it ignores other bots while checking the users?
ty in advance |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Feb 27, 2011 2:50 pm Post subject: |
|
|
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: |
if {[isbotnick $user]} continue
|
with:
| Code: |
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. |
|
| Back to top |
|
 |
|