mIRC Home    About    Download    Register    News    Help

Print Thread
#127993 19/08/05 08:37 AM
Joined: Sep 2003
Posts: 149
S
Stealth Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Sep 2003
Posts: 149
A while ago I saw a $regsub that inserted a ^O between consecutive spaces. It was something like this:
Code:
 $regsub($mid($rawmsg,$calc($pos($rawmsg,$chr(32),3) +2)),/(?<= |^)(?= |$)/g,,%var)  


I was wondering if there were a way to replace every other space with a $chr(160) instead of putting a ^O between each one. This would greatly help clean up some parts of my script.


mIRC 6.21 - Win XP Pro (SP2) - 2.4 Ghz - 1 GB Mem
irc.x-tab.org
#127994 19/08/05 11:31 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
$regsub($mid($rawmsg,$calc($pos($rawmsg,$chr(32),3) +2)),/\x20\x20/g,$chr(32) $+ $chr(160),%var)

\x20 is just a space, /2spaces/ should work too, you can replace the $chr(160) with the actual character, but you cannot replace the $chr(32) with a space...

#127995 19/08/05 02:53 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Remember that not all fonts display $chr(160) as a space. If you use it and someone isn't using a font that supports it, they'll see all kinds of junk. Also, using ^O isn't the best method as it can break your control code scheme (colors/bold/etc). Much better to do something like inserting ^B^B between spaces.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard