\002\0030,2 is the colours i want to use but i dont know where to put the code that the the output from match variable will be the same colours...proc war_upcoming {nick uhost handle channel arg} {
global war_list war_privchan war_shownumber war_nicksize war_trigger
set channel [string tolower $channel]
if {[llength $arg]==0} {
set arg $war_shownumber
} elseif {([llength $arg]>1)||($arg>10)} {
putserv "NOTICE $nick :\002\0030,2Invalid args ( [string trim $war_trigger]upcoming <number> ) and <number have to be 10 or lower."
return 0
}
if {$channel==$war_privchan} {
set war_upcoming
- foreach war $war_list {
if {([lrange $war 3 4]=="n/a n/a")&&([lindex $war 1]>[unixtime])} {
set war_upcoming [linsert $war_upcoming end [lindex $war 0]]
}
}
if {[llength $war_upcoming]>0} {
putserv "PRIVMSG $channel : \002\0030,2Upcoming Matches :"
set warid ""
for {set x 0} {$x<$arg} {incr x} {
if {$x>[expr [llength $war_upcoming]-1]} {
break
}
set warid [linsert $warid end [lindex $war_upcoming $x]]
}
set infos ""
for {set x 0} {$x<[llength $warid]} {incr x} {
set tempinfos [war_getinfos [lindex $warid $x] $war_nicksize]
set hour [lindex $tempinfos 1]
set date [lindex $tempinfos 2]
set players [lindex $tempinfos 7]
set number [lindex $tempinfos 9]
set actualplayers [lindex $tempinfos 10]
set tempinfos [lreplace $tempinfos 9 10]
set tempinfos [lreplace $tempinfos 4 5]
if {[string first "- Substitute:" $players]>-1} {
set stringindex [string first "- Substitute:" $players]
set players "[string range $players 0 [expr $stringindex-1]][string range $players [expr $stringindex+1] [expr $stringindex+13]][string range $players [expr $stringindex+15] end]"
set tempinfos [lreplace $tempinfos 5 5 $players]
}
set tempinfos [lreplace $tempinfos 5 5 "[lindex $tempinfos 5] ($actualplayers/$number)"]
set tempinfos [lreplace $tempinfos 1 2 "$date - $hour"]
set tempinfos [linsert $tempinfos 1 [lindex $tempinfos 2]]
set tempinfos [lreplace $tempinfos 3 3]
set infos [linsert $infos end $tempinfos]
}
set infos [linsert $infos 0 "ID: Opponent: Date: Maps: Players: Infos:"]
for {set x 0} {$x<6} {incr x} {
set length 0
for {set y 0} {$y<[llength $infos]} {incr y} {
if {[string length [lindex [lindex $infos $y] $x]]>$length} {
set length [string length [lindex [lindex $infos $y] $x]]
}
}
incr length 3
for {set y 0} {$y<[llength $infos]} {incr y} {
for {set z [string length [lindex [lindex $infos $y] $x]]} {$z<$length} {incr z} {
set newelement "[lindex [lindex $infos $y] $x] "
set newinfos [lreplace [lindex $infos $y] $x $x $newelement]
set infos [lreplace $infos $y $y $newinfos]
}
}
}
set length 0
for {set y 1} {$y<[llength $infos]} {incr y} {
if {[string length [lindex [lindex [lindex $infos $y] 2] 0]]>$length} {
set length [string length [lindex [lindex [lindex $infos $y] 2] 0]]
}
}
incr length
for {set y 1} {$y<[llength $infos]} {incr y} {
for {set z [string length [lindex [lindex [lindex $infos $y] 2] 0]]} {$z<$length} {incr z} {
set newelement "[lindex [lindex [lindex $infos $y] 2] 0] "
set newdate [lreplace [lindex [lindex $infos $y] 2] 0 0 $newelement]
set newdate [string range $newdate 0 [expr [string length $newdate]-2]]
set newinfos [lreplace [lindex $infos $y] 2 2 $newdate]
set infos [lreplace $infos $y $y $newinfos]
}
set newdate "[lindex [lindex $infos $y] 2] "
set newinfos [lreplace [lindex $infos $y] 2 2 [join $newdate]]
set infos [lreplace $infos $y $y $newinfos]
}
for {set x 0} {$x<6} {incr x} {
set newelement "\002\0030,2[lindex [lindex $infos 0] $x]"
set newinfos [lreplace [lindex $infos 0] $x $x $newelement]
set infos [lreplace $infos 0 0 $newinfos]
}
for {set x 0} {$x<[llength $infos]} {incr x} {
set infos [lreplace $infos $x $x [join [lindex $infos $x]]]
}
for {set x 0} {$x<[llength $infos]} {incr x} {
putserv "PRIVMSG $channel :[lindex $infos $x]"
}
if {$arg>[llength $warid]} {
putserv "PRIVMSG $channel :\002\0030,2You have seen all match"
return 0
}
} else {
putserv "NOTICE $nick :\002\0030,2No match found"
return 0
}
}
}
thank you for any help!