| View previous topic :: View next topic |
| Author |
Message |
rewt Voice
Joined: 24 Mar 2012 Posts: 1
|
Posted: Sat Mar 24, 2012 12:52 pm Post subject: Auto-Modifier public commands and channel specification. |
|
|
I have been attempting to set up Auto-Op, Auto-Halfop, Auto-Voice commands and after scrounging through the archive and a little modification I am using the following:
| Code: |
bind pub m|m .ao autooppub
proc autooppub {nick uhost handle chan arg} {
set handle [lindex $arg 0]
set hostmask [lindex $arg 1]
if {[validuser $handle]} {
chattr $handle +ao
puthelp "privmsg $chan :$nick: User has been auto-op'd."
return 0
}
if {![validuser $handle]} {
puthelp "privmsg $chan :$nick: User does not exisit in my database."
return 0
}
}
|
Which has worked great for modifying user attributes across the board, I am having trouble limiting them to a specific channel however. For example, when I add the $chan var after the flags I would expect it to assign those flags to the channel pulled from the public command, however it just adds it to the users global rights.
| Code: |
chattr $handle +ao $chan
|
I even tried hard-coding a channel name and got the same result. I am a little new to tcl scripting, if someone could help correct my syntax or explain what I am doing wrong, I would greatly appreciate it.
Basically, I just don't want the auto-voiced/halfop'd/op'd users to have that access on all my bots chans . Thanks in advance. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Mar 24, 2012 1:55 pm Post subject: Re: Auto-Modifier public commands and channel specification. |
|
|
| rewt wrote: |
| Code: |
chattr $handle +ao $chan
|
|
Try:
| Code: |
chattr $handle -|+ao $chan
|
Also, please note -
This is not good:
| Code: |
set handle [lindex $arg 0]
|
lindex is for working on a tcl list, and the value in your variable is not a list. You are "getting away with it".
Try:
| Code: |
set handle [lindex [split $arg] 0]
|
Reference:
http://www.peterre.info/characters.html
(worth bookmarking) |
|
| Back to top |
|
 |
|
|
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
|
|