| View previous topic :: View next topic |
| Author |
Message |
holycrap Op
Joined: 21 Jan 2008 Posts: 152
|
Posted: Sun Aug 01, 2010 7:45 pm Post subject: auto op on certain nick |
|
|
Hi guys,
Can you guys code me a quick tcl file? Here's what I'm looking for.
Some sort of a list (of nicks), and if the nick joined the channel and his/her nick matches the list, the bot will give it op access. The bot checks the nick and not the host of the nick.
Many thanks!
 |
|
| Back to top |
|
 |
Anahel Halfop

Joined: 03 Jul 2009 Posts: 48 Location: Dom!
|
Posted: Sun Aug 01, 2010 8:31 pm Post subject: |
|
|
| Code: | setudef flag tagvoice
bind join - {% somenick*} voice:user
bind nick - {% somenick*} voice:user
proc voice:user {nick uhost hand chan {nn ""}} {
if {$nn == ""} {set nn $nick}
if {![isvoice $nn $chan]} {
pushmode $chan +o $nn
}
} |
it's just modified tcl for voicing ppl, just edit "somenick" to what do you want and it should work (it's working for me when i want to give hop for certain nick in my channel) |
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Sun Aug 01, 2010 10:19 pm Post subject: |
|
|
And change | Code: | | if {![isvoice $nn $chan]} { | to | Code: | | if {![isop $nn $chan]} { |
_________________ Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/ |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sun Aug 01, 2010 11:20 pm Post subject: Re: auto op on certain nick |
|
|
| holycrap wrote: |
...
Some sort of a list (of nicks), and if the nick joined the channel and his/her nick matches the list, the bot will give it op access. The bot checks the nick and not the host of the nick.
Many thanks!
 |
Here's another take on it:
| Code: |
bind join - "% *" opbylist
proc opbylist {nick uhost handle chan} {
set opfile "scripts/opfile.txt"
set opinfo [open $opfile r]
set data [read -nonewline $opinfo]
close $opinfo
set lines [split $data "\n"]
foreach opcheck $lines {
if {"[string tolower $opcheck]"=="[string tolower $nick]"} {
pushmode $chan +o $nick
}
}
}
|
See the line: "scripts/opfile.txt" above. You need to create a plain text file, in your scripts directory, named opfile.txt.
(If you wish to keep the file elsewhere, change the path accordingly)
In this file, put one nick per line
| Code: |
bill
john
jack
billybob
somenick
|
When one of these nicks joins, it will be op'd.
With a couple of quick tests, it worked for me.
Caution: this is a really insecure way to op.
But, if I understood your request correctly, this is exactly what you asked for.
Perhaps if you could describe with more detail exactly what you need, we could come up with better ideas for you. What I have done here, .... if you use it, will let anybody get op'd, simply by leaving, changing their nick to a known op's nick that is not in the channel at the moment, and joining again.
I can't see this as a desirable thing.
Is there a reason that you cannot use Eggdrop's built in userlist? (It is secure.)
I see that you specifically mentioned to avoid using hostmask... why? |
|
| Back to top |
|
 |
holycrap Op
Joined: 21 Jan 2008 Posts: 152
|
Posted: Mon Aug 02, 2010 1:23 am Post subject: Re: auto op on certain nick |
|
|
Thanks, you guys are awesome!
@willyw, it's a long story, but this is exactly what I'm looking for. Much thanks for your time.  |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Mon Aug 02, 2010 11:33 am Post subject: Re: auto op on certain nick |
|
|
| holycrap wrote: |
...
@willyw, it's a long story, but this is exactly what I'm looking for. Much thanks for your time.  |
You are quite welcome.  |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Mon Aug 02, 2010 11:06 pm Post subject: |
|
|
I changed a few things and added the option off adding a nick and deleting a nick via pub commands, rather than having to mess with the actual file itself. I have to say though that you would be better of writing the host of the user rather than the nick... nicks are horribly insecure for opping. </disclaimer>
| Code: |
bind join - "% *" opbylist
proc opbylist {nick uhost handle chan} {
set opfile "scripts/opfile.txt"
set opinfo [open $opfile r]
set lines [split [read -nonewline $opinfo] \n]
close $opinfo
foreach opcheck $lines {
if {[string match -nocase "$nick" $opcheck]} {
putquick "MODE $chan +o $nick"
}
return
}
}
bind pub o|o !addop addop
proc addop {nick host hand chan text} {
set newop [join [lindex [split $text] 0]]
set ops [open "scripts/opfile.txt"]
set nicks [split [read -nonewline $ops] \n]
close $ops
if {![llength $nicks]} {
set ops [open "scripts/opfile.txt" w]
} else {
set ops [open "scripts/opfile.txt" a]
}
foreach line $nicks {
if {[string match -nocase "$newop" $line]} {
putquick "NOTICE $nick :$newop is already in opfile."
return
}
}
puts $ops "$newop"
close $ops
}
bind pub o|o !delop delop
proc delop {nick host hand chan text} {
set delop [join [lindex [split $text] 0]]
set ops [open "scripts/opfile.txt"]
set nicks [split [read -nonewline $ops] \n]
close $ops
if {![llength $nicks]} {
putquick "NOTICE $nick :Opfile is empty, nothing to delete."
return
}
set line [lsearch -exact $nicks "$delop" ]
set newops [lreplace $nicks $line $line]
set ops [open "scripts/opfile.txt" w]
puts $ops [join $newops "\n"]
close $ops
}
|
Hope you like it. 
Last edited by Luminous on Wed Aug 04, 2010 12:55 am; edited 1 time in total |
|
| Back to top |
|
 |
holycrap Op
Joined: 21 Jan 2008 Posts: 152
|
Posted: Tue Aug 03, 2010 5:26 am Post subject: |
|
|
@Luminous, wickedly kewl! And thanks for the heads up guys on the insecure part for adding nicks instead of hosts. On that note... when I'm in partyline with the bot... what's the command to add/remove users from the bot op's list?
Thanks for all the help.  |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
|
| Back to top |
|
 |
|