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.

Tcl error

Old posts that have not been replied to for several years.
Locked
User avatar
AbuAli
Voice
Posts: 35
Joined: Sat Jun 12, 2004 2:49 am

Tcl error

Post by AbuAli »

Hello,
i need to write on a txt .. all the nicks who get oped on my channel.
so i load this script. what the problem ? plz help me..

Code: Select all

set olist "oplist.txt" 

bind mode - "#Channel +o" olist:add 

proc olist:add {nick host hand chan mc vc} { 
  set f [open $::olist a] 
  set i 0 
  while {[gets $f n]>-1} { 
    if {[string match -nocase $vc $n]} { 
      incr i 
    } 
  } 
  if {$i} { 
    puts $f $vc 
  } 
  close $f 
}
Tcl error [olist:add]: channel "file9" wasn't opened for reading


and i need to write with the Time/Date when oped .. can ?
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Try this

Code: Select all

set olist "oplist.txt"

bind mode - "#channel *+o*" olist:add
proc olist:add {nick host hand chan mode text} {
  set f [open $::olist a]
  puts $f "[strftime "\[%y-%m-%d %H:%M\]"] $nick set $mode $text"
  close $f
}
User avatar
AbuAli
Voice
Posts: 35
Joined: Sat Jun 12, 2004 2:49 am

Post by AbuAli »

yeah its working, but i have a small problem..
the bot is writin the same line.. 2 times..
[04-07-12 19:46] ChanServ set +o nick1
[04-07-12 19:46] ChanServ set +o nick1
so whats the problem...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

It's because the nick must have gotted opped twice (two times).
The script will trigger on any +o mode.

So if a user tries to get op, 2 times repeatedly with ChanServ or 10 times in a very quick sucession (and in between that time no one else has gotten opped or the target +o is same again as before), all those lines will be written in the txt file, regardless of whatever the nick is.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Or, more likely, if he's been trying to get his old code to work, he has 2 binds calling the same proc.

Restart the bot and it should work.
Locked