mIRC Homepage
Posted By: Er1C The code for a space in mIRC scripting - 27/06/05 09:28 PM
Hi!

What character combination do I need to use in mirc scripting so that it shows as a space?
Posted By: xDaeMoN Re: The code for a space in mIRC scripting - 27/06/05 09:37 PM
$chr(32)
$chr(32) ??
Not sure exactly what you mean.
Posted By: Er1C Re: The code for a space in mIRC scripting - 27/06/05 09:40 PM
Well it's about an IMDb script.

We want the colors out. So I changed this original part:

alias -l _rating {
var %s = $ceil($1), %i 1
while (%i <= 10) { if (%i <= %s) { var %z $+(%z,7*) } | else { var %z $+(%z,14*) } | inc %i }
return $+(11[,%z,11])
}

to

alias -l _rating {
var %s = $ceil($1), %i 1
while (%i <= 10) { if (%i <= %s) { var %z $+(%z,*) } | else { var %z $+(%z,*) } | inc %i }
return $+([,%z,])
}

But now, (the output are 1o * signs so..

ration ********** where the rating is like 7 so you saw 7 stars in color and 3 not in color. but now i removed the colors, you can't see the difference anymore.

so i tried to replace the else stars command with dots, with _ signs but it doesn't look nice. so nice i thought, let's fill the non colored stars (in the original code) with spaces

but how laugh
Posted By: Kanjizai Re: The code for a space in mIRC scripting - 27/06/05 10:50 PM
If $chr(32) doesnt work for you try $chr(160)
wink
Posted By: RusselB Re: The code for a space in mIRC scripting - 28/06/05 02:32 AM
$chr(32) is the international ascii code for the space character, the same thing you get by pressing the space bar.
$chr(160) while in most fonts looks like the same character, it is not the same character and may not be interpreted the same.
Posted By: DaveC Re: The code for a space in mIRC scripting - 28/06/05 02:44 AM
Mirc cant display consecutive spaces, and using your method wont store them either

You can use this, it places a CTRL-O (change to ordinary text) before each space, thus seperating them but invisibly (unless you have colored the line already)
Code:
alias -l _rating {
  var %stars = $iif($ceil($1) &lt;= 10,$iif($v1 &gt;= 0,$v1,0),10)
  return $+([,$str(*,%stars),$str($+(,$chr(32)),$calc(10 - %stars)),])
}


You can use this, it places two CTRL-B's (bold on/bold off) before each space, thus seperating them but invisibly (bold remains what it was already becuase its toggled twice)
Code:
alias -l _rating {
  var %stars = $iif($ceil($1) &lt;= 10,$iif($v1 &gt;= 0,$v1,0),10)
  return $+([,$str(*,%stars),$str($+(,$chr(32)),$calc(10 - %stars)),])
}


You can use this, it places a hardspace $chr(160) which is asc for space + 128, down insead of a space, these are maintained by mirc, however some fonts dont have a blank character as 160 so it well show up as something.
Code:
alias -l _rating {
  var %stars = $iif($ceil($1) &lt;= 10,$iif($v1 &gt;= 0,$v1,0),10)
  return $+([,$str(*,%stars),$str($chr(160),$calc(10 - %stars)),])
}
© mIRC Discussion Forums