Explorar o código

alias module modify

added the possibility to specify multiple commands separated by |
BLaCkShaDoW %!s(int64=2) %!d(string=hai) anos
pai
achega
855f6375ae

+ 6 - 2
BlackTools/Commands/BT.ChanCmds.tcl

@@ -2324,15 +2324,19 @@ default {
 if {$alias_check != 0} {
 	set counter 0
 	set text [lrange [split $arg] 1 end]
+	set split_cmd [wsplit $alias_check "|"]
+	set llength_cmd [llength $split_cmd]
 foreach a $text {
 	incr counter
 	set replace(%${counter}%) $a
 }
 	set replace(%chan%) $chan
-	set text [string map [array get replace] $alias_check]
+for {set i 0} { $i < $llength_cmd} {incr i} {
+	set text [string map [array get replace] [lindex $split_cmd $i]]
 	regsub -all {%[0-9]%} $text "" text
-	set text [join $text]
+	set text [concat [join $text]]
 	comand:chan $nick $host $hand $chan "${char}$text"
+				}	
 			}
 		}
 	}

+ 6 - 2
BlackTools/Commands/BT.ForCmds.tcl

@@ -2160,15 +2160,19 @@ default {
 if {$alias_check != 0} {
 	set counter 0
 	set text [lrange [split $arg] 3 end]
+	set split_cmd [wsplit $alias_check "|"]
+	set llength_cmd [llength $split_cmd]
 foreach a $text {
 	incr counter
 	set replace(%${counter}%) $a
 }
 	set replace(%chan%) $chan
-	set text [string map [array get replace] $alias_check]
+for {set i 0} { $i < $llength_cmd} {incr i} {
+	set text [string map [array get replace] [lindex $split_cmd $i]]
 	regsub -all {%[0-9]%} $text "" text
-	set text [join $text]
+	set text [concat [join $text]]
 	comand:pubme:for $nick $host $hand $chan "for ${botnick} $text"
+					}	
 				}
 			}		
 		}

+ 7 - 3
BlackTools/Commands/BT.MeCmds.tcl

@@ -2153,20 +2153,24 @@ if {[matchattr $hand nmo|MAO $chan]} {
 	skippublic:process $nick $host $hand $chan $chan1 $user	$type
 				}
 			}
-default {
+	default {
 	set alias_check [blacktools:alias_check $hand $what]
 if {$alias_check != 0} {
 	set counter 0
 	set text [lrange [split $arg] 2 end]
+	set split_cmd [wsplit $alias_check "|"]
+	set llength_cmd [llength $split_cmd]
 foreach a $text {
 	incr counter
 	set replace(%${counter}%) $a
 }
 	set replace(%chan%) $chan
-	set text [string map [array get replace] $alias_check]
+for {set i 0} { $i < $llength_cmd} {incr i} {
+	set text [string map [array get replace] [lindex $split_cmd $i]]
 	regsub -all {%[0-9]%} $text "" text
-	set text [join $text]
+	set text [concat [join $text]]
 	comand:pubme $nick $host $hand $chan "${botnick} $text"
+					}	
 				}
 			}			
 		}

+ 6 - 2
BlackTools/Commands/BT.PrvCmds.tcl

@@ -2416,15 +2416,19 @@ default {
 if {$alias_check != 0} {
 	set counter 0
 	set text [lrange [split $arg] 2 end]
+	set split_cmd [wsplit $alias_check "|"]
+	set llength_cmd [llength $split_cmd]
 foreach a $text {
 	incr counter
 	set replace(%${counter}%) $a
 }
 	set replace(%chan%) $chan
-	set text [string map [array get replace] $alias_check]
+for {set i 0} { $i < $llength_cmd} {incr i} {
+	set text [string map [array get replace] [lindex $split_cmd $i]]
 	regsub -all {%[0-9]%} $text "" text
-	set text [join $text]
+	set text [concat [join $text]]
 	comand:pubme:for $nick $host $hand $chan "for ${botnick} $text"
+				}	
 			}
 		}
 	}