Code: Select all
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
}
}
Code: Select all
if {![isvoice $nn $chan]} {
Code: Select all
if {![isop $nn $chan]} {
Here's another take on it: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!
Code: Select all
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
}
}
}
Code: Select all
bill
john
jack
billybob
somenick
holycrap wrote: ...
@willyw, it's a long story, but this is exactly what I'm looking for. Much thanks for your time.
Code: Select all
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
}
This command changes the flags assigned to a user:holycrap wrote: ...
when I'm in partyline with the bot... what's the command to add/remove users from the bot op's list?
Code: Select all
.chattr <handle> [changes] [channel]