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 

Tcl error [raw:&save]: can not find channel named "

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


Joined: 21 Aug 2018
Posts: 6

PostPosted: Wed Oct 10, 2018 5:48 pm    Post subject: Tcl error [raw:&save]: can not find channel named " Reply with quote

Tcl error [raw:&save]: can not find channel named "file9"

Someone can help me to fix it?

Code:
###############################
# Definizione dei raw         #
###############################
bind raw - NOTICE raw:&save
bind raw - 001 001:&savejoin

global arraycollisioni

#########################
# Trigger per i kills   #
#########################
set trigger_kills !collide

#################################################
# Definizione TRIGGERS            #
#################################################
bind pub -|- $trigger_kills pub:savemsg

proc 001:&savejoin {from keyword rest} {
  putquick "JOIN &SAVE"
}

proc pub:savemsg {nick host hand chan text} {
   global arraycollisioni

   set parametro [lindex $text 0]
   if {$parametro == ""} {
      putserv "PRIVMSG $chan :\[Collide] Please, insert the nick (ex. !collide john)."
      return 0
   }

   if {$parametro == "pulisci"} {
      array unset arraycollisioni
      putserv "PRIVMSG $chan :Array Dinamico pulito."
      return 0
   }

   cerca_array_collisioni $parametro $chan $nick

}

#invocato nel caso di collide
proc raw:&save {from keyword rest} {
  global arraycollisioni

  # invoco la funzione
  rileva_collisioni $rest
}

# funzione che si occupa di restituire i dettagli collide in caso sia presente il nick nell`array
proc cerca_array_collisioni { nome chan user_richiesta } {
      global arraycollisioni
      set trovato false
     
      foreach {nick record} [ array get arraycollisioni ] {
     if { [string equal -nocase $nick $nome] == 1 } {
      putchan $chan "$record"
      set trovato true
     }
      }

      if { $trovato == "false" } {
     putserv "PRIVMSG $chan :\[Collide] No collide about that nick."
      }
   
}
#if { [lindex $rest 0] != "&SAVE" } { return 0 }
#if { [lindex $rest 0] == "&SAVE" && [string match -nocase "*Received SAVE message*" $rest] == 1 } {

# funzione che si occupa di rilevare una collisione su &save e metterla nell`array
proc rileva_collisioni { rest } {

  global arraycollisioni

  # se il bot sta su altri canali del chanserv scartiamo i msg ke non ci interessano
  if { [lindex $rest 0] != "&SAVE" } { return 0 }

  # esempio di messaggio tipico 2 casi possibili :
  # 1) &SAVE :Received SAVE message for cc09. Path: ircd.eutelia.it!*.pl!hub.irc.pl (~print@83-102-66-209.bb.dnainternet.fi[*.nl](cc09) <- agreement@opt-115-30-246-103.client.pikara.ne.jp[*.jp])
  # 2) &SAVE :Received SAVE message for laurizio. Path: hub.irc.at!*.se!*.fi!irc.cc.tut.fi!irc.cc.tut.fi (laurizio@kapsi.fi)irc.tdc.fi <- (laurizio@kapsi.fi)irc.nebula.fi

  if { [lindex $rest 0] == "&SAVE" && [string match -nocase "*Received SAVE message*" $rest] == 1 } {
      set nick_colliso [lindex $rest 5]
      # tolgo il punto finale
      set x [string length $nick_colliso]
      set x [expr $x - 2]
      set nick_colliso [string range $nick_colliso 0 $x ]

      set orig_hostmask_a [lindex $rest 8]

      # HOSTMASK A : caso con la '['
      if { [ string first "\[" $orig_hostmask_a ] != -1 } {
       set tmp1 [string first "\[" $orig_hostmask_a]
       set tmp1 [expr $tmp1 - 1]
       # parto da 1 perche` filtro la (
       set hostmask_a [string range $orig_hostmask_a 1 $tmp1]
      }
      # HOSTMASK A : oppure senza '['
      if { [ string first "\[" $orig_hostmask_a ] == -1 } {
       set tmp1 [string first ")" $orig_hostmask_a]
       set tmp1 [expr $tmp1 - 1]
       # parto da 1 perche` filtro la (
       set hostmask_a [string range $orig_hostmask_a 1 $tmp1]
      }
     

      set orig_hostmask_b [lindex $rest 10]

      # HOSTMASK B : ho la '['
      if { [string first "\[" $orig_hostmask_b ] != -1 } {
       set tmp2 [string first "\[" $orig_hostmask_b]
       set tmp2 [expr $tmp2 - 1]
       set hostmask_b [string range $orig_hostmask_b 0 $tmp2]
      }

      # HOSTMASK B : oppure senza '['
      if { [string first "\[" $orig_hostmask_b ] == -1 } {
       set tmp2 [string first ")" $orig_hostmask_b]
       set tmp2 [expr $tmp2 - 1]
       # parto da 1 perche' ho una ( iniziale
       set hostmask_b [string range $orig_hostmask_b 1 $tmp2]
      }
 
      set orario [open "|date +%c" r]
       while {![eof $orario]} {
          catch { [set riga [gets $orario]] }
      
              # tolgo la scritta CEST (gio 14 ott 2010 23:11:07 CEST)
          set time [lrange $riga 0 end-1]

          # caso split server
          if { [ string first "\[" $orig_hostmask_a ] == -1 } {
               set key "\[Collide] $nick_colliso = *!$hostmask_a <-> *!$hostmask_b on $time"
          }

          # collide normale
          if { [ string first "\[" $orig_hostmask_a ] != -1 } {
               set key "\[Collide] $nick_colliso = *!$hostmask_a <-> *!$hostmask_b on $time"
          }

          # setto l`entry nell`array
          set arraycollisioni($nick_colliso) $key
 
          close $orario
       }
}
}

putlog "\[OK] dn_collide.tcl loaded <> edit by doni"
Back to top
View user's profile Send private message
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