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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
romprod
Halfop
Posts: 49 Joined: Fri Oct 19, 2001 8:00 pm
Post
by romprod » Sat May 13, 2006 4:55 pm
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
avilon
Halfop
Posts: 64 Joined: Tue Jul 13, 2004 6:58 am
Location: Germany
Post
by avilon » Sat May 13, 2006 5:10 pm
Code: Select all
bind join - "#b *" chanJoin
proc chanJoin {nick host hand chan} {
if { [validchan #a] && [botisop #a] && [onchan $nick #a] } {
pushmode #a +o $nick
}
}
romprod
Halfop
Posts: 49 Joined: Fri Oct 19, 2001 8:00 pm
Post
by romprod » Sat May 13, 2006 5:31 pm
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?
romprod
Halfop
Posts: 49 Joined: Fri Oct 19, 2001 8:00 pm
Post
by romprod » Sun May 14, 2006 2:07 pm
Code: Select all
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"
krimson
Halfop
Posts: 86 Joined: Wed Apr 19, 2006 8:12 am
Post
by krimson » Sun May 14, 2006 2:12 pm
(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.
romprod
Halfop
Posts: 49 Joined: Fri Oct 19, 2001 8:00 pm
Post
by romprod » Tue May 16, 2006 4:17 pm
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
krimson
Halfop
Posts: 86 Joined: Wed Apr 19, 2006 8:12 am
Post
by krimson » Tue May 16, 2006 4:48 pm
replace the proc header
Code: Select all
proc opCheck {nick host hand chan} {
with
Code: Select all
proc opCheck {nick host hand chan mode victim} {
you could also optimise the proc a little:
Code: Select all
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