rendered paste body
bind pub - !xaccess pub:xaccess
bind pub - !xcommands pub:xshowcommands
bind raw - NOTICE rawnotice:xaccess
proc pub:xaccess {nick uhost hand chan rest} {
if {$rest == ""} {set rest "$chan *"}
putquick "PRIVMSG x :access $rest"
putlog "xaccess : Asking X for access on $target for $chan "
set ::xaccessnick $nick
set ::xaccesschan $chan
}
proc pub:xshowcommands {nick uhost hand chan rest} {
if {$rest == ""} {set target $chan} else {set target [lindex $rest 0]}
putquick "PRIVMSG x :showcommands $target"
putlog "xcommands : Asking X for commands on $target for $nick ($hand)"
set ::xaccessnick $nick
set ::xaccesschan $chan
}
proc rawnotice:xaccess {from key rest} {
if {$from == "X!cservice@undernet.org"} {
putlog "Notice from $from key($key) rest($rest)"
if {[info exists ::xaccessnick]} {
set nick $::xaccessnick
catch {
#if {[lindex $rest 1] == ":Channel"} {set ::xaccesschan [lindex $rest 2]; putlog "xaccess chan [lindex $rest 2]"}
if {[lindex [split $rest " "] 3] == "ACCESS:"} {
puthelp "NOTICE $nick :\0035- X - [lindex [split $rest " "] 2] - [join [lrange [split $rest " "] 3 end]]"
}
if {[string first {doesn't appear to be registered} $rest] != -1} {
puthelp "NOTICE $nick :\0035[lindex $rest 3] isn't registered with X"
}
if {[string first {insufficient access} $rest] != -1} {
putserv "NOTICE $nick :\0035I dont have X access to that channel"
}
if {[lindex $rest 1] == ":Level"} {
puthelp "NOTICE $nick :\0035 X [join [lrange $rest 1 end]"
}
if {[string first {doesn't appear to be registered} [join $rest]] != -1} {
puthelp "NOTICE $::nick :\0035[lindex $rest 1] isn't registered with X"
}
if {[string first {insufficient access} [join $rest]] != -1} {
puthelp "NOTICE $::nick :\0035I dont have X access to that channel"
}
}
} foo
if {$foo != 0} {putlog "Error ! ($foo)"}
if {[info exists ::xshowcommandsnick]} {
set nick $::xshowcommandsnick
set rest [split $rest " "]
}
}
}