I want to have a script that bot will allow to get opped only specified nicks
like on one file.txt I will save aop list of the channel and sop list. if anyone from ops changes nick, automatically gets deopped or if he/she is trying to get opped though someone else nickname, bot won't allow and will automatically deop.
a talent can win a game, teamwork wins championchip!
### Set your ops nickname here.
set oplist { "nickname1" "nickname2" "nickname3" "nickname4" }
### Set your channel.
set opchan "#cricketops"
### Do not edit from here.
bind pub - !op op:user
bind nick - * nickchange
proc op:user {nick host handle chan text} {
global oplist opchan temp
if {(([lsearch -exact [string tolower $opchan] [string tolower $chan]] != -1) || ($opchan == ""))} {
set temp 0
foreach i [string tolower $oplist] {
if {[string match *$i* [string tolower $nick]]} {
set temp 1
}
}
}
if {!$temp} { return } {
putquick "MODE $opchan +o $nick"
}
}
proc nickchange {nick uhost hand chan newnick} {
global oplist opchan botnick
if {![isop $newnick $opchan]} { return }
if {(![matchattr $hand b]) && ($nick != $botnick)} {
foreach badchange [string tolower $oplist] {
if {![string match *$badchange* [string tolower $newnick]]} {
putserv "MODE $opchan -o $newnick"
putserv "PRIVMSG $newnick :You're deoped because your new nickname is not in my list, contact my administrator for more."
return 0
}
}
}
}
bind mode - * mode_proc
proc mode_proc {nick host hand chan modechg victim} {
global oplist opchan botnick
if {($victim == $botnick) || ($nick == $botnick)} { return }
if { $modechg == "+o" } {
foreach badop [string tolower $oplist] {
if {[string match *$badop* [string tolower $victim]]} { return }
putserv "MODE $opchan -o $victim"
putserv "PRIVMSG $victim :You're deoped because your new nickname is not in my list, contact my administrator for more."
return 0
}
}
}
putlog "Op users in the list TCL loaded."
Ok, I have edited and modified one tcl by RanaUsman so the credit should go to him mostly. 2ndly, this script is not tested I have currently just added !op feature for those who are in the list, tell me if it is working then I will add more features what you have asked for. Let me know if it's working or if not then what is the error.
After completing this script I was searching Archive I have
You should also take a look into it and for next time please search the Archive before posting here.
Thanks
iamdeath
Edit: I haved added, if the person is oped by someone else and he is not in the list he will be deoped right away, if the person changes nickname and that new nickname is not in the list will be deoped right away, if somoene trys !op will get op only if he has nickname added in the bots list.
So now let me know what else can I do for you.
Edit: Fixed, list bug. Thanks to nml. Edit: Well I have changed it a bit give it a try.
Last edited by iamdeath on Sat Oct 13, 2007 8:09 am, edited 3 times in total.
actually I don't need AUTO OP script. AOP-s will get op themself, I just don't want them to change nicks and I don't want the bot let them stay with op if they change nick or if they join chat with another nickname and identify to their "access nick" to get opped. I hope you get what I want
a talent can win a game, teamwork wins championchip!
That is exactly what i have made for you, op with a pub command !op those whose nicknames are in the list and if they change nickname they will be deoped right away. That isn't autoop and yes the other script has auto op feature not the one I have presented to you.
iamdeath wrote:That is exactly what i have made for you, op with a pub command !op those whose nicknames are in the list and if they change nickname they will be deoped right away. That isn't autoop and yes the other script has auto op feature not the one I have presented to you.
Thank you very much for helping me.
You didn't get my last line
I might have to add on this script also
when the nick is opped by chanserv bot will check if the opped nick is on the list, if the nick isn't, the bot should deop him immediately.He she wont get OPPED until he/she joins with his nick...
a talent can win a game, teamwork wins championchip!
[22:53] Tcl error [nickchange]: unmatched open quote in list
[22:53] Tcl error [nickchange]: unmatched open quote in list
[22:53] Tcl error [nickchange]: unmatched open quote in list
this is what I get when someone changes his/her nick.
a talent can win a game, teamwork wins championchip!
The error is mainly in the oplist "list".
If this variable does not hold a valid list structure, the rest of the script will fail with similar error messages such as those posted.
Also, it is unadvisable to use string commands (such as "string tolower") on lists. If you need non-case sensitive matching, considder using -nocase options with "string match" (and other functions for comparsion that also supports it).
On a second thought, do you really wish to use string match at all, should'nt it me "string equal". After all, it says list of nicks, not list of nick-patterns...
nml375 wrote:The error is mainly in the oplist "list".
If this variable does not hold a valid list structure, the rest of the script will fail with similar error messages such as those posted.
Also, it is unadvisable to use string commands (such as "string tolower") on lists. If you need non-case sensitive matching, considder using -nocase options with "string match" (and other functions for comparsion that also supports it).
On a second thought, do you really wish to use string match at all, should'nt it me "string equal". After all, it says list of nicks, not list of nick-patterns...
but the script is working fine for me thats kinda strange ;/
[22:53] Tcl error [nickchange]: unmatched open quote in list
[22:53] Tcl error [nickchange]: unmatched open quote in list
[22:53] Tcl error [nickchange]: unmatched open quote in list
this is what I get when someone changes his/her nick.
I have no error's this time, but script doesn't let no one get opped, also those who are on the list, have another bug... when normal users change their nick they receive message from the bot like they "have been deopped" ...
a talent can win a game, teamwork wins championchip!
whoelse wrote:I have no error's this time, but script doesn't let no one get opped, also those who are on the list, have another bug... when normal users change their nick they receive message from the bot like they "have been deopped" ...
Show me exactly what code you're using please, don't copy paste mine, show me exactly yours.