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.

closing a variable

Old posts that have not been replied to for several years.
Locked
r
rvwinkle

closing a variable

Post by rvwinkle »

Can someone help me finish this code by advising on where/how to add the
"close $emaile" line ?

Code: Select all

   1 set emaile "/www/botread.txt"
   2 set cmd "!email"
   3 set bwhere 0
   4 
   5 bind pub -|- $cmd email
   6 proc email {nick handle host chan text } {
   7 global emaile bwhere
   8 set botread [open $emaile r]
   9 while { ! [eof $botread] } {
  10 set outline [gets $botread]
  11 if {!$bwhere} {
  12 putserv "PRIVMSG $chan :\002$outline\002"
  13 }
  14 }
  15 }
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

add it after it's done reading the file :P

Code: Select all

set emaile "/www/botread.txt"
set cmd "!email"
set bwhere 0

bind pub -|- $cmd email

proc email {nick handle host chan text } {
 global emaile bwhere
 set botread [open $emaile r]
 while {![eof $botread]} {
   set outline [gets $botread]
   if {!$bwhere} {
     putserv "PRIVMSG $chan :\002$outline\002"
   }
 }
close $botread
}
Last edited by greenbear on Tue Jun 22, 2004 7:00 pm, edited 1 time in total.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

errrr
don't you mean

Code: Select all

unset emaile
instead of close, or

Code: Select all

close $botread
:)
Elen sila lúmenn' omentielvo
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

darn i did it again .. gotta stop replying before reading thru the whole thing :oops:

Code: Select all

close $botread
Locked