Author Topic: Strip Colors by Default?  (Read 1166 times)

0 Members and 1 Guest are viewing this topic.

John0877

  • New Member
  • *
  • Posts: 4
  • Karma: +0/-0
Strip Colors by Default?
« on: December 02, 2006, 07:30:59 PM »
how would i make it strip all colors by default cause some channels im in dont allow color coding?


also how would i reorder the popup menu or remove some items like GetRight Status for example since i dont use GetRight?

GTS

  • Administrator
  • Addicted
  • *****
  • Posts: 524
  • Karma: +2/-0
  • GTSdll Author
    • GTSdll Homepage
Re: Strip Colors by Default?
« Reply #1 on: December 03, 2006, 09:30:01 PM »
Well, you could modify your theme to not use any colors, or you put -s behind every command (/aud -s).

To make it stip the colors by default you'll need to edit the code in gtsdll.ini.
Line 436:
Code: [Select]
if (s isin %param1) %message = $strip(%message,c)

Change it to:
Code: [Select]
%message = $strip(%message,c)

To reorder the popup menu you'll need to edit the code in gtsdll.ini too.
The popup menus are around line 2538.
It starts with
Code: [Select]
#GTSDLL.PopUp on
menu channel,query {
(it could be "#GTSDLL.PopUp off" too, if you turned off the built-in popups off in settings)

and ends with
Code: [Select]
}
#GTSDLL.PopUp end
You can remove & exchange lines between those if you want.
if you want furher help with editing the popup menus, use "/help popup menus".

There currently is no way, to do the stuff you mentioned without editing the file.
« Last Edit: December 03, 2006, 09:35:46 PM by GTS »
---> GTSdll Homepage <---

John0877

  • New Member
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Strip Colors by Default?
« Reply #2 on: December 04, 2006, 12:24:39 AM »
the popup editing  worked great, thanks

but the color code stripping isnt working all the way. some colors are stripped and some arent. if i do audio status  part of the line isnt colored and part is, if i do torrent status  part of the lines are and part arent, on torrent totals the whole line is color stripped. ive gone though the colors section in the GUI settings in mirc and  theres no color coding  that i can tell in those lines.

i updated to 1.2.7.3 also so the line youre referring to is 435 now :)

the whole line i have is this
n435=      %message = $strip(%message,c)

« Last Edit: December 04, 2006, 12:37:09 AM by John0877 »

GTS

  • Administrator
  • Addicted
  • *****
  • Posts: 524
  • Karma: +2/-0
  • GTSdll Author
    • GTSdll Homepage
Re: Strip Colors by Default?
« Reply #3 on: December 04, 2006, 09:18:10 AM »
Does that mean you solved it? ;)
---> GTSdll Homepage <---

John0877

  • New Member
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Strip Colors by Default?
« Reply #4 on: December 04, 2006, 12:19:48 PM »
not entirely, some color codes remain.

GTS

  • Administrator
  • Addicted
  • *****
  • Posts: 524
  • Karma: +2/-0
  • GTSdll Author
    • GTSdll Homepage
Re: Strip Colors by Default?
« Reply #5 on: December 04, 2006, 10:21:11 PM »
It could be that the [bar] tags of your theme still contain colors.

For example  [bar=20,7,5]

the syntax of it is:
[bar=length,progress-color,progress-left-color]

So you need to change it to [bar=20,-1,-1] (-1 means no color code is used)
Sometimes there is a color code in front or behind the [bar] tag too.
---> GTSdll Homepage <---

John0877

  • New Member
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Strip Colors by Default?
« Reply #6 on: December 05, 2006, 01:45:34 AM »
that did it. :D but now that the progress bar was all one color i saw no point in having it so i just took out the whole  progress bar section instead. *shrug*


thanks

GTS

  • Administrator
  • Addicted
  • *****
  • Posts: 524
  • Karma: +2/-0
  • GTSdll Author
    • GTSdll Homepage
Re: Strip Colors by Default?
« Reply #7 on: December 05, 2006, 05:36:30 AM »
Glad i could help :)
---> GTSdll Homepage <---

Sugiura Midori

  • New Member
  • *
  • Posts: 9
  • Karma: +0/-0
  • Cuteness Kills
Re: Strip Colors by Default?
« Reply #8 on: December 10, 2006, 09:04:44 AM »
On a similar note, is there a way to force it to use colors no matter what?

On the networks that I'm on, +c only "bans" colors from anyone that isn't voiced or higher, so even if I'm an op and the chan is set to +c (no colors) I can't display anything with colors in it!

I don't particularly want to go through the code to take off color stripping, changing it to something like "if (c isincs $gettok($chan(#).mode,1,32) && $me !isreg #) { display w/ colors }" instead of whatever it is now that strips so long as there is a c in the mode :/

GTS

  • Administrator
  • Addicted
  • *****
  • Posts: 524
  • Karma: +2/-0
  • GTSdll Author
    • GTSdll Homepage
Re: Strip Colors by Default?
« Reply #9 on: December 10, 2006, 10:14:55 AM »
I think this is what you want ^^

Replace line 478:
Code: [Select]
if (c isincs $gettok($chan($iif(%gtsdll.cmdparam.channel,%gtsdll.cmdparam.channel,$active)).mode,1,32)) var %message = $strip(%message,c)

with
Code: [Select]
      if ((c isincs $gettok($chan($iif(%gtsdll.cmdparam.channel,%gtsdll.cmdparam.channel,$active)).mode,1,32)) $&
        && ($me isreg $chan($iif(%gtsdll.cmdparam.channel,%gtsdll.cmdparam.channel,$active)))) $&
        var %message = $strip(%message,c)

That would do the trick. It only strips colors when you're a regular nick ;)

I wonder if there is a way to check how a server handles the +c mode.
« Last Edit: December 10, 2006, 10:37:05 AM by GTS »
---> GTSdll Homepage <---

Sugiura Midori

  • New Member
  • *
  • Posts: 9
  • Karma: +0/-0
  • Cuteness Kills
Re: Strip Colors by Default?
« Reply #10 on: December 11, 2006, 01:06:18 AM »
Thanks, that worked perfectly! (I thought I'd have to change a ton more lines than that :/ )

Yes, the easiest way is to simply check the version of the ircd, the main ones would be easy to code, but you'd have to have something that adapted to new ones that you don't know about, perhaps adding them to the table for the user (and if it's not too suspicious, report it to your site, which could then update the table for everyone, and each revision you'd have a more up to date table.) 

I know that plexus will do it that way (only blocks colors if you're a reg), unreal blocks it regardless of your chan status, and digircd-1.1(01)-beta acts the same as plexus.  Perhaps you and your staffers are on other networks and can do a "/raw version" look at the $1 and make a hashtable, or a couple variables that list each network type under what they allow.  I figure this would be easier than just listing by network since networks can change and you can't look at all 3k+ networks that are prolly out there.