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 

Auto-Modifier public commands and channel specification.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop Help
View previous topic :: View next topic  
Author Message
rewt
Voice


Joined: 24 Mar 2012
Posts: 1

PostPosted: Sat Mar 24, 2012 12:52 pm    Post subject: Auto-Modifier public commands and channel specification. Reply with quote

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 Smile. Thanks in advance.
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Mar 24, 2012 1:55 pm    Post subject: Re: Auto-Modifier public commands and channel specification. Reply with quote

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". Smile

Try:
Code:

set handle [lindex [split $arg] 0]


Reference:
http://www.peterre.info/characters.html

(worth bookmarking)
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 -> Eggdrop Help 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