mIRC Homepage
Posted By: chump $strip codes for nicks - 26/09/06 07:05 AM
hi is it possible with a single script to turn off $strip codes for just that nick? i just need 1 off..ie no colour no bold just 4 that nick..cheers smile
Posted By: RusselB Re: $strip codes for nicks - 26/09/06 07:39 AM
I think this is what you're looking for.
Code:
 on ^*:text:*:#:{
if $nick != <nick> {
echo $chan $nick $strip($1-)
}
else {
echo $chan $strip($1-)
}
haltdef
}
on ^*:action:*:#:{
if $nick != <nick> {
echo $chan $nick $strip($1-)
}
else {
echo $chan $strip($1-)
}
haltdef
} 


That will strip the colour, bold, underline and reverse codes from all text and actions performed in the channel, except for the person named. Replace <nick> with the nick of the person that you want exempted.

Note: This will not work properly combined with a code that has the command /strip in the on start or on load events.
Posted By: DaveC Re: $strip codes for nicks - 26/09/06 08:35 AM
on ^*:text:*:#:{ if ($nick == <nick>) { haltdef | echo -itlbfmrc normal $chan $+((<,$nick,>) $strip($1-) } }
on ^*:action:*:#:{ if ($nick == <nick>) { haltdef | echo -itlbfmrc action $chan * $nick $strip($1-) } }

Those might work a bit better, they take action only should the nick be matched, otherwise they leave it for what ever else wants to effect the output.
Posted By: chump Re: $strip codes for nicks - 26/09/06 01:56 PM
thx guyz but neither of the two above seem to work for me frown
Posted By: DaveC Re: $strip codes for nicks - 26/09/06 07:32 PM
Well the problem might lay with what you have done, or it might lay with what you havent yet done, or it might lay with that you didnt really tell us exactly what you wanted done.

(1) where did you put the code you were given, its ment to go into a remote script file press alt-r in mirc then select file/new

(2) the <nick> is ment to be changed to the nick in question , did you do that?

(3) I made an asumption it was a nick saying soemthing in channel that you wanted to effect. is it?
(b) you asked for stripping to be turned OFF, but then proceedded to ask for stripping to be turned ON for one specific nick, which was it?
(c) what is the nature of the reason you need the color stripped/bold/etc stripped from this nicks text anyway?

