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.

helproom

Old posts that have not been replied to for several years.
Locked
L
LiquidIce
Halfop
Posts: 48
Joined: Fri Jan 09, 2004 7:22 pm
Location: USA

helproom

Post by LiquidIce »

Heres the script i need help with.
error i get when i do !online or !offline is
Tcl error [online:proc]: can't read "nick_to_help": no such variable

Code:
#helproom.tcl
set room1 "#room"
set room2 "#room.staff"

bind pub - !help help:proc
bind pub - !offline offline:proc
bind pub - !online online:proc


proc help:proc {nick uhost hand chan text} {
global room1 room2 nick_to_help
if {[string equal -nocase $chan $room1] && ![info exists nick_to_help]} {
putserv "PRIVMSG $room2 :\002NOTE\002: \002$nick\002 need's help in \002$room1\002. (Message: \002[lrange $text 0 end]\002)"
set $nick
}
}

proc online:proc {nick uhost hand chan text} {
global room1 room2 nick_to_help
if {[string equal -nocase $chan $room2] && [isop $nick $room2] && [info exists $nick_to_help]} {
putserv "PRIVMSG $room1 :\002$nick_to_help\002, please be *patient*. An \002op\002 will be with you in just a \002minute\002."
unset $nick
}
}

proc offline:proc {nick uhost hand chan text} {
global room1 room2 nick_to_help
if {[string equal -nocase $chan $room2] && [isop $nick $room2] && [info exists $nick_to_help]} {
putserv "PRIVMSG $room1 :\002$nick_to_help\002, please try back again *later*. There are \002no ops\002 currently to assist you at the \002moment\002."
unset $nick
}
}
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

substitute [info exists $nick_to_help] with [info exists nick_to_help]
L
LiquidIce
Halfop
Posts: 48
Joined: Fri Jan 09, 2004 7:22 pm
Location: USA

Post by LiquidIce »

!online or offline command doesnt work

but when i do !help blah blah i get this error

Tcl error [help:proc]: can't read "LiquidIce": no such variable
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

apparently your help:proc doesn't work either

substitute set $nick and unset $nick with unset nick, but that will fix syntax errors only, I doubt the script will be functional at all
L
LiquidIce
Halfop
Posts: 48
Joined: Fri Jan 09, 2004 7:22 pm
Location: USA

Post by LiquidIce »

It shows blahnick needs help in room. but in the staff room you cant do !online or !offline doesnt work or get any error. What can i do to get the help:proc to work?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

assuming your staff channel is called #room:

Code: Select all

set staff #room
set online 0
bind pubm - * foo
proc foo {n u h c t} {
   set cmd [lindex [split $t] 0]
   switch -- $cmd {
   "!help" {
      if $::online {
         puthelp "privmsg $n :hold on $n, someone will be with you shortly"
         puthelp "privmsg $::room :$n needs help on $c (msg: [join [lrange [split $t] 1 e]])"
      } {
         puthelp "privmsg $n :sorry $n, we're currently busy, please try again later"
      }
   }
   "!online" {if {$c == $::staff} {set ::online 1}} 
   "!offline" {if {$c == $::staff} {set ::online 0}}
   }
}
Locked