| 1. |
Solve : Multiple Colours.? |
|
Answer» nope, just echo's it, if i type in ansi /? in cmd. it ays it does not recognise it, is it installed properly?Hi I doubt that the batch command has any way of telling whether or not it ANSI.sys is actually doing anything. Run these under COMMAND Code: [Select]C:\>mem /c Conventional Memory : Name Size in Decimal Size in Hex ------------- --------------------- ------------- MSDOS 12368 ( 12.1K) 3050 KBD 3296 ( 3.2K) CE0 HIMEM 1248 ( 1.2K) 4E0 ANSI 4192 ( 4.1K) 1060<---ANSI.SYS is loaded---< COMMAND 4160 ( 4.1K) 1040 DOSX 34720 ( 33.9K) 87A0 COMMAND 5312 ( 5.2K) 14C0 KB16 6096 ( 6.0K) 17D0 FREE 112 ( 0.1K) 70 FREE 583584 (569.9K) 8E7A0 Total FREE : 583696 (570.0K) Upper Memory : Name Size in Decimal Size in Hex ------------- --------------------- ------------- SYSTEM 221168 (216.0K) 35FF0 DOSX 128 ( 0.1K) 80 MSCDEXNT 464 ( 0.5K) 1D0 MOUSE 12528 ( 12.2K) 30F0 REDIR 2672 ( 2.6K) A70 FREE 1360 ( 1.3K) 550 FREE 6160 ( 6.0K) 1810 FREE 17504 ( 17.1K) 4460 Total FREE : 25024 ( 24.4K) Total bytes available to programs (Conventional+Upper) : 608720 (594.5K) Largest executable program size : 582192 (568.5K) Largest available upper memory block : 17504 ( 17.1K) 1048576 bytes total contiguous extended memory 0 bytes available contiguous extended memory 941056 bytes available XMS memory MS-DOS resident in High Memory Area Code: [Select]@echo off mem /c > mem.txt find "ANSI" mem.txt >nul if errorlevel 1 goto no echo ansi is loaded goto next :no echo ansi is not loaded :next I have now come to the conclusion that ANSI is in use. All I need to know now is how to get multiple colours using ANSI in a batch file.Hi Here is an old file that worked on Windows 95. The last line used ANSI to modify the prompt to give colours that distinguished which drive the command shell was set to. If you launch COMMAND.COM then rename this as *.bat and run it the prompt should change colour as you go through alternate "CD C:\" , "CD D:\" etc commands. You should only need the last line - but I wont edit this myself because NOTEPAD does all sorts of strange things for me. Regards Alan. [Saving space - attachment deleted by admin]Thanks for your help but I am looking for a straight answer, for instance to get echo red as red on one line type...blah and to get echo blue, blue on another line type..... From your advice: Code: [Select]prompt $p$G$E[s$E[1;5;7m$E[0$N$E[0m$E[Does nothing. But thanks for your time so far.Quote from: Jacob I am looking for a straight answer, The straight answer is that you can't use ansi.sys to make coloured text in XP or Vista. You can use 3rd party utils like ctext.exe http://dennisbareis.com/freew32.htm Thank you, i've been waiting for this answer for about a week, and finally it has come. Well after unzipping it I had the desired effect in seconds, thanks for your help ALAN, and of course Dias.Quote from: Jacob on November 06, 2008, 01:22:04 PM Thank you, i've been waiting for this answer for about a week It is bad manners to complain that you have waited so long! You should be glad you got an answer at all! Quote and of course Dias. And also little Dias who found you the free software! YES, thanks, time of the month? Oh, and you should see my game with these new colours. If their health is below half it goes red but if it is above half then it is green. <3 (video attached as a .zip) [Saving space - attachment deleted by admin]You did this with ctext.exe ? I did not think you could have different colours on the same line? It looks very good! I was only teasing you before. Yes I did, and thank you for your help, you have helped me on practically everything I have posted here. To do two colours on the same line just do not use {\n} Don't worry, and thanks for your amazing help once again, Dias saves the day. Here is how you do more than 1 colour per line. Code: [Select]@echo off ctext.exe "{0A}0A - Bright Green{0B}0B - Bright Cyan{\n}" pause >nul Just keep adding {colour}'s |
|