on ^*:text:*:*:{ if ($nick == nick) { haltdef | echo -itlbfmrc normal $iif($chan,$chan,$nick) $+((<,$nick,>) $strip($1-) } }
on ^*:action:*:*:{ if ($nick == nick) { haltdef | echo -itlbfmrc action $iif($chan,$chan,$nick) * $nick $strip($1-) } }

* i think they well work for channel or pms
Posted By: chump Re: $strip codes for nicks - 27/09/06 05:38 AM
hi,no i never asked for it to by turned on again original post said i need it to be turned off...ok i need it so when a certain nick announces..it strips the colour, bold just for that nick..
its going to be striping what a paticular bot says..and once its been striped i then send a msg to chan..such as..thankyou etc..hope this is a bit clearer to understand smile

il paste some of the code i am trying to work it in to

on *:text:ok**:#test: {
if (($nick == chanbot) && (mybot == $me) {
var %text = $1-
var %filename = mytext.txt
var %filelines = $lines(%filename)
var %found = false, %foundline, %matched, %i = 1
while (%i <= %filelines) {
var %readfile = $read(%filename,%i)
if (%readfile isin %text) { %found = true | %foundline = $readn | %matched = %readfile }
inc %i
}
if (%found == true) { goto tests-1 }
}
if (%found == false)
/msg #test 4[0this is good4]
goto end


at the mo chanbot is all in bold with colour so my script isnt picking it up..but when i turn off all bold,colour etc it works fine...but i do need my other bold,strip left on for rest of nicks..just for chanbot i need it turned off smile
Posted By: Lpfix5 Re: $strip codes for nicks - 27/09/06 05:57 AM
Quote:
hi,no i never asked for it to by turned on again original post said i need it to be turned off...ok i need it so when a certain nick announces..it strips the colour, bold just for that nick..
its going to be striping what a paticular bot says..and once its been striped i then send a msg to chan..such as..thankyou etc..hope this is a bit clearer to understand smile

il paste some of the code i am trying to work it in to

on *:text:ok**:#test: {
if (($nick == chanbot) && (mybot == $me) {
var %text = $1-
var %filename = mytext.txt
var %filelines = $lines(%filename)
var %found = false, %foundline, %matched, %i = 1
while (%i <= %filelines) {
var %readfile = $read(%filename,%i)
if (%readfile isin %text) { %found = true | %foundline = $readn | %matched = %readfile }
inc %i
}
if (%found == true) { goto tests-1 }
}
if (%found == false)
/msg #test 4[0this is good4]
goto end


at the mo chanbot is all in bold with colour so my script isnt picking it up..but when i turn off all bold,colour etc it works fine...but i do need my other bold,strip left on for rest of nicks..just for chanbot i need it turned off smile


The only problem i see with either scripts is that the STRIP tag is not included with the $strip evaluation

using $strip alot in my server scripts you have to add a tag to $strip so example

on ^*:TEXT:*:#:{
if ($nick == THENICK) { echo # $+(<,$nick,>) $strip($1-,bc) | halt }
}

will strip the color and bold out of the text and halt previous text however, should you have another ON TEXT script the HALT portion of this script will conflict but still achieve what you want

tag B = Bold
tag U = Underline
tag C = Color
tag R = Highlight
the rest i dont know I have not used them
Posted By: RusselB Re: $strip codes for nicks - 27/09/06 06:00 AM
You're contradicting yourself again. When stripping is on, then bold, underline, colours and reverse text show as normal text.
When stripping is off, then those items show as they are entered.

Here's where the contradiction comes in
Quote:
i need it to be turned off
which means that the messages from that nick will show with bold, underline, colours and/or reverse characters.
Quote:
i need it so when a certain nick announces..it strips the colour, bold just for that nick..
, this shows me that you want the text from that nick to have the bold, underline, colours & reverse stripped from the text, leaving plain text.

Please decide which of those two you want, hopefully my explanation of the terminology will make things easier, then we can work on getting the code to you.
Posted By: RusselB Re: $strip codes for nicks - 27/09/06 06:04 AM
The options you have listed are the only options available (by themselves, or in combination with others of those options). By default, if no option is supplied, then all are presumed. Therefore $strip($1-) is the same as $strip($1-,burc)
Posted By: chump Re: $strip codes for nicks - 27/09/06 06:20 AM
is there a way to do it so when the bot annouces i will see the line from bot stripped because at present it sends to chan as noraml then echoes back ..so i am seeing two lines of same text ..one strippped one unstripped..i am trying to get it so soon as that bot msg the chan i see it stripped if you see what i mean.
Posted By: chump Re: $strip codes for nicks - 27/09/06 06:34 AM
hi..what i meant by turning off was turning off the colour and turning off the bold for that certain nick..sorry if you got confused by what i said. and yea it is plain text i want to display from a certain nick. soon as it annouces.
Posted By: Lpfix5 Re: $strip codes for nicks - 27/09/06 08:28 AM
The reason why its not halting your text like i said previously is because you may have another ON TEXT event somewhere that is conflicted, because any scripts shown here are setup to proceed to halt the original text.
Posted By: DaveC Re: $strip codes for nicks - 27/09/06 10:07 AM
ok this is a pretty radical aproach, but should work for blocking THE-NICKNAME from being in color/bold/any thing else in a channel.
Start it using /start.up

Code:
alias start.up { !.debug -i nul debug.alias }
alias -l debug.alias {
  if (($+(&lt;- &amp; PRIVMSG #*) iswm $1) &amp;&amp; ($+(&amp; :,[color:blue]THE-NICKNAME[/color],!*) iswm $1)) {
    !tokenize 32 $strip($1-)
    !var %nick = $mid($gettok($2,1,33),2)
    !.ignore -c %nick | !.timer 1 0 !.ignore -rc %nick
    if ($+(:ACTION *) iswm $5-) { !echo -itlbfmrc action $4 * %nick $+($left($mid($5-,10),-1),$iif(($right($5-,1) != ),$v1)) }
    else                         { !echo -itlbfmrc normal $4 $+(&lt;,%nick,&gt;) $mid($5-,2) }
  }
}
© mIRC Discussion Forums