mIRC Home    About    Download    Register    News    Help

Print Thread
#185096 04/09/07 11:30 PM
Joined: Mar 2003
Posts: 27
Z
zorin Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Mar 2003
Posts: 27
Originally Posted By: SladeKraven

When you type several consecutive spaces into the Scripts Editor, only the first space is recognized; all spaces that follow are ignored.
That's why we use $chr(160) to force blank spaces in our scripts.

https://forums.mirc.com/ubbthreads.php?ubb=showflat&Board=5&Number=114693


But is there no way to get two or more of the other "space" $chr(32) to work after each other in a script?

I really need it because $chr(160) is *ucking up in terminal font (Yeah I need to use it) :>

zorin #185106 05/09/07 01:47 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Another method is to use the [bold][space][bold][space][bold] trick. Just put a non-displaying character between the spaces. This will give the appearance of consecutive spaces.

Another method I have seen is to use spaces.dll. I haven't used this method, so I don't know anything beyond the name.

-genius_at_work

zorin #185107 05/09/07 01:48 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Avoid ever using $chr(160) for spaces unless you don't plan to share your script with others. Otherwise you run into problems with various fonts as you have seen.

You have 2 options. First, you can use spaces.dll, which should allow you to have extra spaces. I've never used it, so I don't know exactly what it does to make that happen, but everyone seems to agree that it works well.

Or, to avoid dealing with DLLs, you can use control codes between spaces. Because control codes are hidden, it will appear as though you just have a lot of spaces in a row. Keep in mind that this also increases the number of characters in a line of text and if you have really long lines of text with a lot of spaces, you may run into line too long errors. To use control codes, you should use either Ctrl-B or Ctrl-U (Ctrl-R should also work). Then, be sure to always have an equal number of control codes or you may end up turning bold or underline on or off on part of your text instead of leaving it as-is.

Example:
This  has 2 spaces.
This   has 3 spaces.
This    has 4 spaces.
This     has 5 spaces.

Note how sometimes you have to put 2 codes together for it to make an even number. Of course, you can also just do double codes all of the time, but that increases the number of characters in the line without needing to.

Example:
This    has 4 spaces.


EDIT: Heh, genius_at_work beat me by 13 seconds!

Last edited by Riamus2; 05/09/07 01:48 AM.

Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2003
Posts: 27
Z
zorin Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Mar 2003
Posts: 27
Tnx for the advices, but none of the above seems to work for me :P You see, the script is writing to a txt file, and with "ctrl +b space" its still a box in the file..
And the spaces.dll has five functions: loaded, echo, send, dcc, and input. And none of them seems to work with the "write" command.

Maybe its possible to use the "send" function to send the text to some var before its written, but I did not figure it out..
$dll(spaces.dll, send, PRIVMSG $me : $+ %text) is the only example in the readme for spaces.dll smirk

zorin #185165 05/09/07 11:53 PM
Joined: Aug 2007
Posts: 72
P
Babel fish
Offline
Babel fish
P
Joined: Aug 2007
Posts: 72
what exactly are you doing with the read information?
and what is being written to txt that needs spaces?

not being nosey this will help us help you.


mIRC Scripting: So easy a caveman could do it.
zorin #185166 05/09/07 11:54 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You should be able to use spaces.dll to echo spaces to a window (perhaps a hidden one, created with /window -h @name) and /savebuf or /filter that window to a file.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
qwerty #185169 06/09/07 01:40 AM
Joined: Mar 2003
Posts: 27
Z
zorin Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Mar 2003
Posts: 27
Ah tnx qwerty laugh
Made my day smile


Link Copied to Clipboard