mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 27
S
silent Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 27
Hi,

I wanted to write an alias, that shows me all Letters from 0-255, i did it so:

Code:
alias test {
  var %i 0
  while (%i <= 255) {
    echo -a $chr(%i)
    inc %i
  }
}
[


when i type "/test" now, all i get is:

Quote:
* /echo: insufficient parameters (line 13, script.ini)


if u put something before or after "$chr(%i)" its shows me all right, but only "$chr(%i)" doesnt work...

if i type it directly in a chanwindow or so:

Quote:
//echo -a $chr(46)


works correct.

Must be a bug, or?

Joined: Apr 2004
Posts: 8
C
CNO Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
C
Joined: Apr 2004
Posts: 8
hi,

imho $chr(0) causes the problem as it's not a real character.
so, this is not a bug but mIRC's normal behaviour.
just set %i to 1 and you should do fine.

sincerly,
CNO

Joined: Jun 2004
Posts: 20
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Jun 2004
Posts: 20
This is in no way something new, all char codes arn't printable.
so just by doing a smal change to your code if works fine.

Code:
alias test {
  var %i 0
  while (%i <= 255) {
    echo -a char: $chr(%i)
    inc %i
  }
}

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
$chr(0) is nothing therefor you need to start counting at 1, also you need to escape $chr(32) as it cant be printed on it's own.
Code:
alias test {
  var %i = 1
  while (%i <= 255) {
    if (%i = 32) { echo -a space | inc %i }
    echo -a $chr(%i)
    inc %i
  }
}


$maybe
Joined: Dec 2002
Posts: 27
S
silent Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 27
Thx. I also thought about that...but shouldnt mIRC show all the "correct" values?

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
What I usually do is add a ^O char at the end of what I'm echoing, that way mIRC'll never throw an error when trying to echo a $null value or a space.

Code:
echo -a $chr(%i) 


Since mIRC interprets the ^O char, there's no issue that you will see it when it's echoed.


Gone.
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
mIRC's own commands are almost all made to halt when an error is found, since it cant print $chr(0) or $chr(32) it will halt.


$maybe

Link Copied to Clipboard