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.

$fs trouble, I'm stuck

Old posts that have not been replied to for several years.
Locked
J
Jumbo

$fs trouble, I'm stuck

Post by Jumbo »

Heya, I'm trying to do a very simple thing, just getting the bot to write something to a file (a info script).
But when I'm doing the !lean command, the bot just says "TCL Error: can't read $fs, no such variabel" Anyone got a clue here? i can't find anything wrong hehe :) and yes, the DB file has been created.

The proc looks like this:

proc egginfo:add {nick uh handle chan text} {
global egginfo
if {[egginfo:checkaccess $handle flags] == 2} {
putserv "$egginfo(changes) $nick :Sorry mate, You don't hace access"
return 0
}
set word [string tolower [lindex $text 0]]
set def [lrange $text 1 end]
if {$def == ""} {
putserv "$egginfo(changes) $nick :Somethings wrong, Syntax: use $egginfo(add) <word> <defenition>"
return 0
}
set $fs [open $egginfo(file) a]
puts $fs "$word $def"
close $fs
putserv "$egginfo(changes) $nick :I have added $word to the database"
}
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

'$' is used when you want the value of a variable. NOT when you talk about the variable itself. (set variableName, NOT set $variableName (unless that variable contains the name of the variable you're setting ;P))
Have you ever read "The Manual"?
J
Jumbo

Post by Jumbo »

Damn, stupid off me.

Thanx for the reply :)
Locked