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.

timer crashing

Help for those learning Tcl or writing their own scripts.
Post Reply
f
fusa
Voice
Posts: 2
Joined: Sat Oct 04, 2008 6:42 pm

timer crashing

Post by fusa »

I have two scripts that ran ok before I upgraded to 1.6.19 from 1.6.18. They both ran on timers that announced to the channel changes in 2 different directories. Now I'm getting the following errors, and the scripts fail after their first run. I've tried commenting out the dns module, but I end up with channels.dll being part of the error. This is running on Unreal3.2.7 with Anope 1.7.22 and Denora Stats 1.4.2a. Eggdrop is started with the command: C:\Windrop\eggdrop.exe -nt

Code: Select all

[18:25] @#channel (+trn) : [m/3 o/2 h/0 v/1 n/0 b/0 e/0 I/0]
      8 [main] eggdrop 7448 C:\Windrop\eggdrop.exe: *** fatal error - unable to remap c:\windrop\modules\dns.dll to same address as parent(0xC10000) != 0xD40000
      7 [main] eggdrop 6316 fork: child 7448 - died waiting for dll loading, errno 11
[18:26] Tcl error in script for 'timer4':
[18:26] couldn't fork child process: resource temporarily unavailable
 987537 [main] eggdrop 3608 C:\Windrop\eggdrop.exe: *** fatal error - unable to remap c:\windrop\modules\dns.dll to same address as parent(0xC10000) != 0xD40000
 994896 [main] eggdrop 6316 fork: child 3608 - died waiting for dll loading, errno 11
[18:26] Tcl error in script for 'timer3':
[18:26] couldn't fork child process: resource temporarily unavailable
First script:

Code: Select all

proc newr {} {
 puthelp "PRIVMSG #channel :7,1...directory..."
 set dirxz [glob -nocomplain -types d -path e:/directory/ *]
 foreach dird $dirxz {
        puthelp "PRIVMSG #channel :6,1[file tail $dird]"
  }
 set infor [exec cmd /c dir /-c e:]
 set infodr [exec cmd /c dir /-c d:]
 set infodrx [exec cmd /c dir /-c g:]
 set infodry [exec cmd /c dir /-c f:]
 set infodrz [exec cmd /c dir /-c h:]
 set freer [lindex [lindex [split $infor \n] end] 2]
 set freedr [lindex [lindex [split $infodr \n] end] 2]
 set freedrx [lindex [lindex [split $infodrx \n] end] 2]
 set freedry [lindex [lindex [split $infodry \n] end] 2]
 set freedrz [lindex [lindex [split $infodrz \n] end] 2]
 set freembr [ expr $freer / 1073741824 ]
 set freembdr [ expr $freedr / 1073741824 ]
 set freembdrx [ expr $freedrx / 1073741824 ]
 set freembdry [ expr $freedry / 1073741824 ]
 set freembdrz [ expr $freedrz / 1073741824 ]
 set sumtr [expr {$freembr+$freembdr+$freembdrx+$freembdry+$freembdrz}]
 puthelp "PRIVMSG #channel :7,1...$sumtr GBs..."
 timer 30 newr
}
if {![info exists timloaded]} {
  putlog "timer.tcl timer started"
  timer 5 newr
  set timloaded 1
}
putlog "TimerR loaded."

Second script:

Code: Select all

proc newt {} {
 puthelp "PRIVMSG #channel :7,1...message..."
 set yest [expr [clock seconds] - 86400]
 set dirxx [glob -nocomplain -types d -path e:/dir/dir/ *]
 set filec [glob -nocomplain -types f -path e:/dir/dir/ *]
 foreach dirc $dirxx {
     set mtime [file mtime $dirc]
     if { $mtime > $yest } {
        puthelp "PRIVMSG #channel :6,1/dir/[file tail $dirc]"
    }
  }
 foreach filex $filec {
     set mtime [file mtime $filex]
     if { $mtime > $yest } {
        puthelp "PRIVMSG #channel :6,1/dir/[file tail $filex]"
    }
  }
 set infon [exec cmd /c dir /-c e:]
 set infodm [exec cmd /c dir /-c d:]
 set infodmx [exec cmd /c dir /-c g:]
 set infodmy [exec cmd /c dir /-c f:]
 set infodmz [exec cmd /c dir /-c h:]
 set freen [lindex [lindex [split $infon \n] end] 2]
 set freedm [lindex [lindex [split $infodm \n] end] 2]
 set freedmx [lindex [lindex [split $infodmx \n] end] 2]
 set freedmy [lindex [lindex [split $infodmy \n] end] 2]
 set freedmz [lindex [lindex [split $infodmz \n] end] 2]
 set freembn [ expr $freen / 1073741824 ]
 set freembdm [ expr $freedm / 1073741824 ]
 set freembdmx [ expr $freedmx / 1073741824 ]
 set freembdmy [ expr $freedmy / 1073741824 ]
 set freembdmz [ expr $freedmz / 1073741824 ]
 set sumtn [expr {$freembn+$freembdm+$freembdmx+$freembdmy+$freembdmz}]
 puthelp "PRIVMSG #channel :7,1...$sumtn GBs..."
 timer 20 newt
}
if {![info exists timeloaded]} {
  putlog "timet.tcl timer started"
  timer 5 newt
  set timeloaded 1
}
putlog "TimerT loaded."
Post Reply