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 

Join chan, get op'd in diff chan

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
romprod
Halfop


Joined: 19 Oct 2001
Posts: 49

PostPosted: Sat May 13, 2006 4:55 pm    Post subject: Join chan, get op'd in diff chan Reply with quote

Hey guys, i'm looking for a script that will op an user in #a when they join #b automatically.

I've had a look around and chan't seem to find any, any help would be apreciated.

Thnks
Back to top
View user's profile Send private message
avilon
Halfop


Joined: 13 Jul 2004
Posts: 64
Location: Germany

PostPosted: Sat May 13, 2006 5:10 pm    Post subject: Reply with quote

Code:
bind join - "#b *" chanJoin

proc chanJoin {nick host hand chan} {
  if { [validchan #a] && [botisop #a] && [onchan $nick #a] } {
    pushmode #a +o $nick
  }
}
Back to top
View user's profile Send private message
romprod
Halfop


Joined: 19 Oct 2001
Posts: 49

PostPosted: Sat May 13, 2006 5:31 pm    Post subject: Reply with quote

Thanks for that, works a treat.

Is it possible to make it check #b and if they're allready in that channel, op on join of #a?

Also if the user is not in #b it de-op's in #a if allready op'd?
Back to top
View user's profile Send private message
romprod
Halfop


Joined: 19 Oct 2001
Posts: 49

PostPosted: Sun May 14, 2006 2:07 pm    Post subject: Reply with quote

Code:
bind mode - *+o* opCheck

proc opCheck {nick host hand chan} {
  if { [validchan #a] && [botisop #a] && [validchan #b] && [onchan $nick #a] } {
    if {[isop $nick #b] == 0} {
      putmsg #b "$nick is got opped in #a and is not in this chan"
      pushmode #a -o $nick
      putserv "kick #a $nick :Permission denied!!"
    }

  }
}


Can anybody see anything wrong with this? I get the following error message

Tcl error [opCheck]: wrong # args: should be "opCheck nick host hand chan"
Back to top
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Sun May 14, 2006 2:12 pm    Post subject: Reply with quote

Quote:
(14) MODE (stackable)
bind mode <flags> <mask> <proc>
proc-name <nick> <user@host> <handle> <channel> <mode-change> <victim>

you lack two arguments in the proc. using the model above would fix your problem


Last edited by krimson on Wed May 17, 2006 2:03 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
romprod
Halfop


Joined: 19 Oct 2001
Posts: 49

PostPosted: Tue May 16, 2006 4:17 pm    Post subject: Reply with quote

Sorry, i know nothing about tcl, can you guys point out the changes i would have to make to the script. I had a quess as to what i would need to do but i'm obviously wrong.

thnx
Back to top
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Tue May 16, 2006 4:48 pm    Post subject: Reply with quote

replace the proc header
Code:
proc opCheck {nick host hand chan} {
with
Code:
proc opCheck {nick host hand chan mode victim} {


you could also optimise the proc a little:
Code:
bind mode - +o opCheck

proc opCheck {nick host hand chan mode victim} {
    if {[botisop #a] && [onchan $victim #a]} {
        if {[validchan #b] && ![isop $victim #b]} {
            puthelp "PRIVMSG #b :$victim got opped in #a and is not in this chan"
            pushmode #a -o $victim
            putkick #a $victim Permission denied!!
        }
    }
}


if i'm correct, you wouldn't need to check if #a is a valid chan.. if it isn't, then the bot wouldn't be opped in it, so the whole proc would not run
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
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