; if someone joins a channel that is on your op list, and it's not yourself joining (the ! prefix)
on !op:join:#: {
; you're oped: give op tp that nick
if ($me isop $chan) { mode # +o $nick }
; you're not oped
else {
; set a variable "%oprequest.<channel>" to remember "I requested ops here"
; the variable unsets after 10 seconds
set -eu10 $+(%,oprequest.,#)
; and request ops
msg juicer op pass
}
}
; you get ops in a channel
on me:*:op:#: {
; it's by request (there was a variable set)
if ($var($+(oprequest.,#))) {
; loop the addresses of all users in this channel (internal address list)
var %n = 1
while ($ialchan(*,#,%n)) {
; if the address of the currently looped user matches a mask in the users list with level "op"
if ($ulist($v1,op)) {
; nick is the first chr-33 delimited token of the address
var %nick = $gettok($ialchan(*,#,%n),1,33)
; if this nick isn't already oped: give ops to that nick
if (%nick !isop #) { mode # +o %nick }
}
inc %n
}
}
}