BG.exe v2.5 Utility

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

BG.exe v2.5 Utility

#1 Post by carlos » 18 Dec 2012 21:54

Image

Documentation.txt
BG v2.5 (unicode)

BG.EXE is a tool for print text color in cmd.exe. It accepts regular expressions for print ascii characters. It also have useful functions.

::::: Parameters :::::

Kbd
::Wait until you press any key, and returns the ascii code.
::If an extended key was pressed, returns the second code plus 255. Example. If you pressed the up arrow (224, 72) returns 327 (72+255).

_Kbd
::If any key was pressed, returns the ascii code, else return 0.
::If the key pressed is extended, it returns the second code plus 255. Example. If you pressed the up arrow (224, 72) returns 327 (72+255).

Mouse
::Wait until you press left or right button into console area.
::When you press a valid button of mouse print:
:: 1|2 rowNumber colNumber
:: 1 is left button.
:: 2 is right button.

Time
::Print eight numbers, separated by a space, that corresponds to the current:
::Year Month Day DayOfWeek Hour Minute Second Milliseconds
::
::DayOfWeek value is from 0 to 6. 0 is Sunday, 1 is Monday, ..., 6 is Saturday
::Day value is from 1 to 31
::Month value is from 1 to 12
::Year value is from 1601 to 30827
::Hour value is from 0 to 23
::Minute value is from 0 to 59
::Second value is from 0 to 59
::Milliseconds value is from 0 to 999

Cursor 0 | 1 | 25 | 50 | 100
::hide or show cursor of keyboard or change the size.
::0 hide
::1 show
::25 small size
::50 medium size
::100 large size

Font 0 | 1| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
::change the size of font

Sleep milliseconds
::do a wait or sleep in milliseconds.

Locate row column
::locate the position of cursor in row and column specified, zero index based.

Beep [0-3]
::play a sound of the system asynchronously.

Cp
::print the code page used and set the value in errorlevel.

Color [0-F][0F]
::change the color of the console screen.
::without parameters it print the current color of console screen.

Print text
::print text without new line to end. The text is interpreted how regular expression.
::please see the regular expressions in down.

Print color text ...
::print text in color without new line to end. You can repeat arguments.
::the text recognize the next Regular Expressions:
\n print a newline
\\ print \
\Number A decimal ascii number code from 0 to 255 else the character printed is undefined.
Example: \1 print face character
Note 1: In some cases is needed usage the regular expression of Number with width of 3.
Example: \0655 is A5
Note 2: You can repeat arguments.
Example: BG.exe Print A "Text in color A" B "Text in color B"

Sprite row column [color text ...]
::Begin printing of colored text in the row and col (zero index based). The column is fixed.
::The regular expression: \n is for jump to the next row and the fixed column.
::The regular expression: \0 is for not print any character (transparent).
::Example Code:
Color 07
Set "spi=A \32\32\219\32\32\32\32\32\219\32\32\n"
Set "spi=%spi%\32\32\32\219\32\32\32\219\32\32\32\n"
Set "spi=%spi%\32\32\219\219\219\219\219\219\219\32\32\n"
Set "spi=%spi%\32\219\219 E \219 A \219\219\219 E \219 A \219\219\32\n"
Set "spi=%spi%\219\219\219\219\219\219\219\219\219\219\219\n"
Set "spi=%spi%\219\32\219\219\219\219\219\219\219\32\219\n"
Set "spi=%spi%\219\32\219\32\32\32\32\32\219\32\219\n"
Set "spi=%spi%\32\32\32\219\219\32\219\219\32\32\32"
BG.exe Sprite 2 2 %spi%
Pause >Nul

::::: Colours :::::
[background]foreground

colours values is a one hexadecimal (0123456789ABCDEF) digit for each concept.

0 = Black
1 = Blue
2 = Green
3 = Aqua
4 = Red
5 = Purple
6 = Yellow
7 = White
8 = Gray
9 = Light Blue
A = Light Green
B = Light Aqua
C = Light Red
D = Light Purple
E = Light Yellow
F = Bright White



bg.exe v2.5 official executable checksum:
SHA1: 2dd52a98c56b2d73b18edea55543612a1d130ab2


_doBG.cmd
//for make bg.exe v2.5

Code: Select all

::This make BG.exe v2.5
::Source code at: code.google.com/p/bg-tool/
@Echo off
SetLocal EnableExtensions
Del /f /q /a bg.exe bg.ex_ >nul 2>&1
For %%b In (
"4D534346000000008F080000000000002C000000000000000301010001000000000000"
"00430000000100030FBC160000000000000000924178B6200062672E65786500CCC3D9"
"BC4408BC165B80808D0110C26B00003302563400006F006EBBF6D6B6D75BEF9235D8D6"
"66BD12D938CBACCDAB84FF016A6D993B75ED45495E81BDDBCDB5EEEE77CF6D6B1564B8"
"C6351DA1C50A225A44068C48164BB6F641256448EC830659225108906862E5E61E18F2"
"C71C39AB80B800008DCC80191900CF83AF7BB98FC50BE09B082C4B0613F0408899DDE6"
"281B48B796616EDC2D6FD96A666BC77B6BB49296ED573B9B9649674A532E8A26412520"
"1C3449164812F8111088D89F002000002300404340046DB7ACDB71254204E08C3921C8"
"C7F03FFF07EBFF3E142EDFD0076D1676A2B274DD4180E07E2F4BFFEA056CBE3310FD8F"
"F0955193871FC78BA947203F3CA184724F4922C6994CA33A64F1511F98227EFC869BE2"
"E6A58F8C4E10843030BB100F232E87D320A9E3C0D27D1E1ABA3CB9E42E46DA3F6883B6"
"DAF336F97F676162B283EB8BBB217AEF223F12AE447BCF1102B4EE83AF62415940798C"
"A8AA92DAE38C3E7715F74CFB5608942AD1F544EFA7F5016B8F39BB64355D41C087B4FD"
"D6AF5C923970677990E34CD55E937AFAF452421A8A7592B325C77B605D185742FF4896"
"F741F6B0F1ECD95AAF661200DC9CF424AA09ADD1E672E976B82D1E6B942F516C96AF50"
"CDC0971E37C884EDCDACDB5713B64D3F68F353E31B53F1B100331DA224E6B3AFE956BC"
"3E92EC0CCE6CE4F4ABB2D3756CD395F99E1E8E21BC97DCEFB79D9FEEFB7801619759D7"
"83857A1021DC6FA117E8313B5F014C761AAC7865AFD1F471B920FBCC9B841E9FA15E18"
"5A4B3BDBE897AD4C6BC9AA268A5D26080BE99173FA02C6D7B2284A4FDD2953E0BDB8D6"
"B2B931D785C667B02E3652BB3AF61CCE68881F7A00E18CE0BDA7F306CCA5CE05798F17"
"6637E92ECB8E8DB0DD2B316C9015E5CA9E4F3F5CD59ADBD00BED7C477044C399780978"
"1E2B0391B6AA3C345B7F9F7539A97325D8A0A94B3D8101C772A83CA12E9B44ADA19151"
"AD32D746E53362A119D6A47C6778369300AE0778D28D0FC64B27C606D85FD9C581DD02"
"52ED87943F0DA56DAB3F7EBB191F83F775F143AB0FF15F677EAF1A47A7DE436865FE9F"
"CD156AB385379692EE1EBE33B0B45FDEB3BBD02F67A95FDCDA9CC99EC1CBB888F1BF0C"
"0E9998C48327AF50FC20173C78A8F7AADD6430C578FEE649B8A1038338DC59F70C5E9B"
"6ED8FB863FA0A9EE2E1BC4D5DD5A60CB89A381090DA2F0C97B836EF42F11B279979CD8"
"EED9DA87B4E8FD158CBE80DF1556305F865D6D333EB1A1E9B38F71DCA7D6148866DCE3"
"4A4557B3BE618D2E9E9F04BE575EEF298B104F38C754EE8B4B24AFD11F4EFC4F0B134E"
"C90E2379E306C582B5BCFE7652B86880F8526621F0AEB11AAC4C977C3643666AD05873"
"E538C3EE399819ED27005C41992DD42AD1CCECEE4936592839343760627059B8A23AAB"
"7736CC3C016B0DDBDBC57C8E7DEA8F2C03F5B669CE38E84951810C3F19D32CCF798BEC"
"AF980B6DE783C87B60243FBAA7652577B907BB35CA8A8A5A47BC93BA56D8B7BBD5ECCB"
"EC39BEAF2B05099CB4EC2583B2FBF792D1DFFE2B1BFFB22358C89A1A8DA1AF17AC4BD7"
"9F3587AD9E6FEDBA2F84673B940AC182FD37B0EAAD8676EFDA758CF5E8F3B019B6CB43"
"DF42E56A8693B4078B4942E4004C171EE4AD5C9D42ED5876709C25360BDF5B9BD18C5F"
"D683E71777348E4955EA3F2F2D9C7E3B7B39879DFC607BB0D15801845FC13327B775FA"
"FF1EFFD171C1E480DCE71D1FE285DD41D3AF72FC134373A0C6190B9F71B6BE281AF4F6"
"C0DACADB77B7BE39EC8076172E58BA77656D1B6A3F6E75AA8295F53BF8F006A554CEAD"
"BEE6B7D0BF86B7505D8449B810D772FCCC176F3D06FD342C688EE6B3D22FDA13435C58"
"0E0D6B00EF6677ADE8BBFCFDDEDF5E6F541F42ACE71CF5E6A58EA5D98E6E53928DCDFF"
"807C16CB1EEAE17616E3C69678B9C79F0913F2BF21C9E39CE2525EFA1DAC920CF7FB42"
"5FCB5284E50990D17A002C2E97F025E2B3CFAC2A6C84E971BAA02EE54B7C092CB197D0"
"255209D5C466FB8AA5A2A0ACBE43C493117D28FF957120BF9E9BF4A64DAEF70B3AB6B6"
"61F003383DA4FDFBFF05C343C5595BA7797FC394B49CEEC438DDACECAC5D19085F9AE4"
"5BDBB88E6225ED9F3550FC630A50D4F9B975765A301BCFD9D35074467686742667A6E9"
"8CCDCCDA19F499FA0C2C4638336E675E6176F0B54B6D8AE19CCC8BDFBDA23BB0590F66"
"8DD438B3D361CF3A86160C3273C51FF4C9C59D5C088B8864C3CFD0773B35E1C37B2830"
"FE680D47B000010608A249BC83F02D6E028E96C4FF222A6894502EA0B904E6343E7721"
"62BD59A0EBB668AD0F9A1D667E0057A8B807CF0DFD947A75736BF833A5A03E0F701950"
"FC41F50F991560FB813961B7B3A52583E50C82714891A1400FE05FC2CCFE572A19849C"
"8562114849A4C847AA48C6C89163A3286568932AEAC852BAC612644856C17C5C3A5E55"
"3D1C17AA42FD79A284323DDDA8A75409F52A322635223712E0A6A24975528E91D9D792"
"3CB609854988BF80AAF954F685E9994E744A4584F93B260448C2C6C67BCFD134DBA9A1"
"F82E3695A3D560762ABA7888C6E6F06461505407AAA64ED1AB93F4A4CAA45294789149"
"77D33492D129EDD4782A11A2D6237A4775DC78CE10F1319E4C127A5C965AA4A66B48CA"
"4B75CDEE5D28624E554788796C15C5119B7CACBDDB7E3CB7D6492342771DB362453438"
"D468A7103377641122B672C41B8B3F795121EAE8689316BB0D9DD844C288D564FD799F"
"BA9579A58AC8DB21A9FD46A18889D971144718D0B8EE6F67A1358D7FA0AB18A66579D8"
"05FDBCD822D7735F2F77D6288399332F2F47B06E186D438EC8FFB4ACEDFBBBD45BEBEB"
"DD20EBCFD14806EDB9B02CE17283E887D187E387E40EA83B701F51882A6003057E17C8"
"1C30F8030120017445D020C7242306471E817AA2622C897450D47F8DD0447F23AD8824"
"70BFB4A1647B2A1C20E02BF4292973DBA35BB540DF"
) Do >>bg.exe (Echo For b=1 To len^(%%b^) Step 2
Echo WScript.StdOut.Write Chr^(CByte^("&H"^&Mid^(%%b,b,2^)^)^) : Next)
Cscript /b /e:vbs bg.exe > bg.ex_
Expand -r bg.ex_ >nul
Del bg.ex_ >nul 2>&1
Goto :Eof



Sokobox.cmd
//batch game of puzzles
ImageLink: Sokobox

Post Reply