PDA

View Full Version : Multi Lines


CoLt-[45]
02-09-2005, 07:37 PM
Let's just say that i've got 50 affils on the same section, how do I break it into multiple lines in the dzsbot.tcl i.e. 10 affils per line? because having 1 line it's a hell of a long line and the end are always missing :(

Any script I should know? or any suggestion / tips?

TIA

durulink
02-10-2005, 03:52 AM
add 'affils(COLIMN)' under affils config
set affils(COLUMN) 10

and replace 'proc_affils'
proc proc_affils {nick uhost hand chan arg} {
global affils sections announce disable
if { $disable(AFFILS) == 0 } {
if { $arg == "" } {
foreach section $sections {
if { ! [info exists affils($section)] } { continue }
set af $affils($section)
set sl [llength $af]
for {set i 0} {$i < $sl} { set i [expr $i + $affils(COLUMN)]} {
set j [expr $i + $affils(COLUMN) - 1]
if {$j >= $sl} {
set sr [lrange $af $i end]
} else {
set sr [lrange $af $i $j]
}
set output $announce(AFFILS)
set output [replacevar $output "%affils" $sr]
set output [basicreplace $output $section]
sndchan "putserv" $chan $output
}
}
} else {
foreach section $sections {
if { ! [info exists affils($section)] } { continue }
if { [string match -nocase $section $arg] == 1 } {
set af $affils($section)
set sl [llength $af]
for {set i 0} {$i < $sl} { set i [expr $i + $affils(COLUMN)]} {
set j [expr $i + $affils(COLUMN) - 1]
if {$j >= $sl} {
set sr [lrange $af $i end]
} else {
set sr [lrange $af $i $j]
}
set output $announce(AFFILS)
set output [replacevar $output "%affils" $sr]
set output [basicreplace $output $section]
sndchan "putserv" $chan $output
}
}
}
}
}
}

CoLt-[45]
02-10-2005, 07:57 AM
:banana: This is exactly how I wanted and it's works 100% good .. many thanks for the code. :banana:

durulink
02-10-2005, 08:54 AM
sorry, there is a missing.

set output $announce(AFFILS)
set output [replacevar $output "%section" $section]
set output [replacevar $output "%affils" $affils($section)]

insert a red part.
I had changed proc of basicreplace.
so i dont need that. but you are not.

CoLt-[45]
02-10-2005, 09:46 AM
i've done the insert you've asked me to do - I can't really see the different - but thanks for the update tho.

Cheers again