BatBox is an external command that allows using console graphically. Furthermore, it enables also user interactions such as mouse and keyboard input. BatBox is an extremely small program (2 kilobytes) yet powerful and fast utility with with 11 switches.
Author: DarkBatcher
batbox [/d Text] [/g X Y] [/c Color] [/m] [/k[\_]] [/a Character] [/w Duration] [/f State] [/s File] [/o OffsetX OffsetY] [/h Mode] [/p Mode]
Allows user to manage console.
- /A : Prints character associated with a code.
- /C : Changes the color of the text that will be written (unlike cmd's
color
command, it doesn't change all the color) - /D : Prints text.
- /F : Change console's window mode
- /G : Changes cursor position. S
- /H : Hides or show the console's cursor.
- /K[_] : Get a user keystroke. If
/k_
is used, it won't wait for input and returns 0 if no key is pressed. - /M : Get a user click.
- /O : Moves the origin of console. The default origin is (0,0) at the top corner left. This command is useful to make
- /P : Changes the console's window mode.
- /S : Plays a .WAV file.
- /W : Make a delay. The unit for this switch are milliseconds.
- /Y : Same as
/y
, but will detect any mouse action, including movement. It can be used for text hovering. sprites via BatBox.
If you want create graphisms using BatBox, you can generate a BatBox
command line from a text file containing an ASCII art using SpriteBox (->
spritebox
) tool.
You can use multiple options on a single BatBox command line, so the following script:
batbox /g 10 10
batbox /d "Hello world"
batbox /g 0 0
Can be shortened like this:
batbox /g 10 10 /d "Hello world" /g 0 0
You can specify numbers in BatBox's parameter using decimal, hexadecimal and octal bases. For hexadecimal, add "0x" at the beginning of the number and for octal add a "0" also at the beginning.
Example of getting user input through keyboard and displaying ASCII value corrosponding to entered character**
BatBox is fully compatible with cmd.exe
. However, BatBox isn't a native command for Windows, so you have to use the following code to generate it dynamically:
for %%B in (
TVNDRgAAAABzAwAAAAAAACwAAAAAAAAAAwEBAAEAAAAAAAAARwAAAAEAAQAABgAAAAAAAAAA
/kJZtSAAYmF0Ym94LmV4ZQA/2UEnJAMABkNLtVRfSFNhFD9XN/DPcms6ECq7UosewkgTQhAm
01KatZwYRGDX7W73znnvuPdKVi8LHVQ+9RQ9xgSDwnrwwUJIsYcQpJeeykBCagMpobIeyq9z
7p1OIbKH+rbf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b.dat" /q>nul
As BatBox is written in assembly language, porting it to other operating systems is hard. Therefore, it is only avaliable for Windows. If you're looking for a cross-platform alternative, take a look at DarkBox, made by TSnake41.
BatBox is distributed under GNU GPL version 3.
Article: https://batch-man.com/batbox/