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.

Script executes perfectly but gives an unknown error.

Old posts that have not been replied to for several years.
Locked
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Script executes perfectly but gives an unknown error.

Post by awyeah »

This script is working fine and writes to the text file, but still
it is giving me an unknown error, which I am unable to locate.
If you can point it out, it would be great.

Code: Select all

bind notc - * chanserv:verbose:notice

proc chanserv:verbose:notice {nick uhost hand text {chan ""}} {
 global botnick verbosetype verbosechans
  if {($nick == $botnick) || ($chan == $botnick)} { return 0 }
  set serviceverbose [lindex $text 0]; set verbose "VERBOSE"
  set servicearrow [lindex $text 2]; set arrow "=>"; set user [lindex $text 1]; set channel [lindex $text 4]; putlog "a1"
  if {([string equal $nick "ChanServ"]) && ([string match *$serviceverbose* $verbose]) && ([string equal $servicearrow $arrow]) && ([string match -nocase "*!*" $user]) && ([string match -nocase "*@*" $user]) && ([string match -nocase "#*" $channel])} {; putlog "a2"
   set access [lindex $text 3]; set modify [lindex $text 5]; set channel [lindex $text 4]; putlog "a10"
   set from [lindex $text 1]; set nick [lindex [split $from "!"] 0]; set uhost [lindex [split $from "!"] 1]; set person [lindex $text 6]; putlog "a11"
   putlog "$access - $modify - $channel - $from - $nick - $uhost - $person - [getchanhost $person]"
   if {($verbosetype == 1) && ($verbosechans != "") && ([string match "#*" $verbosechans])} { verbose:2 $chan $text }; putlog "a3"
   if {($verbosetype == 2)} { verbose:all:chans $chan $text }; putlog "a4"
   if {(($verbosetype != 1) && ($verbosetype != 2)) || ($verbosetype == 0) || ($verbosetype == "")} { return 0 }; putlog "a5"
   }
}

proc verbose:2 {chan text} {
 global botnick verbosefile verbosechanserv verbosewhy
  set access [lindex $text 3]; set modify [lindex $text 5]; set channel [lindex $text 4]; putlog "a10"
  set from [lindex $text 1]; set nick [lindex [split $from "!"] 0]; set uhost [lindex [split $from "!"] 1]; set person [lindex $text 6]; putlog "a11"
  if {![file exists $verbosefile]} { set file [open $verbosefile w]; puts $file "CHANSERV VERBOSE RECORDS (ChanServ Verbose Log Script)"; catch {close $file} }; putlog 3
  if {([string equal -nocase $access "unban"]) || ([string equal -nocase $access "akick"]) || ([string equal -nocase $modify "wipe"])} { return 0 }; putlog 4
  if {([string equal -nocase $access "aop"]) || ([string equal -nocase $access "sop"]) || ([string equal -nocase $modify "add"]) || ([string equal -nocase $modify "del"])} {; putlog 5
   if {([string equal -nocase $access "aop"])} { set type1 AOP }; if {([string equal -nocase $access "sop"])} { set type1 SOP }; putlog 6
   if {([string equal -nocase $modify "add"])} { set type2 ADDED }; if {([string equal -nocase $modify "del"])} { set type2 DELETED }; putlog 7
   set file [open $verbosefile "a"]; set time [unixtime]; set whytime [ctime $time]; putlog 8
   set date [string trim [lindex $whytime 2]]; set month [string trim [lindex $whytime 1]]; set time [string trim [lindex $whytime 3]]; putlog 9
    if {($verbosewhy == 1)} {
     puts $file "\n\[$date $month $time\] -ChanServ- $text"
     puts $file "\[$date $month $time\] $nick ($from) *$type2* $person to/from the $type1 list of $chan."
     catch {close $file}; putserv "PRIVMSG $verbosechanserv :WHY $channel $nick"
     }
     if {($verbosewhy != 1)} { 
      puts $file "\n\[$date $month $time\] -ChanServ- $text"
      return 0
      }
   }
}
Here is the putlog output in partyline

Code: Select all

<adapter> [17:14] a1
<adapter> [17:14] a2
<adapter> [17:14] a10
<adapter> [17:14] a11
<adapter> [17:14] aop - add - #wiredpatrol - awyeah!eleet@TMnet.Jaring.Maxis.TimeNet.visualunix.net - awyeah - eleet@TMnet.Jaring.Maxis.TimeNet.visualunix.net - device - awyeah@unix.majic.org
[17:14] Tcl error [chanserv:verbose:notice]: can not find channel named "file7"

This seems to be the error

Code: Select all

<adapter> [17:14] Tcl error [chanserv:verbose:notice]: can not find channel named "file7"
Can anyone find or point out which line would the error be line
logically the script looks fine to me. It is working correctly and is
writing the to text file perfectly with all the correct variables.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

do '.tcl set errorInfo' to get a more verbose version of the last error message. Why are you catching 'close' but not 'puts'? if the calls to 'puts' doesn't generate an error, 'close' shure won't either :P
Have you ever read "The Manual"?
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

although it doesn't have to do something with your problem - i think you should close the file even if $verbosewhy != 1 ;)
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Umm... thanks I'll look into the suggestions you have
mentioned and try to implement them.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked