Old 02-09-2005, 07:37 PM   #1
CoLt-[45]
Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: May 2003
Posts: 32
Question Multi Lines

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
CoLt-[45] is offline   Reply With Quote
Old 02-10-2005, 03:52 AM   #2
durulink
Senior Member
 
Join Date: Mar 2003
Posts: 102
Default

add 'affils(COLIMN)' under affils config
Code:
set affils(COLUMN)	10
and replace 'proc_affils'
Code:
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
					}
				}
			}
		}
	}	
}
durulink is offline   Reply With Quote
Old 02-10-2005, 07:57 AM   #3
CoLt-[45]
Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: May 2003
Posts: 32
Default

:banana: This is exactly how I wanted and it's works 100% good .. many thanks for the code. :banana:
CoLt-[45] is offline   Reply With Quote
Old 02-10-2005, 08:54 AM   #4
durulink
Senior Member
 
Join Date: Mar 2003
Posts: 102
Default

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.
durulink is offline   Reply With Quote
Old 02-10-2005, 09:46 AM   #5
CoLt-[45]
Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: May 2003
Posts: 32
Default

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
CoLt-[45] is offline   Reply With Quote
Reply

Tags
affils, hell, line, lines, long

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql wired57 Suggestions 4 01-25-2003 07:26 AM


All times are GMT -5. The time now is 12:43 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)