egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

autop after voice by chanserv
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Mon Feb 21, 2011 4:26 pm    Post subject: Reply with quote

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? Confused
_________________
speechles' eggdrop tcl archive


Last edited by speechles on Mon Feb 21, 2011 4:36 pm; edited 2 times in total
Back to top
View user's profile Send private message
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Mon Feb 21, 2011 4:31 pm    Post subject: Reply with quote

yeah i rehashed and setted +voiceop before testing it
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Feb 21, 2011 4:40 pm    Post subject: Reply with quote

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? Rolling Eyes

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 Razz) 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. Razz

Sure, I had my share of mistakes, but I did had my share of glory too. Razz Stupid, genius, dumbass... that's me. Very Happy

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
View user's profile Send private message
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Mon Feb 21, 2011 4:52 pm    Post subject: Reply with quote

perfect ty u so much for the patient Smile
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Feb 21, 2011 5:12 pm    Post subject: Reply with quote

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. Smile
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Sun Feb 27, 2011 2:39 pm    Post subject: new feature Reply with quote

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

ty in advance
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sun Feb 27, 2011 2:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber