egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
ORATEGOD
Voice


Joined: 08 Jun 2020
Posts: 32

PostPosted: Sun Oct 02, 2022 8:39 pm    Post subject: Error Reply with quote

greetings friends

I have an error starting this TCL.
The eggdrop is version v1.6.18

I appreciate the help you can give me =)

Quote:
can't set "time": variable is array
while executing
"set time 90"
(file "scripts/servidor.tcl" line 23)
invoked from within



# Tempo de envio de Mensagem
set time 90


Code:
###############################################################
# * Tcl desenvolvida por helpfire                             #
# * Dúvidas? helpfire@BRASnet.org                             #
# * Utilize a versão 1.6.13 ou superior                       #
###############################################################

loadmodule filesys

###  Config  ####
# Diretorio de onde estao as MP3s (full-path) -> nao esquecer "/" no final
set diretorio "/home/eggis/epubBot/epubFree/"

# Diretorio de arkivos da TCL
set tcldir "epubData/"

# Maximo de Arquivos na Fila de Espera
set maxqueue 10

# Maximo de DCC Send
set slot 1

# Tempo de envio de Mensagem
set time 90

# Tempo de envio de Radom MP3
set time2 60

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

# O numero de arquivos do rank
set rank 10

# Minimo de Caracteres para @locator (evitar flood)
set minchar 3

# 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 (Agora é a Top)
set sentfile "$nick-Top.txt"

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

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

# Não mecher
set toplist "@$nick-top$rank"
set toplista "@$nick-top"

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

#
###  Funções  ###
#

set files-path "$diretorio"
set incoming-path "$diretorio"
set upload-to-pwd 0
set filedb-path ""
set max-file-users "$slot"
set max-filesize 0

# BINDS
foreach chan $home {
  bind pubm - "$chan $comando *" locator
  bind pubm - "$chan $listcommand" pub_list
  bind pubm - "$chan @$nick-top*" top_lista
  bind pubm - "$chan @$nick-que*" pub_queue
  bind pubm - "$chan @$nick *" pub_send
  bind pubm - "$chan !list" notice_list
  bind part - "$chan *" part_chan
  bind sign - "$chan*" sign_chan
}
bind bot - sharefiles sharefiles
bind dcc n clearqueue dcc_clearqueue
bind msgm - "*!$botnick*" nomusic
bind msg - "*!$botnick*" nomusic

proc nomusic {nick uhost hand args} {
 putquick "PRIVMSG $nick :É necessário colar a respectiva linha no canal e não no meu PVT, se isto é uma opção do mIRC, digite: ALT + O depois vá em DCC, Menu Requisição e desmarque o diálogo !nick file"
}

proc dcc_clearqueue {hand idx arg} {
  global tcldir queuefile
  set file [open $tcldir$queuefile w]
  close $file
  putdcc $idx "13,15 •6•1• 0,1 Lista de Espera limpada. 1,15 •6•13• 0,1"
  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 owner
  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 a música *\r\n"
  puts -nonewline $list " * Como exemplo: @$nick Skank - Vamos Fugir.mp3 *\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 "13,15 •6•1• 0,1 Lista de arquivos. Atualizado! 1,15 •6•13• 0,1"
  set totalfiles $count
  set totalsize [format "%.3f MB(s)" $totalsize]
  mount_ranking
  timer 10 update
}

proc top_lista {nick uhost hand chan rest} {
  global tcldir sentfile home
    putquick "NOTICE $nick :O sistema de TOP está sendo enviado... por dcc nos fale o que achou do novo sistema."
    putquick "NOTICE $nick :Caso não tenha nenhum arquivo é pelo motivo do fserv ser novo ou algo do genero."
    dccsend "$tcldir$sentfile" $nick
}

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"} {
        putquick "NOTICE $nick :13,15 •6•1• 0,1 Você já está fazendo o download da minha lista. 1,15 •6•13• 0,1"
        return 0
      }
      if {[lindex $temp 3] == "GET_PENDING" && [lindex [split [lindex [lindex $temp 4] 3] "/"] end] == "$filesarq"} {
        putquick "NOTICE $nick :13,15 •6•1• 0,1 Você já está fazendo o download da minha lista. 1,15 •6•13• 0,1"
        return 0
      }
    }
  }
  switch -- [dccsend $tcldir$filesarq $nick] {
    "0" { putquick "NOTICE $nick :13,15 •6•1• 0,1 Enviando lista de 11arquivos. 0Lembre-se que você não pode sair do canal enquanto estiver baixando o arquivo, e se você possui uma 11conexão lenta0, procure baixar 8menos arquivos0 por vez. 1,15 •6•13• " }
    "1" { putquick "NOTICE $nick :13,15 •6•1• 0,1 O servidor está lotado, tente mais tarde. 1,15 •6•13• 0,1" }
    "2" { putquick "NOTICE $nick :13,15 •6•1• 0,1 Não foi possivel estabelecer conexão. 1,15 •6•13• 0,1" }
    "3" { putquick "NOTICE $nick :13,15 •6•1• 0,1 O arquivo não existe. Contacte o administrator. 1,15 •6•13• 0,1" }
    "4" { putquick "NOTICE $nick :13,15 •6•1• 0,1 Você já está copiando o limite de arquivos, quando eles acabarem.13,15 •6•1• 0,1 " }
  }
}

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} {
      putquick "NOTICE $nickr :13,15 •6•1• 0,1 Use no minimo 8$minchar 0caracteres para especificar a musica a pesquisar. 1,15 •6•13• 0,1"
      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} { putquick "PRIVMSG $nickr :13,15 •6•1• 0,1 Foi encontrado arquivo(s) com a seguinte máscara 8$mascara. 0Copie a linha referente ao arquivo e coloque no canal, não inclua o tamanho do arquivo. 1,15 •6•13• 0,1" }
      if {$resultado <= $maxmp3s} {
        set filesize "[file size $arq].0"
        set size [expr $filesize / 1048576]
        putquick "PRIVMSG $nickr :[format "%s %-40s (%.3f mb)" "@$nick" [lindex [split $arq "/"] end] $size]"
      }
    }
    if {$resultado > $maxmp3s} {
      putquick "PRIVMSG $nickr :13,15 •6•1• 0,1 Fim da listagem! $maxmp3s/$resultado música(s) mostradas. 1,15 •6•13• 0,1"
      putquick "PRIVMSG $nickr :13,15 •6•1• 0,1 Digite $listcommand no respectivo canal para receber minha lista. 1,15 •6•13• 0,1"
    }
    if {$resultado > 0 && $resultado <= $maxmp3s} { putquick "PRIVMSG $nickr :13,15 •6•1• 0,1 Fim da listagem! 8$resultado/$resultado0 música(s) mostradas. 1,15 •6•13• 0,1" }
  }
  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} {
    putquick "NOTICE $nickr :13,15 •6•1• 0,1 Não há ninguem na minha lista de espera. 1,15 •6•13• 0,1"
    return 1
  }
  set format "%2d %-15s / %-40s"
  set header [format "%2s %-15s / %-40s" "N" "Nick" "Nome do Arquivo"]
  putquick "NOTICE $nickr :$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]"]
    }
    putquick "NOTICE $nickr :$line"
  }
  return 1
}

proc pub_send {nickr uhost hand chan rest} {
  global diretorio nick maxqueue queuefile slot filesarq tcldir tmpdir home listcommand botnick
  set i 0
  set arq [lrange $rest 1 end]
  if {![file exists $diretorio$arq]} {
    putquick "NOTICE $nickr :13,15 •6•1• 0,1 O arquivo $arq não existe. 1,15 •6•13• 0,1"
    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"} {
       putquick "NOTICE $nickr :13,15 •6•1• 0,1 Você já está fazendo um download. Por favor, espere acabar o atual para começar outro. 1,15 •6•13• 0,1"
       return 0
      }
      incr i
    }
  }
  if {$i >= $slot} {
    set test [catch {string tolower [lindex $nickr 0]}]
    if {$test} {
      putquick "NOTICE $nickr :13,15 •6•1• 0,1 Todos meus slots ($slot/$slot) estão ocupados e seu nick nao pode ser adicionado na lista de espera. Tente remover \{ \} \[ \] 1,15 •6•13• 0,1"
      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]} {
        putquick "NOTICE $nickr :13,15 •6•1• 0,1 Você já possui um arquivo ([lindex $text 1]) na lista de espera. 1,15 •6•13• 0,1 "
        return 0
      }
    }
    close $file
    if {$lines >= $maxqueue} {
      putquick "NOTICE $nickr :13,15 •6•1• 0,1 Desculpe, mas todos os slots ($slot/$slot) e a minha lista de espera estão ocupados ($maxqueue/$maxqueue). 1,15 •6•13• 0,1"
      return 0
    }
    set file [open $tcldir$queuefile a]   
    puts $file "$nickr $arq"
    close $file
    putquick "NOTICE $nickr :13,15 •6•1• 0,1 Você é o [expr $lines + 1]º da minha lista de espera. Digite @$nick-que para ver minha lista de espera. 1,15 •6•13• 0,1"
    return 0
  }
  switch -- [dccsend $diretorio$arq $nickr] {
    "0" {
      putquick "NOTICE $nickr :13,15 •6•1• 0,1 Neste momento estou enviando o arquivo $arq, Caso você tenha necessidade de ver a lista de espera para outro download, digite: 13$botnick-que0 e para pegar 8Minha Lista0 de arquivos 13@$listcommand0, e o comando para busca é: 13@locator <música/autor>. 1,15 •6•13• 0,1"
      putlog "!$nickr! $rest"
    }
    "1" { putquick "NOTICE $nickr :13,15 •6•1• 0,1 O servidor está lotado, tente mais tarde. 1,15 •6•13• 0,1 " }
    "2" { putquick "NOTICE $nickr :13,15 •6•1• 0,1 Não foi possivel estabelecer conexao. 1,15 •6•13• 0,1" }
    "3" { putquick "NOTICE $nickr :13,15 •6•1• 0,1 O arquivo chamado $arq nao existe. 1,15 •6•13• 0,1" }
    "4" { putquick "NOTICE $nickr :13,15 •6•1• 0,1 Você já está copiando o limite de arquivos, quando eles acabarem será enviado $arq. 1,15 •6•13• 0,1" }
  }
}

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" {
          putquick "NOTICE [lindex $text 0] :13,15 •6•1• 0,1 $home Enviando arquivo [lindex $text 1]. 1,15 •6•13• 0,1"
          set send 1
        }
        "1" { putquick "NOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :13,15 •6•1• 0,1 O servidor está lotado, tente mais tarde. 1,15 •6•13• 0,1" }
        "2" { putquick "NOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :13,15 •6•1• 0,1 Não foi possivel estabelecer conexão. 1,15 •6•13• 0,1" }
        "3" { putquick "NOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :13,15 •6•1• 0,1 O arquivo chamado [lindex $text 1] não existe. 1,15 •6•13• 0,1" }
        "4" {
          putquick "NOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :13,15 •6•1• 0,1 Voce já está copiando o limite de arquivos, quando eles acabarem sera enviado [lindex $text 1]. 1,15 •6•13• 0,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 botnick time home slot comando listcommand filesarq totalfiles totalsize tcldir counterqt toplist rank
  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 {
    putquick "PRIVMSG $chan :13,15 •6•1• 0,1 Para 8Minha Lista 13$listcommand0 e para 8Fila de Espera0 & 8DCC Stats0, digite 13@$botnick-que 0e 13@$botnick-stats0. Comando de procura: 8$comando <música/autor> 0,1Enviando:8 $quant/$slot 0Enviado:8 $counterqt 0- Número total de arquivos:8 $totalfiles 0(13$totalsize0) 1,15 •6•13• 0,1"
  }
  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 {
    putquick "PRIVMSG $chan :$msg"
  }
  timer $time2 pub_msg2
}

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 "13,15 •6•1• 0,1 Enviando arquivo [lindex $text 1] para [lindex $text 0]. 1,15 •6•13• 0,1"
          putquick "NOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :13,15 •6•1• 0,1 Enviando arquivo [lindex $text 1]."
          set send 1
        }
        "1" { putquick "NOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :13,15 •6•1• 0,1 O servidor está lotado, tente mais tarde. 1,15 •6•13• 0,1" }
        "2" { putquick "NOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :13,15 •6•1• 0,1 Nao foi possivel estabelecer conexão. 1,15 •6•13• 0,1" }
        "3" { putquick "NOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :13,15 •6•1• 0,1 O arquivo chamado [lindex $text 1] não existe. 1,15 •6•13• 0,1" }
        "4" {
          putquick "NOTICE [lindex $text 0] [nickisonirc [lindex $text 0]] :13,15 •6•1• 0,1 Você já está copiando o limite de arquivos, quando eles acabarem será enviado [lindex $text 1]. 1,15 •6•13• 0,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
}

