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 got this msg when i load this tcl.. so what the problem...

[11:09] Tcl error in file 'eggdrop.conf':
[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
while executing
"bind sent - * filesent"
(file "scripts/fserv.tcl" line 374)
invoked from within

Code: Select all

# 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) -> nao esquecer "/" no final
set diretorio "/home/login/files/"


# Diretorio de arkivos da TCL
set tcldir "/home/login/eggdrop/scripts/"


# Maximo de Arquivos na Fila de Espera
set maxqueue 10

# Maximo de DCC Send
set slot 10

# Tempo de envio de Mensagem
set time 680

# Tempo de envio de Radom MP3
set time2 5

# Canais do BOT (separados por espaco)
set home "#channel"

# O numero de arquivos do rank
set 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 @locator
set maxmp3s 5

### Arquivos ###
# Arquivo onde guardar arquivos na fila de espera
set queuefile "$nick-Espera.dat"

# Arquivo onde colocar a Lista de MP3s do BOT
set filesarq "$nick-List.txt"

# Arquivo para armanenar Ranking
set filerank "$nick-Top$rank.dat"

# Arquivo de Quantidade de Arquivos
set counterfile "$nick-Counter.dat"

# Arquivo de Armazenamento de Sends dos Arquivos
set sentfile "$nick-SentFiles.dat"

###  Comandos  ####
# Comando para Verificacao de MP3s
set comando "@locator"

# Comando para receber lista de MP3s
set listcommand "@$nick"

# Comando para receber lista de MP3s - TOPxx (via msg)
set toplist "@$nick-top$rank"

# Nao Edite as variaves abaixo
set tmpdir "${temp-path}"
set totalfiles 0
set totalsize "0 mb"
# end :)

#
###  Funcoes  ###
#

# BINDS
foreach 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 sharefiles
bind dcc n clearqueue dcc_clearqueue

proc 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" && [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 <= $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" && [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" && [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 "*"]] < $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 <= $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 > $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 > 0 && $resultado <= $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 <= $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" && [lindex [split [lindex [lindex $temp 4] 3] "/"] end] == "$filesarq"} { continue }
    if {[lindex $temp 3] == "GET_PENDING" && [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 >= $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 >= $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 - * filesent
proc 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" && [lindex [split [lindex [lindex $temp 4] 3] "/"] end] == "$filesarq"} { continue }
    if {[lindex $temp 3] == "GET_PENDING" && [lindex [split [lindex [lindex $temp 4] 4] "/"] end] == "$filesarq"} { continue }
    if {[lindex $temp 3] == "GET" || [lindex $temp 3] == "GET_PENDING"} {
      incr i
    }
  }  
  if {$i >= $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 > 0} {
    for {set i 1} {$i <= $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 <= $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" && [lindex [split [lindex [lindex $temps 4] 3] "/"] end] == "$filesarq"} { continue }
    if {[lindex $temps 3] == "GET_PENDING" && [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 <arquivo>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 "< >" }
    "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_queue
proc 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 <= $total} {incr i} {
    putdcc $idx "[format $format $i "[lindex $lines($i) 0]" "[lindex $lines($i) 1]"]"
  }
  putdcc $idx "================================================================="
  return 1
}

bind dcc n mp3stat mp3stat
proc 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" && [lindex [split [lindex [lindex $temps 4] 3] "/"] end] == "$filesarq"} { continue }
    if {[lindex $temps 3] == "GET_PENDING" && [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 && [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 -> DCC ainda nao aceito pelo usuario                         ="
  putdcc $idx "============================================================================"
}

bind dcc n mp3send mp3send
proc 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 && [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 -> 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" && [lindex [split [lindex [lindex $temp 4] 3] "/"] end] == "$filesarq"} { continue }
    if {[lindex $temp 3] == "GET_PENDING" && [lindex [split [lindex [lindex $temp 4] 4] "/"] end] == "$filesarq"} { continue }
    if {[lindex $temp 3] == "GET" || [lindex $temp 3] == "GET_PENDING"} { incr i }
  }  
  if {$i >= $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 > 0} {
    for {set i 1} {$i <= $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 < [llength $toplist]} {incr i} {
      if {$ind1 > [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 < [llength $toplist] && $i < $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 Arquivos
proc 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]
  }
}

checkfiles
utimer 30 check
utimer 1 update
timer 2 pub_msg
timer 2 pub_msg2

putlog "@Locator carregado"
#
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

The error message is of a bind.
This is the line is the script causing a problem.

Code: Select all

bind sent - * filesent 
Maybe you are using an old eggdrop version which doesnt
support this bind type on a tcl script which does or maybe
there is a problem with the bind mask.
SENT (stackable)

bind sent <flags> <mask> <proc>
proc-name <handle> <nick> <path/to/file>

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').

Module: transfer
You also might want to check if you have enabled your file transfer
module in the .conf file and if you have, have you set and configured
it properly or not.
·­awyeah·

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