Page 1 of 1

[RELEASE] PRINTCOLOR (for drawing images in Batch)

Posted: 28 May 2011 11:16
by nitt
The first programming language I've ever used was YaBasic, which I used years ago and haven't touched in that long.

I remembered that YaBasic was console-based, and had a "print" command that could print console-space pixels on the prompt of any color and at any location. So I duplicated this command with some coding.

This code:

Code: Select all

@echo off
printcolor 8 2 0
printcolor 8 2 1
printcolor 8 2 2
printcolor 8 2 3
printcolor c 1 4
printcolor c 2 4
printcolor c 3 4
printcolor 5 2 5
echo.
pause


Will give you this:

Image

If you do not already get how it works, type "printcolor /?" for help. It uses the same color hex as the COLOR command.

Download


Please comment on it and make suggestions! I'm good with C# so I may be able to fulfill many requests.


Here is an example of using it for a game or something:

Code: Select all

@echo off
set x=0
set y=0
:start
printcolor f %x% %y%
choice /c wads > nul
if %errorlevel%==1 (
set /a y=%y%-1 )
if %errorlevel%==2 (
set /a x=%x%-1 )
if %errorlevel%==3 (
set /a x=%x%+1 )
if %errorlevel%==4 (
set /a y=%y%+1 )
cls rem delete this line to make your character leave a trail
goto start


Control the white box with the WASD keys.

Re: [Release] PRINTCOLOR

Posted: 28 May 2011 12:23
by nitt
Gah! No one cares... D:

I may add this to Batch+ I'm working on. It's Batch but with a whole series of different commands and ways to program. You will need the Batch+ Studios to compile it, but it will be very much more better useful more much.

Re: [RELEASE] PRINTCOLOR (for drawing images in Batch)

Posted: 28 May 2011 13:02
by Ed Dyreen
There is also something like ansi.sys for command.com, haven't used it allot though but it works.
For CMD there was the add device=c:\winnt\system32\ansi.sys to the config.nt. But I don't know if it works. In that case PRINTCOLOR may be nice. I guess ...

Re: [RELEASE] PRINTCOLOR (for drawing images in Batch)

Posted: 28 May 2011 16:48
by orange_batch
lol nitt, this is a slow forum you gotta give us more than an hour to see new posts. Sometimes weeks.

I'll try printcolor. Btw I tried your Batch Studios, and it failed on my large script among other problems (like extremely slow syntax highlighting, seemed to update the console window for each change rather than doing it in memory first). To be honest, I prefer Quick Batch File Compiler.

Re: [RELEASE] PRINTCOLOR (for drawing images in Batch)

Posted: 28 May 2011 16:53
by nitt
orange_batch wrote:lol nitt, this is a slow forum you gotta give us more than an hour to see new posts. Sometimes weeks.

I'll try printcolor. Btw I tried your Batch Studios, and it failed on my large script among other problems (like extremely slow syntax highlighting, seemed to update the console window for each change rather than doing it in memory first). To be honest, I prefer Quick Batch File Compiler.


It highlights the code every time you type something. And every time you "compile" the code it always rebuilds it. BatchStudios isn't the best, but I'm working on Batch+ Studios. Which is a Batch but a lot more powerful.

Thanks for the input, though. I've never heard of Quick Batch File Compiler.

But if you have any suggestions for PRINTCOLOR, please post.

Re: [RELEASE] PRINTCOLOR (for drawing images in Batch)

Posted: 28 May 2011 17:14
by orange_batch
Yeah ok, to elaborate then, can you make it highlight syntax differently when opening a file? That's what takes a lot of time. I had to disable highlighting before opening my files and leave it as such.

And again, it failed completely with my large script (32 KB+ in size). It contains tons of syntax so I imagine there's a conflict somewhere.

As for Quick Batch File Compiler (QBFC), it's just a compiler, but it's been developed pretty far as a true product. It's fully-functional freeware but, need to buy a license for commercial use or whatnot.

Re: [RELEASE] PRINTCOLOR (for drawing images in Batch)

Posted: 28 May 2011 17:54
by nitt
orange_batch wrote:Yeah ok, to elaborate then, can you make it highlight syntax differently when opening a file? That's what takes a lot of time. I had to disable highlighting before opening my files and leave it as such.

And again, it failed completely with my large script (32 KB+ in size). It contains tons of syntax so I imagine there's a conflict somewhere.

As for Quick Batch File Compiler (QBFC), it's just a compiler, but it's been developed pretty far as a true product. It's fully-functional freeware but, need to buy a license for commercial use or whatnot.


Oh. The syntax highlighting is extremely slow, and not good with large scripts. You can use the resources and compile your script as multiple different Batch files. Ya, I'm not really sure how to improve that.

So, do you like PRINTCOLOR?

Re: [RELEASE] PRINTCOLOR (for drawing images in Batch)

Posted: 28 May 2011 22:05
by Cleptography
nitt, I actually do have a question about your colors program. I have not tested it yet so I know very little about this project, but I have a project that changes the text color for some menus etc.., but I am currently using colorx to accomplish this. It would be nice to have a tool that does this that I could include with the build of my project so people don't have to go downloading other programs from a million other places. Will your program accomplish this?

Re: [RELEASE] PRINTCOLOR (for drawing images in Batch)

Posted: 29 May 2011 06:10
by nitt
Cleptography wrote:nitt, I actually do have a question about your colors program. I have not tested it yet so I know very little about this project, but I have a project that changes the text color for some menus etc.., but I am currently using colorx to accomplish this. It would be nice to have a tool that does this that I could include with the build of my project so people don't have to go downloading other programs from a million other places. Will your program accomplish this?


So you are asking for the application to be able to color specific lines? I could make another application for this if you want.