| View previous topic :: View next topic |
| Author |
Message |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sun Mar 27, 2016 7:27 pm Post subject: [SOLVED] Strip control codes italic font (slanted letter) |
|
|
Is there any way to perform strip the italic font (slanted letter) ?
So far I am using this code which I use for colors, bold , underlined, but it does not work for italic font (slanted letter)
| Code: | catch {unbind raw - PRIVMSG *raw:irc:msg}
catch {unbind raw - PRIVMSG *raw:PRIVMSG}
bind raw - PRIVMSG striprivmsg
proc striprivmsg {f k a} {
regsub -all {\002|\003([0-9]{1,2}(,[0-9]{1,2})?)?|\017|\026|\037} $a {} a
*raw:irc:msg $f $k $a
*raw:PRIVMSG $f $k $a
} |
I also tried this code, but it did not work:
| Code: | catch {unbind raw - PRIVMSG *raw:irc:msg}
catch {unbind raw - PRIVMSG *raw:PRIVMSG}
bind raw - PRIVMSG striprivmsg
proc striprivmsg {f k a} {
set a [stripcodes abcgru $a]
*raw:irc:msg $f $k $a
*raw:PRIVMSG $f $k $a
} |
I never cared the italics, but a person tried to play BogusTrivia wrote in italics and the bot not obeyed. _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks 
Last edited by juanamores on Fri Apr 15, 2016 10:52 am; edited 2 times in total |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Mar 28, 2016 6:50 am Post subject: |
|
|
Try with:
| Code: |
unbind raw - PRIVMSG *raw:irc:msg
unbind raw - PRIVMSG *raw:PRIVMSG
bind raw - PRIVMSG striprivmsg
proc striprivmsg {f k a} {
regsub -all {[^\u0020-\u007e]+} $a {} $a
*raw:irc:msg $f $k $a
*raw:PRIVMSG $f $k $a
}
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Mon Mar 28, 2016 2:18 pm Post subject: |
|
|
Dear caesar , I've tried your code, but it does not work neither with the italics nor with bold nor underlined nor colors ... _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Mar 29, 2016 12:48 am Post subject: |
|
|
Oh crap. Haven't tested the code, found it over the Internet and thought might help. You are right, ran a test right now and doesn't seem to be working. Sorry.
I see you tried two methods that should do what you asked for, and I fail to understand why they don't work.
Will open up a test bot to see what's up. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Tue Mar 29, 2016 1:35 pm Post subject: |
|
|
The two anterior methods I mentioned works very well, except for italic font.
Very grateful for your help and if you have any other way to fix it would thank it a lot.  _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Apr 03, 2016 2:46 pm Post subject: |
|
|
Try this:
| Code: |
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $a {} $a
|
Haven't tested it so let me know if works. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Tue Apr 05, 2016 6:02 pm Post subject: |
|
|
| caesar wrote: | Try this:
| Code: |
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $a {} $a
|
Haven't tested it so let me know if works. |
It did not work , but do not worry, I suggested to the user who does not use such font more if you plan to play BogusTrivia.
Very friendly and thanks for the help .  _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Apr 06, 2016 3:21 am Post subject: |
|
|
Just downloaded latest mIRC client to test things out and nothing that I used to know doesn't seem to be working any more.
I have no idea what's the current code for italics.. Only Ctrl + I seems to making text in italics.
Sadly the only option would be to drop the control codes when playing trivia. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Wed Apr 06, 2016 8:46 am Post subject: |
|
|
So I had the idea to see what it looked like, raw.
Tried .console +r in a bot. Can't see it.
Even tried /debug -n newwindow
in mIRC - and can't see it.
Where _IS_ the control code? I've never really thought about this before... _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Wed Apr 06, 2016 6:59 pm Post subject: |
|
|
I'm asking in the mIRC official forum where is the control code.
When responding me I share here....
Edit:
Someone answered mIRC forum that the character is: $chr(29)
I tried and character work , creating the italic font.
Do not know if this can help ... _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Fri Apr 15, 2016 8:43 am Post subject: Strip control codes italic font [Solved] |
|
|
I already solved and it works for all (italics, bold, underline, colors...)
| Code: | | regsub -all {[\001-\010]|[\013-\037]|[\177]|\003([0-9]{1,2}(,[0-9]{1,2})?)?} $a {} a |
Thanks to caesar and willyw for their help and concern to fix it .
IMPORTANT EDIT:
Use this workaround at your own risk, it can cause problems with CTCP .
Please DO NOT use it!
I Do not remove the solution so that it can investigate the reasons that can cause damage to the CTCP .
If a moderator deems it necessary, edit or delete this post. _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
|
| Back to top |
|
 |
|