# Aguarde mudanças nesta sessão.
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} {
    return 0
  }
  set filex [open $tcldir$filerank w]
  puts $filex "Este sistema antigo será substituido em breve por um sistema melhor e mais rápido."
}
# 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 "13,15 •6•1• 0,1 Diretorio $tcldir nao encontrado. Criando ... 1,15 •6•13• 0,1"
    file mkdir $tcldir
  }
  foreach arquiv $arquivos {
    if {![file exists $tcldir$arquiv]} {
      putlog "13,15 •6•1• 0,1 Arquivo $arquiv nao encontrado. Criando... 1,15 •6•13• 0,1"
      set file [open $tcldir$arquiv w]
      if {$arquiv == "$sentfile"} { puts $file "Arquivos estão sendo mostrado abaixo com o seu número de downloads." }
      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]
  }
}

proc notice_list {nick uhost hand chan args} {
 global listcommand comando botnick slot counterqt totalfiles totalsize
   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
    }
 }
 putquick "NOTICE $nick :13,15 •6•1• 0,1 Para 8Minha Lista 13$listcommand0 e para 8Fila de Espera0 & 8DCC Stats0, digite 13@$botnick-que 0e 13@$botnick-stats0. Comando de procura: 8$comando <música/autor> 0,1Enviando:8 $quant/$slot 0Enviado:8 $counterqt 0- Número total de arquivos:8 $totalfiles 0(13$totalsize0) 1,15 •6•13• 0,1"
}
set ctcp-version "13,15 •6•1• 0,1 TCL para eggdrop baseada no 1,0 10S13p14R 1,15 •6•13• 0,1 - by helpfire"
set ctcp-userinfo "13,15 •6•1• 0,1 eggdrop by $owner 1,0 10S13p14R 1,15 •6•13• 0,1"

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

proc init-locator {} {
 global listcommand comando botnick slot counterqt totalfiles totalsize filesarq
   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
    }
 }
 putquick "AWAY :13,15 •6•1• 0,1 Para 8Minha Lista 13$listcommand0 e para 8Fila de Espera0 & 8DCC Stats0, digite 13@$botnick-que 0e 13@$botnick-stats0. Comando de procura: 8$comando <música/autor> 0,1Enviando:8 $quant/$slot 0Enviado:8 $counterqt 1,15 •6•13• 0,1"

}

# O bot irá inicializar o sistema assim que aparecer o MOTD. (Em fase de teste)
bind raw - "372" inicializacao
proc inicializacao {from keyword text} { init-locator }

putlog "@Locator carregado (by FireCop & Smoo)"
Back to top
View user's profile Send private message AIM Address
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Mon Oct 03, 2022 2:21 am    Post subject: Reply with quote

As your variable time is global, without namespace, and with a really generic name, I guess you have another script, loaded before this one, which also use time variable and declare it as an array.

Change your variable name.

Tip: never use generic name, and more never use reserved keywords, as time (which is also a function)
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
ORATEGOD
Voice


Joined: 08 Jun 2020
Posts: 32

PostPosted: Mon Oct 03, 2022 7:47 am    Post subject: Reply with quote

CrazyCat wrote:
As your variable time is global, without namespace, and with a really generic name, I guess you have another script, loaded before this one, which also use time variable and declare it as an array.

Change your variable name.

Tip: never use generic name, and more never use reserved keywords, as time (which is also a function)



thank you very much friend !!!
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber