| View previous topic :: View next topic |
| Author |
Message |
romprod Halfop
Joined: 19 Oct 2001 Posts: 49
|
Posted: Sat May 13, 2006 4:55 pm Post subject: Join chan, get op'd in diff chan |
|
|
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 |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
Posted: Sat May 13, 2006 5:10 pm Post subject: |
|
|
| 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 |
|
 |
romprod Halfop
Joined: 19 Oct 2001 Posts: 49
|
Posted: Sat May 13, 2006 5:31 pm Post subject: |
|
|
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 |
|
 |
romprod Halfop
Joined: 19 Oct 2001 Posts: 49
|
Posted: Sun May 14, 2006 2:07 pm Post subject: |
|
|
| 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 |
|
 |
krimson Halfop

Joined: 19 Apr 2006 Posts: 86
|
Posted: Sun May 14, 2006 2:12 pm Post subject: |
|
|
| 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 |
|
 |
romprod Halfop
Joined: 19 Oct 2001 Posts: 49
|
Posted: Tue May 16, 2006 4:17 pm Post subject: |
|
|
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 |
|
 |
krimson Halfop

Joined: 19 Apr 2006 Posts: 86
|
Posted: Tue May 16, 2006 4:48 pm Post subject: |
|
|
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 |
|
 |
|