Go Back   FlashFXP Forums > > > >

Harm's scripts ioBanana, Readd script, ioVote

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-12-2005, 03:08 AM   #1
eger
Member
FlashFXP Beta Tester
ioFTPD Foundation User
 
Join Date: Mar 2003
Posts: 40
Default [Fixed] per section colours in ioB2

Just wondering if there are colors per sections (%scolor) in ioB2. I was reading a lot about the %scolor variable in v20. But i'm not sure if v20 is the same as ioB2. I also went looking in the tcl files and can't find an refernce to scolor. So maybe it wasn't added or was removed.

Just want to find out so I can stop looking and just make the skin without it =)

Thanks!
eger is offline   Reply With Quote
Old 11-12-2005, 04:04 AM   #2
eger
Member
FlashFXP Beta Tester
ioFTPD Foundation User
 
Join Date: Mar 2003
Posts: 40
Default

Hmm... maybe i'm on the right track.

I was editing some of the code in ioBanana.tcl to get colors per section and did this:

Added:
set output [ioB:replacevar $output "%scolour" $colour($section)]

Inside proc ioB:basicreplace and added colour as a global. Then in the announce section I added:
set colour(APPS) 8

Then in my skin made [c]%scolour %section[c]

It looks liek it's working. But I am too tired to continue testing... Though it didn't work for a section that started with a number (like 0DAY) so I had to add the space. Is there a way to escape it or put 2 variables next to eachother and not conflict?

Maybe someone can help me out there =)

EDIT: Guess this wasn't that easy... everything breaks except sections that have colors set. Still trying to find out why.
eger is offline   Reply With Quote
Old 11-12-2005, 02:24 PM   #3
Harm
Too much time...
Ultimate Scripter
 
Join Date: Jul 2003
Posts: 1,430
Default

You're getting close indeed. Perhaps I should readd that to the next release. I don't use it myself and was probably too focused on implementing core features to think about this one.

You should be able to achieve that using something like this:
Code:
proc ioB:basicreplace {section strin} {
global ioBvar colour
if {[info exists colour($section)]} {
	set col $colour($section)
} else {
	set col $ioBvar(colour)
}	
set output [ioB:replacevar $strin "%sitename" $ioBvar(sitename)]
set output [ioB:replacevar $output "%colour" $ioBvar(colour)]
set output [ioB:replacevar $output "%scolour" $col]
set output [ioB:replacevar $output "%section" $section]
return "$output"
}
You then need to define the $colour($section) variables.

You have indeed spotted a weakness of the irc colour system. If the coloured word starts with a number, this one might be interpreted as a part of the coulour code itself. You can add a space after the colour number or use a two digits colour number.
Harm is offline   Reply With Quote
Old 11-12-2005, 02:30 PM   #4
eger
Member
FlashFXP Beta Tester
ioFTPD Foundation User
 
Join Date: Mar 2003
Posts: 40
Default

I was working on exactly that Harm!!

But... not knowing tcl or the syntax I was getting lost. Thanks a bunch!

If I modify it or get it working well I will let you know and maybe you can add it to the next release.

ioB2 is coming along nicely. Keep it up =)

EDIT: Also. To get around having the space I was able to stop the color processing by adding a [b][b]. So color would stop at the bold, and the bold would open up again to keep everything the way it was. Seems to work OK.
eger is offline   Reply With Quote
Old 11-13-2005, 04:02 AM   #5
eger
Member
FlashFXP Beta Tester
ioFTPD Foundation User
 
Join Date: Mar 2003
Posts: 40
Default

Harm,

That new basicreplace works perfect for color per section. For anyone wanting to try, make the code adjustment to proc ioB:basicreplace posted by Harm above. Then be sure to add the colors to ioBanana.tcl:
Code:
set ioBvar(colour) 7
set colour(APPS) 5
set colour(0DAY) 5
set colour(MP3) 2
Then in your skin you can use the %scolour variable for that sections color. Example NEWDIR:
Code:
set announce(NEWDIR) "\[[b][c]%scolour[b][b]%section[c]-[c]%colourNEW[c][b]\] [b]%user[b]/%group has just started [b]%relname[b]."
Thanks Harm!
eger is offline   Reply With Quote
Reply

Tags
%scolor, find, iob2, refernce, v20

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


All times are GMT -5. The time now is 05:02 PM.

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