Getting first Line of a on-the-web-located file

Help for those learning Tcl or writing their own scripts.
a
aap
Voice
Posts: 13
Joined: Sun Jun 18, 2006 8:21 pm

Post by aap »

Wauw!

That is exactly what I needed!
Really thanks a lot!

aap

PS. if you need something from me ;)
User avatar
SaPrOuZy
Halfop
Posts: 75
Joined: Wed Mar 24, 2004 7:38 am
Location: Lebanon

Post by SaPrOuZy »

i think you should declare check as global
try it.

Code: Select all

bind time - * man ;# runs every minute 
proc man {m h d mo y} { 
 global check
   set a [info exists check] 
   set fs [open file.txt r] 
   gets $fs line(first) 
   close $fs 
   if { $a == 1 } { 
      if { $check != $line(first) } { 
         putserv "PRIVMSG #channel1 :$line(first)" 
         unset check 
         set check "$line(first)" 
      } 
   } elseif { $a == 0 } { 
      set burpie "a is 0" 
      putserv "PRIVMSG #channel1 :$burpie" 
      set check "$line(first)"      
   } else { 
      set burp "damnit, a is not 0 or 1" 
      putserv "PRIVMSG #channel1 :$burp" 
   } 
} 
EDIT: woops, i didn't see the second page of the post. :oops:
Post Reply