View Full Version : Different colors for different sections in dZSbot.tcl
Quincy
12-25-2004, 11:08 AM
Hi all. How can I have commands dealing with different sections in different colors? I know that in ioBanana is possible by setting which color u want to use per section, and then using the %scolor variable in the skin, but i couldnt find in dZSbot.tcl where to put sections/color settings.
I'm using ioFTPD + ioA last version, php_psio and dzsbot
Can anyone help?
durulink
12-25-2004, 12:34 PM
edit [proc basicreplace]
proc basicreplace {strin section} {
global sitename
set output [replacevar "$strin" "%sitename" "$sitename"]
set output [replacevar "$output" "%bold" "\002"]
set output [replacevar "$output" "%uline" "\037"]
if { [string match $section "APPS"] } { set section \0034$section\003 }
if { [string match $section "GAMES"] } { set section \0036$section\003 }
if { [string match $section "MV"] } { set section \0033$section\003 }
if { [string match $section "VCD"] } { set section \0037$section\003 }
if { [string match $section "SVCD"] } { set section \0031$section\003 }
if { [string match $section "DOX"] } { set section \00314$section\003 }
set output [replacevar "$output" "%section" "$section"]
return "$output"
}
from. glFTPd
Quincy
12-25-2004, 01:15 PM
Ok, i understand that there's no %scolor variable in dzsbot.
But how can I use that code? Where to put it and how to customize it to dzsbot? (as thats one is for glFTPD aint it).
Thanka
Quincy
12-25-2004, 01:20 PM
oo..OK, i found it, thanks! I'll try it :)
Quincy
12-25-2004, 01:53 PM
ok. have changed dzsbot.tcl like this:
proc basicreplace {strin section} {
#putlog "proc basicreplace"
global sitename
set output [replacevar $strin "%sitename" $sitename]
set output [replacevar $output "%bold" "\002"]
set output [replacevar $output "%color" "\003"]
set output [replacevar $output "%uline" "\037"]
set output [replacevar $output "%section" $section]
return "$output"
if { [string match $section "Stuff"] } { set section \00311$section\003 }
if { [string match $section "old stuff"] } { set section \00314$section\003 }
if { [string match $section "text"] } { set section \00313$section\003 }
set output [replacevar "$output" "%section" "$section"]
return "$output"
}
But got NEWDIR announces in white, for any sections.
How should I change the NEWDIR command?
set announce(NEWDIR) "\..::%boldNew in %section%bold\::..
Have tried with %color but doesnt work.
durulink
12-25-2004, 08:48 PM
proc basicreplace {strin section} {
#putlog "proc basicreplace"
global sitename
set output [replacevar $strin "%sitename" $sitename]
set output [replacevar $output "%bold" "\002"]
set output [replacevar $output "%color" "\003"]
set output [replacevar $output "%uline" "\037"]
if { [string match $section "Stuff"] } { set section \00311$section\003 }
if { [string match $section "old stuff"] } { set section \00314$section\003 }
if { [string match $section "text"] } { set section \00313$section\003 }
set output [replacevar $output "%section" $section]
return "$output"
}
try this.
Quincy
12-26-2004, 04:16 AM
Thanks its workin but output is not what I was looking for. Infact, for any section I used to have the following outputs, each in their section colors:
..::New in Stuff::..
..::SFV in Stuff::..
..::URL in Stuff::..
..::First in Stuff::..
..::Half in Stuff::..
..::done in Stuff::..
with the whole output, except the ..:: ::.. colored in the section specified color, whreas now I have just Stuff in section color and "New in", "SFV in" etc are white.
durulink
12-26-2004, 09:29 AM
in dZSbot.tcl
set announce(NEWDIR) "..::New in %section::.. ~~~"
set announce(NFO) "..::NFO in %section::.. ~~~"
set announce(NFOURL) "..::URL in %section::.. ~~~"
Others are under the control of PHP_pSio.
and very complex. beacuse of
set announce(DEFAULT) "%section :: %msg"
Quincy
12-26-2004, 10:22 AM
Hi
I had already:
set announce(NEWDIR) "\..::%boldNew in %section%bold\::..
and I'm getting "NEW in " in white and just %section appearing with the appropriate color., in particular:
"..:: ::.." are white, which is fine
"New in" is white, while should be same color as %section
"%section" is in appropriate color
durulink
12-26-2004, 11:43 AM
set announce(NEWDIR) "\..::%boldNew in %section%bold\::..
Why did you use '\' char.
It is not sure that erase the char '\'.
or try this setting exactly.
set announce(NEWDIR) "..::New in %section::.. ~~~"
set announce(NFO) "..::NFO in %section::.. ~~~"
set announce(NFOURL) "..::URL in %section::.. ~~~"
Quincy
12-26-2004, 05:25 PM
Have tried this as u suggested
set announce(NEWDIR) "..::New in %section::.. ~~~"
But still have :
New in ---> white
%section --> appropriate color (blue)
:(
Example:
set announce(DEFAULT) "-%sitename- \[%color03%section%color\] + %msg"
;)
Quincy
12-27-2004, 04:53 AM
thats way i would have all sections colored as %color03, aint it, whereas i want each sections having its own color.
chruez
03-04-2005, 09:01 AM
i solved it like this:
first: change the procedure 'basicreplace' to something like this:
proc basicreplace {strin section} {
#putlog "proc basicreplace"
global sitename col obrack cbrack sep
set output [replacevar $strin "%sitename" $sitename]
set output [replacevar $output "%bold" "\002"]
set output [replacevar $output "%color" "\003"]
set output [replacevar $output "%uline" "\037"]
set output [replacevar $output "%section" "$col($section)[b][b]$section"]
set output [replacevar $output "%scolor" "$col($section)[b][b]"]
return "$output"
}
2nd step is to setup what color u want for each section. You should do that somewhere at the beginning of the dzsbot.tcl file so you can easily change the values:
set col(EBOOK) "[c]13"
set col(APPS) "[c]3"
...
You will have to set it for every section but also for stuff like INVITE and UPTIME which also use the %section cookie (set col(UPTIME) "[c]0" e.g.)
Be sure to check the partyline of your eggdrop if you notice an error and add the missing set col line to dzsbot.tcl.
Tcl error in file 'eggdrop.conf':
invalid command name "c"
while executing
"c"
invoked from within
"set col(APPS) "[c]3""
durulink
03-07-2005, 02:57 AM
[c] is ioB's cookie.
You should use \003 instead of [c] in dZSbot.
chruez
03-07-2005, 05:03 AM
if you check default dzsbot.tcl you will find these procedures on the top of the file:
proc u {} {return }; # underline code
proc r {} {return }; # reverse code
proc b {} {return }; # bold code
proc c {} {return }; # color code
proc o {} {return }; # reset attributes code
if you dont have them there, add them and everything should be fine. its much easier to do the coloring this way than the other way...
vBulletin® v3.8.11 Alpha 3, Copyright ©2000-2024, vBulletin Solutions, Inc.