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 script

Help for those learning Tcl or writing their own scripts.
Post Reply
L
LiquidIce
Halfop
Posts: 48
Joined: Fri Jan 09, 2004 7:22 pm
Location: USA

helproom script

Post by LiquidIce »

!online and !offline doesnt work on my script.

Code: Select all

#helproom.tcl
set room1 "#services"
set room2 "#staff"

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

set room1 "#services"
set room2 "#Staff"

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 $
unset $nick
}
}
error i get is:

[23:13] Tcl error [help:proc]: can't Tcl error [online:proc]: can't read "nick_to_help": no such variableread "LiquidIce": no such variable
Last edited by LiquidIce on Sun Sep 10, 2006 12:01 am, edited 1 time in total.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

for two and a half years on these forums you haven't bothered to learn how to post code; moreover, some of your script's long lines are truncated
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

1) nowhere in that script is the variable "nick_to_help" set
2) no need to unset the nick variable
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

[code] [/code]tags

Post by Alchera »

LiquidIce: Please edit your post and encompass your code within code tags; the button is just below the subject bar. Your post is difficult to read.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
L
LiquidIce
Halfop
Posts: 48
Joined: Fri Jan 09, 2004 7:22 pm
Location: USA

Post by LiquidIce »

sorry about that forgot about the code button.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

your script is still truncated

load it in an editor that can wrap word/lines, then paste here within

Code: Select all

 tags; or [i]cat[/i] it into your terminal window, then paste from there
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
Post Reply