[RELEASE] PRINTCOLOR (for drawing images in Batch)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nitt
Posts: 218
Joined: 22 Apr 2011 02:43

[RELEASE] PRINTCOLOR (for drawing images in Batch)

#1 Post by nitt » 28 May 2011 11:16

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.
Last edited by nitt on 28 May 2011 13:28, edited 6 times in total.

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

Re: [Release] PRINTCOLOR

#2 Post by nitt » 28 May 2011 12:23

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.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

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

#3 Post by Ed Dyreen » 28 May 2011 13:02

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 ...
Last edited by Ed Dyreen on 28 May 2011 17:58, edited 1 time in total.

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

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

#4 Post by orange_batch » 28 May 2011 16:48

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.

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

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

#5 Post by nitt » 28 May 2011 16:53

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.

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

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

#6 Post by orange_batch » 28 May 2011 17:14

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.

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

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

#7 Post by nitt » 28 May 2011 17:54

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?

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

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

#8 Post by Cleptography » 28 May 2011 22:05

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?

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

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

#9 Post by nitt » 29 May 2011 06:10

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.

Post Reply