egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

exec/log and strange error

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Saibot
Voice


Joined: 23 Aug 2010
Posts: 3

PostPosted: Tue Aug 24, 2010 4:32 pm    Post subject: exec/log and strange error Reply with quote

I wrote this script:
Code:
bind pub o .shutdown shutdown
bind pub o .run run

set logfile "logs/exec/beehive.log"
set log [open $logfile a]
proc shutdown { nick uhost handle chan text } {
   global log logfil
  # set docmd [exec ./shutbeehive]
   putserv "PRIVMSG $chan :\0034Beehive is shutting down... \003"
   puts $log "$nick\n[strftime "%Y %b %d %a %T"]:\n Shutdown"
}

proc run { nick uhost handle chan text } {
   global log logfil
   #set docmd [exec ./runbeehive]
   putserv "PRIVMSG $chan :\0034Beehive is starting...please wait. \003"
   puts $log "$nick\n[strftime "%Y %b %d %a %T"]:\n Start"
   }
close $log

but i have a very strange error:
Code:
Tcl error [run]: can not find channel named "file14"

if i use the .shutdown i have same problem.
i dont understand what is it.
pls help me.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Aug 24, 2010 5:19 pm    Post subject: Reply with quote

Rather obviously, you close the file handle (aka channel) right after you open it.. Thus it is no longer open for write-access when you call either of the two commands.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber