mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 6
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2003
Posts: 6
Hello Guys...
I'm trying to write a mud client...
But I'm facing problems...
ascii codes like.. [32m750
anyway I can converit it to mirc color codes?
also... it comes with a long string...
I tried $replace( $chr(91) $+ 32m,$chr(3) $+ 3 )
but it doesn't work frown

Please Help... appreciated!

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
/help $ansi2mirc


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Feb 2003
Posts: 6
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2003
Posts: 6
Thanks... :tongue:
got the problem solved...
but here comes another...
the ascii art from the login screen
seems to be screwed up... is there anyway.. I can fix this?

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
It could be a multiple-spaces issue. mirc commands cannot handle consecutive spaces, so /echo-ed ascii art (like MOTDs for example) is messed up. If it's that, you can do something about it (I'm assuming you used sockets for the client), by taking advantage of the fact that only mirc commands strip multiple spaces; identifiers/variables don't. Right after you /sockread %variable , replace every occurrence of <space><space> with <space><bold><bold><space>. Here's an alias that might come in handy:
Code:
alias spacestuff var %a | !.echo -q $regsub($1,/(?&lt;= )(?= )/g,,%a) | return %a


You could use that in your on SOCKREAD event like this:
Code:
on *:sockread:blah:{
  .....
  var %var
  sockread %var
  %var = $spacestuff($ansi2mirc(%var))
  .....
}


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Feb 2003
Posts: 6
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2003
Posts: 6
wow.. thanks for your help...
although it's a short script...but it's hard to understand...
thanks pal!


Link Copied to Clipboard