1.

Solve : Batch - CHGCOLOR/ECHOJ Help?

Answer»

Hello.

I need help with the command CHGCOLOR and ECHOJ (Extra commands made by Jim Lawless).
This is the code:

Code: [Select]MODE con lines=20 cols=31
title ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
:: sndrec32 /play /close /embedding .\Windows XP Logon Sound.wav
color 02
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º
chgcolor 07
echoj " Fallen INK Corp."
chgcolor 02
echo º
echo ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
I have problems with lines 6 and 8, I can't get them to fit in one line.
Here is a pic of what the problem looks like:



If anyone can figure out how i can get the lines to be even, reply.
It's not as easy as it looks to fix it, trust me.

Thank you!
// DARKOMESIASto make two lines of code fit on one line you need to attach them with &.
example:
Code: [Select]@echo off
set a=1 & echo %a%
PAUSE>nul
Please, give me an example. To make it work i have to put THREE lines of code into one, and the command "echoj" and "chgcolor" is not like "echo" or "color" it's a big differense.

Example:
Code: [Select]@echo off
title Hello World!
color 70 ((as you can see this MAKES the background white with black TEXT))

echo Hello World! ((this turns up as the command "color" is telling it to do))

chgcolor 72 ((this will make the text turn up as green while "Hello World!" will still turn up as "color" tells it to do))
echoj "Hello" (("chgcolor" will make this text green))
chgcolor 74
echoj "World!" ((and will make this text red ON THE SAME LINE as the text "Hello"A puzzle for a Sunday afternoon. I can think of worse ways of passing time.

Code: [Select]@echo off
chgcolor 02
echoj $c9 $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $bb & echo.
<nul set /p z= º
chgcolor 07 & echoj $20 $20 $20 $20 $20 & <nul set /p z=Fallen Ink Corp. & chgcolor 02 & echo º
echoj $c8 $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $cd $bc

Mr. Lawless' website and an ASCII chart was all that was needed.

Edit: Lines 3 & 4 are wrapped in the forum. Combine them into a single line in your editor.Quote from: DarkOMesias on June 10, 2012, 08:50:49 AM

Please, give me an example. To make it work i have to put three lines of code into one, and the command "echoj" and "chgcolor" is not like "echo" or "color" it's a big differense.

Example:
Code: [Select]@echo off
title Hello World!
color 70 ((as you can see this makes the background white with black text))

echo Hello World! ((this turns up as the command "color" is telling it to do))

chgcolor 72 ((this will make the text turn up as green while "Hello World!" will still turn up as "color" tells it to do))
echoj "Hello" (("chgcolor" will make this text green))
chgcolor 74
echoj "World!" ((and will make this text red ON THE SAME LINE as the text "Hello"
I believe this may be what you are looking for, but I may be wrong.
Code: [Select]@echo off
title Hello World!
color 70 ((as you can see this makes the background white with black text))

echo Hello World! ((this turns up as the command "color" is telling it to do))

chgcolor 72 ((this will make the text turn up as green while "Hello World!" will still turn up as "color" tells it to do))
echoj "Hello" (("chgcolor" will make this text green)) & chgcolor 74 & echoj "World!" ((and will make this text red ON THE SAME LINE as the text "Hello"
an ampersand let's you put multiple commands on the same line. It doesn't effect the output from those commands.


Discussion

No Comment Found