All pastes #752799 Raw Edit

help2

public text v1 · immutable
#752799 ·published 2007-10-28 19:09 UTC
rendered paste body
# xaccess.tcl
# author: simple@Undernet/#TCL skralg@gmail.com
# date: 19OCT2007
# purpose: display Undernet channel status via X service

bind pub - !xaccess pub:xaccess
proc pub:xaccess {nick uhost hand chan rest} {
 catch {
  if {$rest == ""} {set target $chan} else {set target [lindex $rest 0]}
  putquick "PRIVMSG x :access $target"
  putlog "Asking X for access on $target for $chan "
  set ::xaccesschan $chan
  return 0
 } foo
 if {$foo != 0} {putlog "Error in pub:xaccess! ($foo)"}
}

bind raw - NOTICE rawnotice:xaccess
proc rawnotice:xaccess {from key rest} {
 catch {
  if {$from == "X!cservice@undernet.org"} {
   putlog "Notice from $from key($key) rest($rest)"
   #if {[lindex $rest 1] == ":Channel"} {set ::xaccesschan [lindex $rest 2]; putlog "xaccess chan [lindex $rest 2]"}
   if {[lindex $rest 1] == ":Access:"} {
    putserv "PRIVMSG $chan :\0035- X - [access [lrange $rest 2 end]]"
   }
   if {[string first {doesn't appear to be registered} $rest] != -1} {
    putserv "PRIVMSG $::xaccesschan :\0035[lindex $rest 3] isn't registered with X"
   }
   if {[string first {insufficient access} $rest] != -1} {
    putserv "PRIVMSG $::xaccesschan :\0035I dont have X access to that channel"
   }
  }
  return 0
 } foo
 if {$foo != 0} {putlog "Error in notice:xaccess! ($foo)"}
}

HOW DO I MAKE IT NOTICE THE NICK WITH THE RESULTS for next tcl also please 

# xstatus.tcl
# author: simple@Undernet/#TCL skralg@gmail.com
# date: 19OCT2007
# purpose: display Undernet channel status via X service

bind pub - !xcommands pub:xshowcommands
proc pub:xshowcommands {nick uhost hand chan rest} {
 catch {
  if {$rest == ""} {set target $chan} else {set target [lindex $rest 0]}
  putquick "PRIVMSG x :showcommands $target"
  putlog "Asking X for commands on $target for $nick ($hand)"
  set ::xshowcommandschan $chan
  return 0
 } foo
 if {$foo != 0} {putlog "Error in pub:xcommands! ($foo)"}
}

bind pub - !xcommands pub:xcommands
proc pub:xcommands {from key rest} {
 catch {
  if {$from == "X!cservice@undernet.org"} {
   putlog "Notice from $from key($key) rest($rest)"
   #if {[lindex $rest 1] == ":Channel"} {set ::xshowcommandschan [lindex $rest 2]; putlog "xshowcommands chan [lindex $rest 2]"}
   if {[lindex $rest 1] == ":Level:"} {
    putserv "PRIVMSG $::xshowcommandschan :\0035X  [level [lrange $rest 2 end]]"
   }
   if {[string first {doesn't appear to be registered} $rest] != -1} {
    putserv "PRIVMSG $::xshowcommandschan :\0035[lindex $rest 3] isn't registered with X"
   }
   if {[string first {insufficient access} $rest] != -1} {
    putserv "PRIVMSG $::xshowcommandschan :\0035I dont have X access to that channel"
   }
  }
  return 0
 } foo
 if {$foo != 0} {putlog "Error in notice:xshowcommands! ($foo)"}
}