<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/7784" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2004-06-25T10:57:30-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/7784</id>

		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-06-25T10:57:30-04:00</updated>

		<published>2004-06-25T10:57:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37871#p37871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37871#p37871"/>
		<title type="html"><![CDATA[Tcl error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37871#p37871"><![CDATA[
The error message is of a bind.<br>This is the line is the script causing a problem.<br><div class="codebox"><p>Code: </p><pre><code>bind sent - * filesent </code></pre></div>Maybe you are using an old eggdrop version which doesnt<br>support this bind type on a tcl script which does or maybe<br>there is a problem with the bind mask.<br><blockquote class="uncited"><div>SENT (stackable)<br><br>bind sent &lt;flags&gt; &lt;mask&gt; &lt;proc&gt;<br>proc-name &lt;handle&gt; &lt;nick&gt; &lt;path/to/file&gt;<br><br>Description: after a user has successfully downloaded a file from the bot, this binding is triggered. mask is matched against the handle of the user that initiated the transfer and supports wildcards. nick is the actual recipient (on IRC) of the file. The path is relative to the dcc directory (unless the file transfer was started by a script call to 'dccsend', in which case the path is the exact path given in the call to 'dccsend').<br><br>Module: transfer</div></blockquote>You also might want to check if you have enabled your file transfer<br>module in the .conf file and if you have, have you set and configured<br>it properly or not.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Fri Jun 25, 2004 10:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[AbuAli]]></name></author>
		<updated>2004-06-25T10:20:14-04:00</updated>

		<published>2004-06-25T10:20:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37867#p37867</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37867#p37867"/>
		<title type="html"><![CDATA[Tcl error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37867#p37867"><![CDATA[
hello i got this msg when i load this tcl.. so what the problem...<br><strong class="text-strong"><br>[11:09] Tcl error in file 'eggdrop.conf':<br>[11:09] bad type, should be one of: act, away, bcst, bot, chat, chjn, chof, chon, chpt, ctcp, ctcr, dcc, disc, evnt, filt, flud, join, kick, link, load, mode, msg, msgm, need, nick, nkch, notc, note, part, pub, pubm, raw, rejn, sign, splt, time, topc, unld, wall<br>    while executing<br>"bind sent - * filesent"<br>    (file "scripts/fserv.tcl" line 374)<br>    invoked from within<br></strong><div class="codebox"><p>Code: </p><pre><code># ATENCAO !!!##   Voce deve incluir na variavel init-server# da config do seu bot a seguinte linha: # set init-server { init-locator }####  Config  ##### Diretorio de onde estao as MP3s (full-path) -&gt; nao esquecer "/" no finalset diretorio "/home/login/files/"# Diretorio de arkivos da TCLset tcldir "/home/login/eggdrop/scripts/"# Maximo de Arquivos na Fila de Esperaset maxqueue 10# Maximo de DCC Sendset slot 10# Tempo de envio de Mensagemset time 680# Tempo de envio de Radom MP3set time2 5# Canais do BOT (separados por espaco)set home "#channel"# O numero de arquivos do rankset rank 10# O que eu estou servindo ?set servindo "mp3"# Minimo de Caracteres para @locator (evitar flood)set minchar 5# Nْmero mلximo de mْsicas no @locatorset maxmp3s 5### Arquivos #### Arquivo onde guardar arquivos na fila de esperaset queuefile "$nick-Espera.dat"# Arquivo onde colocar a Lista de MP3s do BOTset filesarq "$nick-List.txt"# Arquivo para armanenar Rankingset filerank "$nick-Top$rank.dat"# Arquivo de Quantidade de Arquivosset counterfile "$nick-Counter.dat"# Arquivo de Armazenamento de Sends dos Arquivosset sentfile "$nick-SentFiles.dat"###  Comandos  ##### Comando para Verificacao de MP3sset comando "@locator"# Comando para receber lista de MP3sset listcommand "@$nick"# Comando para receber lista de MP3s - TOPxx (via msg)set toplist "@$nick-top$rank"# Nao Edite as variaves abaixoset tmpdir "${temp-path}"set totalfiles 0set totalsize "0 mb"# end :)####  Funcoes  ##### BINDSforeach chan $home {  bind pubm - "$chan $comando *" locator  bind pubm - "$chan $listcommand" pub_list  bind pubm - "$chan $toplist" topz_list  bind pubm - "$chan @$nick-que*" pub_queue  bind pubm - "$chan @$nick *" pub_send  bind part - "$chan *" part_chan  bind sign - "$chan*" sign_chan}bind bot - sharefiles sharefilesbind dcc n clearqueue dcc_clearqueueproc dcc_clearqueue {hand idx arg} {  global tcldir queuefile  set file [open $tcldir$queuefile w]  close $file  putdcc $idx "*** Lista de Espera limpada."  return 1}proc sharefiles {bot cmd arg} {  global diretorio  if {[string tolower $bot] == "deep-blue"} {    set nofiles [catch {set resultz [glob "$diretorio*"]}]    if {$nofiles} { return 0 }    foreach arq [lsort $resultz] {      putbot $bot "shared [lindex [split $arq "/"] end] [file size $arq]"    }  }}proc sign_chan {nick uhost hand chan reason} {  part_chan $nick $uhost $hand $chan}proc part_chan {nick uhost hand chan {msg ""}} {  global tcldir queuefile  foreach temp [dcclist] {    if {[lindex $temp 3] == "GET" &amp;&amp; [string tolower [lindex $temp 1]] == [string tolower $nick]} {      killdcc [lindex $temp 0]    }  }  set test [catch {string tolower [lindex $nick 0]}]  if {$test} { return 0 }  set file [open $tcldir$queuefile r]  set line 0  set found 0  while {![eof $file]} {    set text [string trim [gets $file]]    if {$text == ""} { continue }    if {[string tolower [lindex $text 0]] != [string tolower $nick]} {      incr line      set lines($line) $text    }    if {[string tolower [lindex $text 0]] == [string tolower $nick]} {      set found 1    }  }  close $file  if {$found} {    set file [open $tcldir$queuefile w]    for {set i 1} {$i &lt;= $line} {incr i} {      puts $file $lines($i)    }    close $file  }  return 0}proc update {} {  global filesarq nick diretorio totalfiles totalsize tcldir  set count 0  set totalsize 0  set list [open $tcldir$filesarq w]  set nofiles [catch {set resultz [glob "$diretorio*"]}]  puts -nonewline $list "======================================================================\r\n"  puts -nonewline $list " Lista de arquivos - $nick\r\n"  puts -nonewline $list " * Digite @$nick no canal para receber o arquivo *\r\n"  puts -nonewline $list "======================================================================\r\n"  if {$nofiles} {    set totalsize "0 mb(s)"    set totalfiles 0    puts -nonewline $list "               No momento, nمo hل arquivos disponيveis.\r\n"    puts -nonewline $list "======================================================================\r\n"    return 0  }  foreach files [lsort $resultz] {    incr count    set filesize [file size $files]    set size [expr $filesize.0 / 1048576]    set totalsize [expr $totalsize + $filesize]    puts -nonewline $list [format "%-59s (%.3f mb)\r\n" [lindex [split $files "/"] end] $size]  }  set totalsize [expr $totalsize.0 / 1048576]  puts -nonewline $list "\r\n"  puts -nonewline $list "======================================================================\r\n"  puts -nonewline $list [format "Total de Arquivos: %3d | Espaço utilizado: %.3f mb(s)\r\n" $count $totalsize]  puts -nonewline $list "======================================================================\r\n"  close $list  putlog "***  Arquivo de MP3s Atualizado  ***"  set totalfiles $count  set totalsize [format "%.3f mb(s)" $totalsize]  mount_ranking  timer 10 update}proc topz_list {nick uhost hand chan rest} {  global tcldir filerank home  set file [open $tcldir$filerank r]  while {![eof $file]} {    set line [gets $file]    if {[string trim $line] == ""} { continue }    putserv "CMSG $nick $chan :$line"  }  close $file}proc pub_list {nick uhost hand chan rest} {  global listcommand filesarq tcldir tmpdir home  foreach temp [dcclist] {    if {[lindex $temp 1] == "$nick"} {      if {[lindex $temp 3] == "GET" &amp;&amp; [lindex [split [lindex [lindex $temp 4] 3] "/"] end] == "$filesarq"} {        putserv "CNOTICE $nick $chan :Voce ja esta fazendo o download da minha lista."        return 0      }      if {[lindex $temp 3] == "GET_PENDING" &amp;&amp; [lindex [split [lindex [lindex $temp 4] 3] "/"] end] == "$filesarq"} {        putserv "CNOTICE $nick $chan :Voce ja esta fazendo o download da minha lista."        return 0      }    }  }  switch -- [dccsend $tcldir$filesarq $nick] {    "0" { putserv "CNOTICE $nick $chan :Enviando Lista de arquivos." }    "1" { putserv "CNOTICE $nick $chan :O servidor esta lotado, tente mais tarde." }    "2" { putserv "CNOTICE $nick $chan :Nao foi possivel estabelecer conexao." }    "3" { putserv "CNOTICE $nick $chan :O arquivo nao existe. Contacte o administrator." }    "4" { putserv "CNOTICE $nick $chan :Você ja esta copiando o limite de arquivos, quando eles acabarem. }  }}proc locator {nickr uhost hand chan rest} {  global nick comando home minchar diretorio listcommand maxmp3s  set temp "[lindex $rest 1]"  if {$temp != "*"} {    set musica [lrange $rest 1 end]    if {[string length [string trim $musica "*"]] &lt; $minchar} {      putserv "CNOTICE $nickr $chan :Use no minimo $minchar caracteres para especificar a musica a pesquisar."      return 0    }    set mascara "*"    foreach frag $musica {      set mascara "$mascara$frag*"    }    set nofiles [catch {set resultz [glob "$diretorio*"]}]    if {$nofiles} {      return 0    }    set resultz [lsort $resultz]    set resultado 0    foreach arq $resultz {      if {![string match [string tolower $mascara] [string tolower $arq]]} { continue }      incr resultado      if {$resultado == 1} { putserv "CMSG $nickr $chan :Foram encontradas arquivos com a mascara $mascara. Para copiar, digite no canal:" }      if {$resultado &lt;= $maxmp3s} {        set filesize "[file size $arq].0"        set size [expr $filesize / 1048576]        putserv "CMSG $nickr $chan :[format "14%s %-40s 2(%.3f mb)" "@$nick" [lindex [split $arq "/"] end] $size]"      }    }    if {$resultado &gt; $maxmp3s} {      putserv "CMSG $nickr $chan :Fim da listagem! $maxmp3s/$resultado arquivos(s) mostrados."      putserv "CMSG $nickr $chan :Digite $listcommand no $chan para receber minha lista."    }    if {$resultado &gt; 0 &amp;&amp; $resultado &lt;= $maxmp3s} { putserv "CMSG $nickr $chan :Fim da listagem! $resultado/$resultado arquivos(s) mostrados." }  }  return 1}proc pub_queue {nickr uhost hand chan rest} {  global nick queuefile tcldir home  set file [open $tcldir$queuefile r]  set total 0  while {![eof $file]} {    set text [string trim [gets $file]]    if {$text == ""} { continue }    incr total    set lines($total) $text  }  close $file  if {$total == 0} {    putserv "CNOTICE $nickr $chan :Nao ha ninguem na minha lista de espera."    return 1  }  set format "%2d %-15s / %-40s"  set header [format "%2s %-15s / %-40s" "N" "Nick" "Nome do Arquivo"]  putserv "CNOTICE $nickr $chan :$header"  for {set i 1} {$i &lt;= $total} {incr i} {    if {[string tolower $nickr] == [string tolower [lindex $lines($i) 0]]} {      set line [format $format $i "[lindex $lines($i) 0] (vc)" "[lindex $lines($i) 1]"]    } else {      set line [format $format $i "[lindex $lines($i) 0]" "[lindex $lines($i) 1]"]    }    putserv "CNOTICE $nickr $chan :$line"  }  return 1}proc pub_send {nickr uhost hand chan rest} {  global diretorio nick maxqueue queuefile slot filesarq tcldir tmpdir home  set i 0  set arq [lrange $rest 1 end]  if {![file exists $diretorio$arq]} {    putserv "CNOTICE $nickr $chan :O arquivo $arq nمo existe."    return 0  }  foreach temp [dcclist] {    if {[lindex $temp 3] == "GET" &amp;&amp; [lindex [split [lindex [lindex $temp 4] 3] "/"] end] == "$filesarq"} { continue }    if {[lindex $temp 3] == "GET_PENDING" &amp;&amp; [lindex [split [lindex [lindex $temp 4] 4] "/"] end] == "$filesarq"} { continue }    if {[lindex $temp 3] == "GET" || [lindex $temp 3] == "GET_PENDING"} {      if {[lindex $temp 1] == "$nickr"} {       putserv "CNOTICE $nickr $chan :Voce ja esta fazendo um download. Por favor, espere acabar o atual para começar outro."       return 0      }      incr i    }  }  if {$i &gt;= $slot} {    set test [catch {string tolower [lindex $nickr 0]}]    if {$test} {      putserv "CNOTICE $nickr $chan :Todos meus slots ($slot/$slot) estao ocupados e seu nick nao pode ser adicionado na lista de espera. Tente remover \{ \} \[ \]"      return 0    }    set file [open $tcldir$queuefile r]    set lines 0    while {![eof $file]} {      set text [string trim [gets $file]]      if {$text == ""} { continue }      set test [catch {string tolower [lindex $text 0]}]      if {$test} { continue }      incr lines      if {[string tolower [lindex $text 0]] == [string tolower $nickr]} {        putserv "CNOTICE $nickr $chan :Voce ja possui um arquivo ([lindex $text 1]) na lista de espera."        return 0      }    }    close $file    if {$lines &gt;= $maxqueue} {      putserv "CNOTICE $nickr $chan :Desculpe, mas todos os slots ($slot/$slot) e a minha lista de espera estao ocupados ($maxqueue/$maxqueue)."      return 0    }    set file [open $tcldir$queuefile a]        puts $file "$nickr $arq"    close $file    putserv "CNOTICE $nickr $chan :Voce e´ o [expr $lines + 1]؛ da minha lista de espera. Digite @$nick-que para ver minha lista de espera."    return 0  }  switch -- [dccsend $diretorio$arq $nickr] {    "0" {       putserv "CNOTICE $nickr $chan :Enviando arquivo $arq."      putlog "!$nickr! $rest"    }    "1" { putserv "CNOTICE $nickr $chan :O servidor esta lotado, tente mais tarde." }    "2" { putserv "CNOTICE $nickr $chan :Nao foi possivel estabelecer conexao." }    "3" { putserv "CNOTICE $nickr $chan :O arquivo chamado $arq nao existe." }    "4" { putserv "CNOTICE $nickr $chan :Voce ja esta copiando o limite de arquivos, quando eles acabarem sera enviado $arq." }  }}bind sent - * filesentproc filesent {hand nickr filex} {  global diretorio queuefile slot filesarq tcldir counterfile counterqt tmpdir home  incr counterqt  set fileark [open $tcldir$counterfile w]  puts $fileark $counterqt  close $fileark  if {$filex != "$tcldir$filesarq"} {    makerank $filex  }  set i 0  foreach temp [dcclist] {    if {[lindex $temp 3] == "GET" &amp;&amp; [lindex [split [lindex [lindex $temp 4] 3] "/"] end] == "$filesarq"} { continue }    if {[lindex $temp 3] == "GET_PENDING" &amp;&amp; [lindex [split [lindex [lindex $temp 4] 4] "/"] end] == "$filesarq"} { continue }    if {[lindex $temp 3] == "GET" || [lindex $temp 3] == "GET_PENDING"} {      incr i    }  }    if {$i &gt;= $slot} { return 0 }  set file [open $tcldir$queuefile r]  set lines 0  set send 0  while {![eof $file]} {    set text [string trim [gets $file]]    if {$text == ""} { continue }    set test [catch {string tolower [lindex $text 0]}]    if {$test} { continue }    if {$send == 0} {      if {[nickisonirc [lindex $text 0]] == ""} { continue }      switch -- [dccsend $diretorio[lindex $text 1] [lindex $text 0]] {        "0" {          putserv "CNOTICE [lindex $text 0] $home:Enviando arquivo [lindex $text 1]."          set send 1        }        "1" { putserv "CNOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :O servidor esta lotado, tente mais tarde." }        "2" { putserv "CNOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :Nao foi possivel estabelecer conexao." }        "3" { putserv "CNOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :O arquivo chamado [lindex $text 1] nao existe." }        "4" {          putserv "CNOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :Voce ja esta copiando o limite de arquivos, quando eles acabarem sera enviado [lindex $text 1]."          set send 1        }      }      continue    }    incr lines    set queue($lines) $text  }  close $file  set file [open $tcldir$queuefile w]    if {$lines &gt; 0} {    for {set i 1} {$i &lt;= $lines} {incr i} {      puts $file $queue($i)    }  }  close $file}proc makerank {file} {  global sentfile tcldir  set musica [lindex [split $file "/"] end]  set file [open $tcldir$sentfile r]  set i 0  set found 0  while {![eof $file]} {    set line [gets $file]    if {[string trim $line] == ""} { continue }    incr i    set ind0 [lindex $line 0]    set ind1 [lindex $line 1]    if {[string tolower $ind0] == [string tolower $musica]} {      set found 1      incr ind1    }    set lines($i) "$ind0 $ind1"  }  close $file  if {$i == 0} {    set file [open $tcldir$sentfile w]    puts $file "$musica 1"    close $file    return 1  }  if {$found == 0} {    set file [open $tcldir$sentfile a]    puts $file "$musica 1"    close $file    return 1  }  set file [open $tcldir$sentfile w]  for {set j 1} {$j &lt;= $i} {incr j} {    puts $file $lines($j)  }  close $file  return 1}proc nickisonirc {nick} {  global home  foreach chan $home {    if {[onchan $nick $chan]} { return $chan }  }  return ""}proc pub_msg {} {  global time home slot comando listcommand filesarq totalfiles totalsize tcldir counterqt toplist rank servindo  set quant 0  foreach temps [dcclist] {    if {[lindex $temps 3] == "GET" &amp;&amp; [lindex [split [lindex [lindex $temps 4] 3] "/"] end] == "$filesarq"} { continue }    if {[lindex $temps 3] == "GET_PENDING" &amp;&amp; [lindex [split [lindex [lindex $temps 4] 4] "/"] end] == "$filesarq"} { continue }    if {[lindex $temps 3] == "GET" || [lindex $temps 3] == "GET_PENDING"} {      incr quant    }  }  foreach chan $home {    putserv "PRIVMSG $chan :2File Server $chan - Servindo: 4$servindo2 - Comando: 4$comando &lt;arquivo&gt;2 - Lista de arquivos:4 $listcommand 2- TOP$rank:4 $toplist 2- Enviando:4 $quant/$slot 2- Enviado:4 $counterqt 2arquivo(s) - Total de arquivos:4 $totalfiles 2arquivos (04$totalsize)"  }  timer $time pub_msg}proc pub_msg2 {} {  global nick time2 home diretorio  set nofiles [catch {set mp3list [glob "$diretorio*"]}]  if {$nofiles} { return 0 }  set file [lindex $mp3list [rand [llength $mp3list]]]  switch -- [rand 2] {    "0" { set v1 "&lt; &gt;" }    "1" { set v1 "( )" }  }  switch -- [rand 7] {    "0" { set v2 "9 3" }    "1" { set v2 "13 6" }    "2" { set v2 "11 12" }    "3" { set v2 "4 5" }    "4" { set v2 "15 14" }    "5" { set v2 "9 10" }    "6" { set v2 "7 4" }  }  set v3 "0,[lindex $v2 0][lindex $v1 0][lindex $v2 1][lindex $v1 1][lindex $v2 0],[lindex $v2 1][lindex $v1 0]1[lindex $v1 1][lindex $v2 1],1[lindex $v1 0]"  set v4 "[lindex $v2 1],1[lindex $v1 1]1,[lindex $v2 1][lindex $v1 0][lindex $v2 0][lindex $v1 1][lindex $v2 1],[lindex $v2 0][lindex $v1 0]0[lindex $v1 1]"  set msg "$v3[lindex $v2 0],1 \[15@$nick [lindex [split $file /] end][lindex $v2 0]\] $v4"  foreach chan $home {    putserv "PRIVMSG $chan :$msg"  }  timer $time2 pub_msg2}bind dcc n mp3queue dcc_queueproc dcc_queue {hand idx args} {  global dir nick queuefile tcldir  set file [open $tcldir$queuefile r]  set total 0  while {![eof $file]} {    set text [string trim [gets $file]]    if {$text == ""} { continue }    incr total    set lines($total) $text  }  close $file  if {$total == 0} {    putdcc $idx "\[MP3\] Nمo hل ninguém na minha lista de espera."    return 1  }  set format "= %2d %-15s / %-40s ="  putdcc $idx "================================================================="  putdcc $idx "[format "= %2s %-15s / %-40s =" "N" "Nick" "Nome do Arquivo"]"  for {set i 1} {$i &lt;= $total} {incr i} {    putdcc $idx "[format $format $i "[lindex $lines($i) 0]" "[lindex $lines($i) 1]"]"  }  putdcc $idx "================================================================="  return 1}bind dcc n mp3stat mp3statproc mp3stat {hand idx args} {  global filesarq  putdcc $idx "============================================================================"  putdcc $idx [format "= %-15s %-40s %-15s =" "Nick" "Arquivo" "KBytes"]  putdcc $idx "============================================================================"  set quant 0  foreach temps [dcclist] {    if {[lindex $temps 3] == "GET" &amp;&amp; [lindex [split [lindex [lindex $temps 4] 3] "/"] end] == "$filesarq"} { continue }    if {[lindex $temps 3] == "GET_PENDING" &amp;&amp; [lindex [split [lindex [lindex $temps 4] 4] "/"] end] == "$filesarq"} { continue }    if {[lindex $temps 3] == "GET"} {      set temp0 [lindex $temps 4]      set kbyte [split [lindex $temp0 1] "/"]      if {[lindex $kbyte 0] != 0 &amp;&amp; [lindex $kbyte 1] != 0} {        set sent [expr [lindex $kbyte 0].0 / 1024]        set total [expr [lindex $kbyte 1].0 / 1024]      } else {        set sent 0.0        set total 0.0      }      set sent [format "%.2f" $sent]      set total [format "%.2f" $total]      set name [lindex [split [lindex $temp0 3] "/"] end]      putdcc $idx [format "= %-15s %-40s %-7s/%-7s =" [lindex $temps 1] [string range $name 0 39] $sent $total]      incr quant    }    if {[lindex $temps 3] == "GET_PENDING"} {      set temp0 [lindex $temps 4]      set name [lindex [split [lindex $temp0 4] "/"] end]      putdcc $idx "[format "= %-15s %-40s %-15s =" [lindex $temps 1] [string range $name 0 39] " (GET_PENDING) "]"      incr quant    }  }  putdcc $idx "============================================================================"  putdcc $idx [format "= Total de Arquivos: %-53s =" $quant]  putdcc $idx "= GET_PENDING -&gt; DCC ainda nao aceito pelo usuario                         ="  putdcc $idx "============================================================================"}bind dcc n mp3send mp3sendproc mp3send {hand idx args} {  putdcc $idx "============================================================================"  putdcc $idx [format "= %-15s %-40s %-15s =" "Nick" "Arquivo" "KBytes"]  putdcc $idx "============================================================================"  set quant 0  foreach temps [dcclist] {    if {[lindex $temps 3] == "SEND"} {      set temp0 [lindex $temps 4]      set kbyte [split [lindex $temp0 1] "/"]      if {[lindex $kbyte 0] != 0 &amp;&amp; [lindex $kbyte 1] != 0} {        set sent [expr [lindex $kbyte 0].0 / 1024]        set total [expr [lindex $kbyte 1].0 / 1024]      } else {        set sent 0.0        set total 0.0      }      set sent [format "%.2f" $sent]      set total [format "%.2f" $total]      set name [lindex [split [lindex $temp0 3] "/"] end]      putdcc $idx [format "= %-15s %-40s %-7s/%-7s =" [lindex $temps 1] [string range $name 0 39] $sent $total]      incr quant    }    if {[lindex $temps 3] == "GET_PENDING"} {      set temp0 [lindex $temps 4]      set name [lindex [split [lindex $temp0 4] "/"] end]      putdcc $idx "[format "= %-15s %-40s %-15s =" [lindex $temps 1] [string range $name 0 39] " (GET_PENDING) "]"      incr quant    }  }  putdcc $idx "============================================================================"  putdcc $idx [format "= Total de Arquivos: %-53s =" $quant]  putdcc $idx "= GET_PENDING -&gt; DCC ainda nao aceito pelo usuario                         ="  putdcc $idx "============================================================================"}proc check {} {  global diretorio queuefile slot filesarq tcldir home  set i 0  foreach temp [dcclist] {    if {[lindex $temp 3] == "GET" &amp;&amp; [lindex [split [lindex [lindex $temp 4] 3] "/"] end] == "$filesarq"} { continue }    if {[lindex $temp 3] == "GET_PENDING" &amp;&amp; [lindex [split [lindex [lindex $temp 4] 4] "/"] end] == "$filesarq"} { continue }    if {[lindex $temp 3] == "GET" || [lindex $temp 3] == "GET_PENDING"} { incr i }  }    if {$i &gt;= $slot} {    utimer 30 check    return  }  set file [open $tcldir$queuefile r]  set lines 0  set send 0  while {![eof $file]} {    set text [string trim [gets $file]]    if {$text == ""} { continue }    if {!$send} {      if {[nickisonirc [lindex $text 0]] == ""} { continue }      switch -- [dccsend $diretorio[lindex $text 1] [lindex $text 0]] {        "0" {          putlog "*** Enviando arquivo [lindex $text 1] para [lindex $text 0]."          putserv "CNOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :Enviando arquivo [lindex $text 1]."          set send 1        }        "1" { putserv "CNOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :O servidor esta lotado, tente mais tarde." }        "2" { putserv "CNOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :Nao foi possivel estabelecer conexao." }        "3" { putserv "CNOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :O arquivo chamado [lindex $text 1] nao existe." }        "4" {          putserv "CNOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :Voce ja esta copiando o limite de arquivos, quando eles acabarem sera enviado [lindex $text 1]."          set send 1        }      }      continue    }    incr lines    set queue($lines) $text  }  close $file  set file [open $tcldir$queuefile w]    if {$lines &gt; 0} {    for {set i 1} {$i &lt;= $lines} {incr i} {      puts $file $queue($i)    }  }  close $file  utimer 30 check}proc mount_ranking {} {  global sentfile tcldir rank home filerank comando nick  set file [open $tcldir$sentfile r]  set toplist ""  while {![eof $file]} {    set line [gets $file]    if {[string trim $line] == ""} { continue }    set ind0 [lindex $line 0]    set ind1 [lindex $line 1]    if {[llength $toplist] == 0} {      set toplist [linsert $toplist 0 "$ind1 $ind0"]      continue    }    set put 0    for {set i 0} {$i &lt; [llength $toplist]} {incr i} {      if {$ind1 &gt; [lindex [lindex $toplist $i] 0]} {        set toplist [linsert $toplist $i "$ind1 $ind0"]        set put 1        break      }    }    if {$put == 0} { set toplist [linsert $toplist $i "$ind1 $ind0"] }  }  close $file  if {[llength $toplist] == 0} {    putlog "*** Impossivel montar Ranking (nao ha estatistica) ***"    return 0  }  set filex [open $tcldir$filerank w]  puts $filex "2=========================================================================="  puts $filex "2$nick - TOP$rank - Arquivos mais Enviados"  puts $filex "2========================2=================================================="  for {set i 0} {$i &lt; [llength $toplist] &amp;&amp; $i &lt; $rank} {incr i} {    puts $filex [format "2%-2d %s 14\[%d download(s)\]" [expr $i + 1] [lindex [lindex $toplist $i] 1] [lindex [lindex $toplist $i] 0]]  }  puts $filex "2========================================2=================================="  puts $filex "2 Para receber, digite: 4@$nick nome-do-arquivo"  puts $filex "2==========================================================2================"  close $filex  putlog "***  Arquivo de Ranking ATUALIZADO  ***"}proc init-locator {} {  global home  rehash  putserv "AWAY :Serving arqivos HackerS... ($home)"}# Verificaçao de Arquivosproc checkfiles {} {  global tcldir filesarq sentfile queuefile filerank counterfile counterqt  set arquivos "$filesarq $filerank $queuefile $sentfile $counterfile"  if {![file isdirectory $tcldir]} {    putlog "*** Diretorio $tcldir nao encontrado. Criando ..."    file mkdir $tcldir  }  foreach arquiv $arquivos {    if {![file exists $tcldir$arquiv]} {      putlog "*** Arquivo $arquiv nao encontrado. Criando..."      set file [open $tcldir$arquiv w]      close $file    }  }  set file [open $tcldir$counterfile r]  set counterqt [gets $file]  close $file  if {$counterqt == ""} {    set counterqt 0  }}# Timers Reset =)foreach j [timers] {  if {[lindex $j 1] == "pub_msg" || [lindex $j 1] == "pub_msg2" || [lindex $j 1] == "update" || [lindex $j 1] == "check"} {    killtimer [lindex $j 2]  }}foreach j [utimers] {  if {[lindex $j 1]  == "update" || [lindex $j 1]  == "check"} {    killutimer [lindex $j 2]  }}checkfilesutimer 30 checkutimer 1 updatetimer 2 pub_msgtimer 2 pub_msg2putlog "@Locator carregado"#</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5052">AbuAli</a> — Fri Jun 25, 2004 10:20 am</p><hr />
]]></content>
	</entry>
	</feed>
