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 [raw:&save]: can not find channel named "

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
d
doni
Voice
Posts: 13
Joined: Tue Aug 21, 2018 4:13 am

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

Post by doni »

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

Someone can help me to fix it?

Code: Select all

###############################
# 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" 
Post Reply