mIRC Home    About    Download    Register    News    Help

Print Thread
#17274 28/03/03 08:11 PM
Joined: Mar 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Mar 2003
Posts: 12
I wrote a script that echos the messages coming to a channel. In other words, I show $1- in the channel. Now I have a problem. When using $1- it removes extra spaces. So, lets say for example, someone pastes a ASCII image. The image doesnt show up right because all the spaces are removed. Is there a way to echo $1- without losing the extra spaces?

Thx

#17275 28/03/03 08:59 PM
Joined: Dec 2002
Posts: 169
J
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 169
No. Not yet unfortunately. frown

#17276 28/03/03 09:02 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
By default, mirc tokenizes a string by spaces. This isn't having to do with your script at all, but more how mirc handles strings.


-KingTomato
#17277 29/03/03 10:42 AM
Joined: Dec 2002
Posts: 9
V
vEX Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
V
Joined: Dec 2002
Posts: 9
I haven't tested but would $replace($1-,$chr(32),$chr(160)) solve it ?

#17278 29/03/03 03:53 PM
Joined: Mar 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Mar 2003
Posts: 12
No, doesnt work smirk

If anyone else knows how to do this, please let me know! TY!

#17279 29/03/03 06:51 PM
Joined: Dec 2002
Posts: 230
G
Fjord artisan
Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
its impossible smirk

#17280 30/03/03 02:06 AM
Joined: Mar 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Mar 2003
Posts: 12
Well, actually, I think is partly possible, I just haven't quite figured it out. I downloaded a IRC script called Invision and when reveciving a message it actually has the spaces in there. I'm now looking through the code to find out how they did it. If I get something working, i'll share smile

#17281 30/03/03 07:24 PM
Joined: Mar 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Mar 2003
Posts: 12
Well, I have a IRC script called Inivsion, where it works.
Here is the code they have:

Under on TEXT

if (01 isin $1-) {
echo $chan $timestamp < $+ $iif($nick isop $chan,$r.glob(Nick.Colors,Color.1),$iif($nick ishop $chan,$r.glob(Nick.Colors,Color.2),$iif($nick isvo $chan,$r.glob(Nick.Colors,Color.3),$r.glob(Nick.Colors,Color.0)))) $+ $nick $+ > $visufix($1-)
halt
}

where the visufix alias is:

Visufix {
if ($colour(back) == 0) {
return $replace($1-,00,01,15,14,08,07,8,07,09,03,9,03,11,10,13,06)
}
if ($colour(back) == 1) {
return $replace($1-,01,00,07,08,7,08,03,09,3,09,10,11,06,13,6,13,2,12,02,12,5,04,05,04)
}
}

But if I put that into my code, it doesnt work. Anyone know why? Can someone figure out what colors i have to have for it to work?

THX

#17282 30/03/03 10:28 PM
Joined: Jan 2003
Posts: 87
T
Tat Offline
Babel fish
Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
Heh, invisions coding if funny every time I see it.

Really you have a few odd choices in how to do it.
Replacing $chr(160) for the $chr(32). It does work but not at the echo command itself. You need to replace the spaces with the 160's as soon as you get them. To show this try:

Code:
/set %mytest Hello           Hi
//echo $replace(%mytest, $chr(32), $chr(160))


If you have some problem with 160's I think they are boxes in some really poorly made fonts. You can also replace the $chr(32) with $+($chr(32),$chr(2),$chr(2))


Link Copied to Clipboard