mIRC Home    About    Download    Register    News    Help

Print Thread
Only ops can write in color #136926 05/12/05 07:02 PM
Joined: Mar 2005
Posts: 5
R
rOglrah Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Mar 2005
Posts: 5
I don't know if this topic is related to the scripts forum, because maybe there's a way threw the channel options. Anyway, I don't know about such thing.
Is there any way to allow ops only to write in color in my channel?

Thanks in advanced.

Re: Only ops can write in color #136927 05/12/05 07:10 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
As far as I know, there is no way to do that other than possibly kick users who uses colors. In that case...

Code:
on @*:text:*:[color:red]#YourChannel[/color]:{
  if ($chr(3) isin $1- && $nick !isop #) { kick # $nick }
}

Re: Only ops can write in color #136928 05/12/05 08:41 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
On ^@*:Text:*:#: {
  if ($chr(3) isin $1- || $chr(3) !isin $1-) {
    var %ct = $chan, %dt = echo -t %ct $+(<,$nick,>) $1-
    if ($nick isop %ct) %dt
    else {
      $replace(%dt,$1-,$strip($1-))
    }
  }
  haltdef
}


Or schaefer31's way if you want to kick the users. smile

-Andy

Re: Only ops can write in color #136929 06/12/05 02:52 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
To do this the way I think you want it, you'd have to edit the ircd (server) code. There would need to be a channel mode that only allows ops to use colors.

The server I'm on has 2 modes to deal with colors in channels. Channel mode +S strips all color codes from incoming text and then displays the uncolored message. Channel mode +c completely blocks any text that has colors in it.

-genius_at_work

Re: Only ops can write in color #136930 06/12/05 10:25 AM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
(A || not A) is just the same as $true, so I hope you meant something else smile

Re: Only ops can write in color #136931 06/12/05 08:48 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Kelder is correct, the first if-statement always evaluates to $true, and it is also unnecessary. If there is a color code present, it will be stripped out by $strip, otherwise nothing will be removed. I altered the $strip command in the example to only remove color codes (that's all that was asked).

Code:
on ^*:TEXT:*:#: {
  echo -t $chan $+(<,$nick,>) $iif($nick isop $chan,$1-,$strip($1-,[color:red]c[/color]))
  haltdef
}
}


-genius_at_work