Daniel Voipan пре 5 година
родитељ
комит
a2b34eaafa

+ 28 - 1
BlackTools/Commands/BT.ChanCmds.tcl

@@ -28,6 +28,17 @@ if {$return == "0"} {
 		return
 }
 switch [string tolower $cmd] {
+alias {
+if {[matchattr $hand mno|MAO $chan]} {
+	set chan1 $chan
+	set type 0
+	set what [lindex [split $arg] 1]
+	set cmdf [lindex [split $arg] 2]
+	set cmd_used [lindex [split $arg] 3]
+	set text [join [lrange [split $arg] 4 end]]
+	alias:process $nick $char $hand $chan $chan1 $type [list $what $cmdf $cmd_used $text]
+	}
+}
 
 exempt {
 if {[matchattr $hand mno|M $chan]} {
@@ -2271,7 +2282,23 @@ if {[matchattr $hand nmo|MAO $chan]} {
 	set type 0
 	skippublic:process $nick $char $hand $chan $chan1 $user	$type
 			}
-		}		
+		}
+default {
+	set alias_check [blacktools:alias_check $hand $cmd]
+if {$alias_check != 0} {
+	set counter 0
+	set text [lrange [split $arg] 1 end]
+foreach a $text {
+	incr counter
+	set replace(%${counter}%) $a
+}
+	set replace(%chan%) $chan
+	set text [string map [array get replace] $alias_check]
+	regsub -all {%[0-9]%} $text "" text
+	set text [join $text]
+	comand:chan $nick $host $hand $chan "${char}$text"
+			}
+		}
 	}
 }
 

+ 27 - 1
BlackTools/Commands/BT.ForCmds.tcl

@@ -24,7 +24,17 @@ global botnick wordsdir sdir black seendir count server uptime {server-online} v
 if {[isbotnick $nick]} { return }
 if {[string equal -nocase $for "for"] && ([lsearch -exact -nocase $split_bots $botnick] > -1)} {
 switch [string tolower $the_cmd] {
-
+alias {
+if {[matchattr $hand mno|MAO $chan]} {
+	set chan1 $chan
+	set type 1
+	set what [lindex [split $arg] 3]
+	set cmd [lindex [split $arg] 4]
+	set cmd_used [lindex [split $arg] 5]
+	set text [join [lrange [split $arg] 6 end]]
+	alias:process $nick $host $hand $chan $chan $type [list $what $cmd $cmd_used $text]
+	}
+}
 update {
 if {[matchattr $hand n]} {
 if {[matchattr $hand q]} { blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none
@@ -2114,6 +2124,22 @@ if {[matchattr $hand nmo|MAO $chan]} {
 	set type 1
 	skippublic:process $nick $host $hand $chan $chan1 $user	$type
 				}
+			}
+default {
+	set alias_check [blacktools:alias_check $hand $the_cmd]
+if {$alias_check != 0} {
+	set counter 0
+	set text [lrange [split $arg] 3 end]
+foreach a $text {
+	incr counter
+	set replace(%${counter}%) $a
+}
+	set replace(%chan%) $chan
+	set text [string map [array get replace] $alias_check]
+	regsub -all {%[0-9]%} $text "" text
+	set text [join $text]
+	comand:pubme:for $nick $host $hand $chan "for ${botnick} $text"
+				}
 			}		
 		}
 	}

+ 7 - 2
BlackTools/Commands/BT.H.tcl

@@ -222,10 +222,8 @@ switch $type {
 }
 
 switch -exact -- [string tolower $command] {
-
 	cmds {
 	switch $access {
-
 VOICE {
 	set cmds [string map [array get replace] $black(say.$getlang.cmdsvoice)]
 	set split_cmds [split $cmds ";"]
@@ -346,6 +344,13 @@ foreach txt [h:wrap [string map [array get replace] [join $show_cmds]] 330] {
 	blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
 		}
 	}	
+}
+	set alias_cmds [blacktools:alias_get $hand $chan]
+if {$alias_cmds != 0} {
+	set text "$black(say.$getlang.alias.7) $alias_cmds"
+foreach txt [h:wrap [join $text] 330] {
+	blacktools:tell:h $nick $host $hand $chan $chan1 h.15 $txt
+	}	
 }
 	switch $type {
 	0 {

+ 28 - 1
BlackTools/Commands/BT.MeCmds.tcl

@@ -22,6 +22,17 @@ global botnick wordsdir sdir black seendir count server uptime {server-online} v
 if {[isbotnick $nick]} { return }
 if {[isbotnick $bnick]} {
 switch [string tolower $what] {
+alias {
+if {[matchattr $hand mno|MAO $chan]} {
+	set chan1 $chan
+	set type 1
+	set what [lindex [split $arg] 2]
+	set cmd [lindex [split $arg] 3]
+	set cmd_used [lindex [split $arg] 4]
+	set text [join [lrange [split $arg] 5 end]]
+	alias:process $nick $host $hand $chan $chan1 $type [list $what $cmd $cmd_used $text]
+	}
+}
 
 update {
 if {[matchattr $hand n]} {
@@ -2112,7 +2123,23 @@ if {[matchattr $hand nmo|MAO $chan]} {
 	set type 1
 	skippublic:process $nick $host $hand $chan $chan1 $user	$type
 				}
-			}		
+			}
+default {
+	set alias_check [blacktools:alias_check $hand $what]
+if {$alias_check != 0} {
+	set counter 0
+	set text [lrange [split $arg] 2 end]
+foreach a $text {
+	incr counter
+	set replace(%${counter}%) $a
+}
+	set replace(%chan%) $chan
+	set text [string map [array get replace] $alias_check]
+	regsub -all {%[0-9]%} $text "" text
+	set text [join $text]
+	comand:pubme $nick $host $hand $chan "${botnick} $text"
+				}
+			}			
 		}
 	}
 }

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

@@ -33,14 +33,24 @@ if {[validchan $mychan] && [matchattr $hand nmo|OVMA $mychan] && ![string equal
 }
 
 switch [string tolower $cmd] {
+alias {
+if {[matchattr $hand mno|MAO $chan]} {
+	set type 2
+	set what [lindex [split $arg] 1]
+	set cmdf [lindex [split $arg] 2]
+	set cmd_used [lindex [split $arg] 3]
+	set text [join [lrange [split $arg] 4 end]]
+	alias:process $nick "prv" $hand $chan $chan $type [list $what $cmdf $cmd_used $text]
+	}
+}
 
 update {
 if {[matchattr $hand n]} {
 if {[matchattr $hand q]} { blacktools:tell $nick $host $hand $chan $chan1 gl.glsuspend none
 	return
 }
-	set what [lindex [split $arg] 2]
-	set option [lindex [split $arg] 3]
+	set what [lindex [split $arg] 1]
+	set option [lindex [split $arg] 2]
 	set type 2
 	update:process $nick "prv" $hand $chan $chan [list $what $option] $type
 	}
@@ -2329,6 +2339,22 @@ if {[getuser $hand pass] != ""} {
 	blacktools:tell $nick "prv" $hand "" "" pass.1 $pass
 			}
 		}
+default {
+	set alias_check [blacktools:alias_check $hand $cmd]
+if {$alias_check != 0} {
+	set counter 0
+	set text [lrange [split $arg] 2 end]
+foreach a $text {
+	incr counter
+	set replace(%${counter}%) $a
+}
+	set replace(%chan%) $chan
+	set text [string map [array get replace] $alias_check]
+	regsub -all {%[0-9]%} $text "" text
+	set text [join $text]
+	comand:pubme:for $nick $host $hand $chan "for ${botnick} $text"
+			}
+		}
 	}
 }