mIRC Home    About    Download    Register    News    Help

Print Thread
Problem with tab spaces showing up as boxes #205975 04/11/08 11:56 PM
Joined: Nov 2008
Posts: 3
S
shipitkthx Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Nov 2008
Posts: 3
Whenever someone copy/pastes something into Mirc that includes a tab space and sends it to me I get a small black box where the tab should be. Is there a way I can make it showup as say...3 spaces instead?

Re: Problem with tab spaces showing up as boxes [Re: shipitkthx] #205979 05/11/08 12:35 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This is font dependent.
The tab key (ascii character 9) will show properly if the correct font is used. The most common fonts will show it correctly, so you are either using a font that is not one of the most common (ie: not Fixedsys or Times New Roman)

Note: I only named two fonts, but there are a lot more. The two I named are the two I use on a regular basis, and I have no problems with any of the characters showing incorrectly.

If the person sending you the information sees it correctly, you should find out which font they are using.

On the other hand, if they are sending it to you as a text posting, rather than via a DCC'd file, you might try this code.

Code:
on ^*:text:*:*:{
  if $chr(9) isin $strip($1-) {
    echo $iif($chan,$v1,$nick) $replace($1-,$chr(9),$+($chr(32),$chr(2),$chr(32),$chr(2),$chr(32)))
    haltdef
  }
}


Note: This code was generated on the spot, so I don't guarantee that it will work, but the theory is sound.

Re: Problem with tab spaces showing up as boxes [Re: shipitkthx] #205981 05/11/08 04:30 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
on ^*:TEXT:*:*: {
  if ($regex($1-,/(\t)/g)) { 
    echo -amt < $+ $nick $+ > $replace($strip($1-),$regml(1),$chr(32) $chr(2) $chr(32) $chr(2) $chr(32)))
    haltdef 
  }
}


The above code shall fix your problem.

Re: Problem with tab spaces showing up as boxes [Re: Tomao] #205982 05/11/08 06:12 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
With the exception of the fact that your code uses regex, what, if any, difference is there between what I posted and what you posted? If there isn't any, why would your code be preferable?

Just curious.

Re: Problem with tab spaces showing up as boxes [Re: RusselB] #205983 05/11/08 06:42 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Hi, RusselB, they are indifferent. And I don't mean to sidetrack your answer in reply to the op. Just thought I'd offer another example of using regex. No offense intended.

Re: Problem with tab spaces showing up as boxes [Re: Tomao] #205984 05/11/08 06:50 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
None taken. I'm trying to learn how to use regex, but due to several problems my learning has been extremely sporadic, so I wondered if there was a specific reason that you used regex, such as catching something my code wouldn't have.

Re: Problem with tab spaces showing up as boxes [Re: Tomao] #206052 06/11/08 05:31 PM
Joined: Nov 2008
Posts: 3
S
shipitkthx Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Nov 2008
Posts: 3
Ok i'm a total noob so I apologize, where do I put this code lol?

EDIT: Ok figured out where to put it, it works for plain text chat, however it doesn't work when someone enters a /me line which is usually how it comes. Is there a simply mode to make it work for those?

Last edited by shipitkthx; 06/11/08 05:55 PM.
Re: Problem with tab spaces showing up as boxes [Re: shipitkthx] #206053 06/11/08 05:57 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Code:
on ^*:ACTION:*:*: {
  if ($regex($1-,/(\t)/g)) { 
    echo -amt < $+ $nick $+ > $replace($strip($1-),$regml(1),$chr(32) $chr(2) $chr(32) $chr(2) $chr(32)))
    haltdef 
  }
}

should solve the "/me" problem you had.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Problem with tab spaces showing up as boxes [Re: shipitkthx] #206054 06/11/08 06:02 PM
Joined: Nov 2008
Posts: 3
S
shipitkthx Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Nov 2008
Posts: 3
Figured it out myself, just changed on Text to on Action, thank you everybody for the help.

Re: Problem with tab spaces showing up as boxes [Re: shipitkthx] #206058 06/11/08 06:33 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You can put both on text and on action event together in the same remote, just in case of one types in the active channel and the other types text via /action, /describe or /me.