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.

put lindex1 and lindex2 together?

Help for those learning Tcl or writing their own scripts.
Post Reply
p
pipo
Voice
Posts: 16
Joined: Sat Nov 18, 2006 2:51 pm

put lindex1 and lindex2 together?

Post by pipo »

Happy New Year!!

For announcing some output of the sitebot to a second channel I use:
(example if a NEW release is send)

Code: Select all

    set one [lindex $nam 0]
 if {[string equal NEW $one]} {
  putserv "PRIVMSG #channel1 :$announce"} else {
  putserv "PRIVMSG #channel2 :$announce"}
The problem is it wil announce, in channel1: New upload, New sample, New cover etc.
But I only want the "new upload" to be announce in channel1.

So I need to use the first and second lindex of $nam:
set one [lindex $nam 0]
set two [lindex $nam 1]

But then I dont know how to use it, so it wil announce lindex equal NEW ($one) UPLOAD ($two) to channel1.
Post Reply