-
Notifications
You must be signed in to change notification settings - Fork 1
/
Usage.txt
68 lines (53 loc) · 10.8 KB
/
Usage.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
BatBox by DarkBatcher is an external command that allows graphical interface and mouse input in the batch programs. It is a great utility which enables complex output printing console screen in an instance of second. It allows making the batch programs dynamic and can move cursor at any location in just few milli-seconds. In simple words, Batbox allows to manage console screen in a program.
Syntax:
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] ...
OR
BATBOX [/disp text] [/goto X posY] [/color col] [/mouse] [/key[_]] ...
Where:
/d or /disp: Displays required text on the console. After printing required text it doesn't move cursor to new line as ECHO command does. And it also not displays special characters. It shows simple ASCII text on the console.
e.g. Batbox /d "This is simple Text."
/g or /goto: Changes cursor position to a required location on the console. Column and line numbers are starting form 0,0 from the top-left corner of the console window.
e.g. Batbox /g PosX PosY
/c or /color: This parameter changes the color of console Locally, Not like the COLOR command, which changes the color of console Globally. which means, the color of the text printed after this parameter will be changed only. But not for the whole text on the console.
e.g. Batbox /c 0x[ColorCode]
e.g. Batbox /c 0x0A [For Green colored text on black background]
/m or /mouse: Gets a user click from the console. It waits for the user click on the console and outputs the String like, X:Y:Type. It needs to be used in FOR Loop in order for getting proper and standard functioning of the plugin. Let's see an example below:
FOR /F "tokens=1,2,3 delims=:" %%A in ('BatBox /m') DO (
SET _Click=%%C
SET _Y=%%B
SET _X=%%A
)
Type: has 4 possible values:
1 : left click
2 : right click
3 : left double-click (returns first a left click)
4 : right double-click (returns first a right click)
/k[_] or /key[_]: Gets a user keystroke from the console. It waits for the user keystroke from the keyboard and returns the result in the Environment variable '%errorlevel%'. If you'll use /k_ instead for simple /k, then the console will not stop but will pass the control to next code if no key is pressed as '0'. i.e. Errorlevel == 0.
e.g. Batbox /k
/a : Similar to the /d switch or parameter, there we specify string to print on console, But here we can specify the ASCII Code of the character to print on the console.
e.g. Batbox /a 97 [Prints 'a' on the console]
/w : Used for delay in the program. It stops the program for a specified number of milli-seconds.
e.g. Batbox /w 1000 [Stops console for 1 Sec.]
/f : Allows to change console's window mode via program. i.e. allows programmer to make cmd fullscreen via the batch coding. we've noticed that, this parameter is little buggy in the plugin as it works fine in Windows XP and Windows 10 [Tested]. But Don't seems to work in windows 7. So, keep this thing in mid while using it any of your batch programs.
e.g. Batbox /f [mode] [Mode can have values either: 1: Full-screen / 2:Windowed]
/s : Plays a wav file. You can simply play music simultaneously using Multi-threading tricks, as used by Honguito98 in many of his Batch Games. but he used fn.dll for that purpose, instead of batbox.exe.
e.g. Batbox /s [Path of wav file]
/o : Shifts console's original origin (0,0) form Top-Left corner to any other specified point on the console. We've used this awesome switch of Batbox in many of our batch projects, specially in Plot Function, Typography Function, Box Function v.3.0 etc. You can have a look to know its true Potential.
e.g. Batbox /o OffsetX OffsetY
/h : Hides or shows the console blinking cursor. Very useful in GUI programs, where you don't wanna prompt user to type anything and then blinking cursor on the screen seems awkward. So, Hiding it is the only option for us.
e.g. Batbox /h [Mode] [Mode can have values either: 0:Hidden / 1:Visible]
/p : Changes console's windows mode, similar to /f but different in functioning. This switch allows programmer to minimize or maximize the console window via programming. It can take multiple mode values. Take a look at following Table.
e.g. Batbox /p [Mode]
[Mode can have following values:]
0 : Hides the window.
1 : Activate and show the window, restoring it to its original size. This value should not be used because it's reserved to first call to show window. You should use value 9 instead.
2 : Activate the window and minimizes it (show it in task bar).
3 : Activate the window and make it maximized.
4 : Shows the window restored to its original size. Same result as value 1, except that the window does not obtain focus.
5 : Activate the window without modifying it.
6 : Minimizes the window and activate another window.
7 : Minimizes the window. Same result as value 2 except that the window is not activated.
8 : Shows the window without modifying it. Same result as value 1, except that the window does not obtain focus.
9 : Activate the window and set its size and its position to the initial values if the window was either maximized or minimized.
10 : Show the windows and set its size and its position to the default values.
11 : Minimizes the windows, even if the command prompt does not respond. This value is not supposed to be used, as it would be surprising that BatBox continue running even if the command prompt does not respond.