This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

[pub_myaccess]: can't read "out": no such variable

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
m
mrleaW
Voice
Posts: 3
Joined: Wed Feb 14, 2018 8:52 am

[pub_myaccess]: can't read "out": no such variable

Post by mrleaW »

Code: Select all

bind pub o|o pub_myaccess

proc pub_myaccess {nick uhost hand chan arg} {
 set thehand [lindex $arg 0]
 if {$thehand == ""} {set thehand $hand}
 foreach c [channels] {
  if {[matchattr $thehand -|N $chan] == 1} {lappend out [join "${c}:Owner [getchaninfo $thehand $chan]" " "]}
  if {[matchattr $thehand -|C $chan] == 1 && [matchattr $thehand -|N $chan] != 1} {lappend out [join "${c}:Master [getchaninfo $thehand $chan]" " "]}
  if {[matchattr $thehand -|M $chan] == 1 && [matchattr $thehand -|C $chan] != 1 && [matchattr $thehand -|n $chan] != 1} {lappend out [join "${c}:Op [getchaninfo $thehand $chan]" " "]}
  if {[matchattr $thehand -|O $chan] == 1 && [matchattr $thehand -|M $chan] != 1 && [matchattr $thehand -|m $chan] != 1 && [matchattr $thehand -|N $chan] != 1} {lappend out [join "${c}:Peon [getchaninfo $thehand $chan]" " "]}
  if {[matchattr $thehand -|P $chan] == 1 && [matchattr $thehand -|O $chan] != 1 && [matchattr $thehand -|o $chan] != 1 && [matchattr $thehand -|C $chan] != 1 && [matchattr $thehand -|N $chan] != 1} {lappend out [join "${c}:Friend [getchaninfo $hand $chan]" " "]}
  }
  if {$out == ""} {set $out "None."}

  notice $nick "Access list for \002$thehand\002."
  foreach line $out {
   notice $nick "[split $line " "]"
  }
}
Last edited by mrleaW on Sun Feb 25, 2018 5:39 pm, edited 1 time in total.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

[pub_myaccess]: can't read "out": no such variable

Post by SpiKe^^ »

Try this slightly modified version of that proc and see what you get...

Code: Select all

bind pub o|o !access pub_myaccess

proc pub_myaccess {nick uhost hand chan arg} {
 set thehand [lindex [split [string trim $arg]] 0]
 if {$thehand eq ""} {  set thehand $hand  }

 if {![validuser $thehand]} {
   puthelp "notice $nick :Invalid handle: $thehand"
   return 0
 }

 foreach c [channels] {
   if {[set cinf [getchaninfo $thehand $c]] ne ""} {  set cinf " - $cinf"  }

   if {[matchattr $thehand -|N $c]} {  lappend out "${c}:Owner$cinf"
   } elseif {[matchattr $thehand -|C $c]} {  lappend out "${c}:Master$cinf"
   } elseif {[matchattr $thehand -|M $c]} {  lappend out "${c}:Op$cinf"
   } elseif {[matchattr $thehand -|O $c]} {  lappend out "${c}:Peon$cinf"
   } elseif {[matchattr $thehand -|P $c]} {  lappend out "${c}:Friend$cinf"  }
 }

 if {[info exists out]} {
   puthelp "notice $nick :Access list for \002$thehand\002."
   foreach line $out {  puthelp "notice $nick :$line  }
 } else {  puthelp "notice $nick :No custom channel flags for \002$thehand\002."  }
}

Last edited by SpiKe^^ on Thu Mar 01, 2018 8:56 am, edited 1 time in total.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Psst! The pub bind is missing the command. :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Thanks Caesar. Fixed above.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
m
mrleaW
Voice
Posts: 3
Joined: Wed Feb 14, 2018 8:52 am

Post by mrleaW »

it works ! thanks alot by now my users can see where they have access. :D Thanks to all!
Post Reply