Add files via upload

pull/20/head
Matthew Clark 1 year ago committed by GitHub
parent 3fe58083b5
commit bc6c289868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,189 @@
@Echo off
Set _Ver=4.0
::The following Function is created by kvc...don't modify it...if you don't know what are you doing...
::it takes following arguments...
:: it is the ver.4.0 of Box function... and it contains diffrnet types of Box printing options... #kvc
rem :: Unwanted parameters are removed ... (i.e. Dialogue Box...) Make the color code for FG and BG same for simply getting a dialogue box...
:: [%1 = X-ordinate]
:: [%2 = Y-co_ordinate]
:: [%3 = height of box]
:: [%4 = width of box]
:: [%5 = width From where to separate box,if don't specified or specified '-' (minus),then box will not be separated.]
:: [%6 = Background element of Box,if not specified or specified '-' (minus),then no background will be shown...It should be a single Character...]
:: [%7 = the colour Code for the Box,e.g. fc,08,70,07 etc...don't define it if you want default colour...or type '-' (minus) for no color change...]
:: [%8 = The Style / type of box you want to print.]
:: [%9 = _Variable to save output to.]
rem #kvc
rem :: Visit www.thebateam.org for more extensions / plug-ins like this.... :]
rem #TheBATeam
If /i "%~1" == "" (goto :help)
If /i "%~1" == "/?" (goto :help)
If /i "%~1" == "-h" (goto :help)
If /i "%~1" == "help" (goto :help)
If /i "%~1" == "-help" (goto :help)
If /i "%~1" == "ver" (echo.4.0&&goto :eof)
If /i "%~2" == "" (goto :help)
If /i "%~3" == "" (goto :help)
If /i "%~4" == "" (goto :help)
:Box
setlocal Enabledelayedexpansion
set _string=
set "_SpaceWidth=/d ""
set _final=
set x_val=%~1
set y_val=%~2
set sepr=%~5
if /i "!sepr!" == "-" (set sepr=)
set char=%~6
if /i "!char!" == "-" (set char=)
if defined char (set char=!char:~0,1!) ELSE (set "char= ")
set color=%~7
if defined color (if /i "!color!" == "-" (set color=) Else (set "color=/c 0x%~7"))
Set Type=%~8
If not defined Type (Set Type=1)
If %Type% Gtr 4 (Set Type=1)
If /i "%Type%" == "0" (
If /I "%~6" == "-" (
set _Hor_line=/a 32
set _Ver_line=/a 32
set _Top_sepr=/a 32
set _Base_sepr=/a 32
set _Top_left=/a 32
set _Top_right=/a 32
set _Base_right=/a 32
set _Base_left=/a 32
) ELSE (
set _Hor_line=/d "%char%"
set _Ver_line=/d "%char%"
set _Top_sepr=/d "%char%"
set _Base_sepr=/d "%char%"
set _Top_left=/d "%char%"
set _Top_right=/d "%char%"
set _Base_right=/d "%char%"
set _Base_left=/d "%char%"
)
)
If /i "%Type%" == "1" (
set _Hor_line=/a 196
set _Ver_line=/a 179
set _Top_sepr=/a 194
set _Base_sepr=/a 193
set _Top_left=/a 218
set _Top_right=/a 191
set _Base_right=/a 217
set _Base_left=/a 192
)
If /i "%Type%" == "2" (
set _Hor_line=/a 205
set _Ver_line=/a 186
set _Top_sepr=/a 203
set _Base_sepr=/a 202
set _Top_left=/a 201
set _Top_right=/a 187
set _Base_right=/a 188
set _Base_left=/a 200
)
If /i "%Type%" == "3" (
set _Hor_line=/a 205
set _Ver_line=/a 179
set _Top_sepr=/a 209
set _Base_sepr=/a 207
set _Top_left=/a 213
set _Top_right=/a 184
set _Base_right=/a 190
set _Base_left=/a 212
)
If /i "%Type%" == "4" (
set _Hor_line=/a 196
set _Ver_line=/a 186
set _Top_sepr=/a 210
set _Base_sepr=/a 208
set _Top_left=/a 214
set _Top_right=/a 183
set _Base_right=/a 189
set _Base_left=/a 211
)
set /a _char_width=%~4-2
set /a _box_height=%~3-2
for /l %%A in (1,1,!_char_width!) do (
if /i "%%A" == "%~5" (
set "_string=!_string! !_Top_sepr!"
set "_SpaceWidth=!_SpaceWidth!" !_Ver_line! /d ""
) ELSE (
set "_string=!_string! !_Hor_line!"
set "_SpaceWidth=!_SpaceWidth!!char!"
)
)
set "_SpaceWidth=!_SpaceWidth!""
set "_final=/g !x_val! !y_val! !_Top_left! !_string! !_Top_right! !_final! "
set /a y_val+=1
for /l %%A in (1,1,!_box_height!) do (
set "_final=/g !x_val! !y_val! !_Ver_line! !_SpaceWidth! !_Ver_line! !_final! "
set /a y_val+=1
)
REM Made Some Advanced changes to algortihm, like switched the way the algorithm generates the variables...
Set _To_Replace=!_Top_sepr:~-3!
Set _Replace_With=!_Base_sepr:~-3!
For %%A in ("!_To_Replace!") do For %%B in ("!_Replace_With!") do set "_final=/g !x_val! !y_val! !_Base_left! !_string:%%~A=%%~B! !_Base_right! !_final! "
IF /i "%~9" == "" (batbox %color% %_final% /c 0x07) ELSE (ENDLOCAL && Set "%~9=%color% %_final% /c 0x07")
goto :eof
:help
Echo.
Echo. This function helps in Adding a little GUI effect into your batch program...
echo. It Prints simple box on the cmd console at specified X Y co-ordinate...
echo.
echo. Syntax: call Box [X] [Y] [Height] [Width] [Sepration] [BG_Char] [color] [Type]
Echo. [_Var]
echo. Syntax: call Box [help ^| /^? ^| -h ^| -help]
echo. Syntax: call Box ver
echo.
echo. Where:-
echo. X = X-ordinate of top-left corner of box
echo. Y = Y-co_ordinate of top-left corner of box
echo. Height = height of box
echo. Width = width of box
echo. Sepration = width From where to separate box,if don't specified or
echo. specified '-' (minus),then box will not be separated.
echo. BG_char = Background element of Box,if not specified or specified
echo. '-' (minus),then no background will be shown...It should be
echo. a single Character...
echo. color = the color Code for the Box,e.g. fc,08,70,07 etc...
echo. Don't define it if you want default colour...or type '-'
echo. (minus) for no color change...
echo. Type = The style / type of the Box you want, double Border, single
echo. Border etc. New, No Border Option added [Valid values: 0 to 4]
Echo. _Var = Variable to Save Output, instead of Printing Directly.
Echo. (Optional)
echo. ver = Version of Box function
echo.
echo. This version 4.0 of Box function contains much more GUI Capabilities.
echo. As it uses batbox.exe and calls it only once at the end of calculation...
echo. Visit www.thebateam.org for more...
echo. #Kvc with #TheBATeam
goto :eof

@ -0,0 +1,140 @@
@echo off
Setlocal Enabledelayedexpansion
Set _Ver=2.0
:: This Function is created by Kvc At '5:35 PM 2/17/2017'
:: Use 'Button /?' for help...on using this function...
:: this function prints a Button like interface / image on cmd console...using batbox.exe,getlen Function
:: you have to specify the text of the button... like "OK, cancel, Retry etc..." as a parameter...
:: if the name contains spaces...then use Double quotes to write the name of button in the parameter...
:: Unlike the previous version, This version prints the buttons and generates a 'Check_Button_Click.bat' file for
:: the sake of easiness of the Programmer. He can directly call this generated file to check which button form the list
:: is being clicked. :)
:: I Hope it'll make programming in batch much more easier than it was before. Try 'Button /?' for knowing more about using
:: This button function v.2.0 by Kvc
:: [%1 = X-ordinate]
:: [%2 = Y-co_ordinate]
:: [%3 = the colour Code for the List,e.g. fc,08,70,07 etc...]
:: [%4 = Text of the Button. e.g. Ok, Retry etc...]
:: [%5 = 'X' - Sequence Terminating character]
:: [%6 = _variable to save button co-ordinates position.]
:: [%7 = _variable to save Mouse hover color for the buttons.]
:: E.g. : Call Button.bat [X] [Y] [Color] "Button 1" [X2] [Y2] [Color2] "Button 2" [X3] [Y3] [Color3] "Button 3" ... X [_Variable_Box] [_Variable_Hover]
:: If you like my work, feel free to motivate me through your comments @ www.thebateam.org. I'll be happy to read them.
:: You can also find more batch plugins like this one from there. :) Happy coding!
rem #TheBATeam
If /i "%~1" == "" (goto :help)
If /i "%~1" == "/?" (goto :help)
If /i "%~1" == "-h" (goto :help)
If /i "%~1" == "help" (goto :help)
If /i "%~1" == "-help" (goto :help)
If /i "%~1" == "ver" (echo.%_Ver%&&goto :eof)
If /i "%~2" == "" (goto :help)
If /i "%~3" == "" (goto :help)
If /i "%~4" == "" (goto :help)
If /i "%~5" == "" (goto :help)
If /i "%~6" == "" (goto :help)
If /i "%~7" == "" (goto :help)
REM Setting-up variables for necessary calculations.
Set _Hover=
Set _Box=
Set _Text=
Set Button_height=3
:Loop_of_button_fn
REM Getting Button parameters...
Set _X=%~1
Set _Y=%~2
set color=%~3
Set _Invert_Color=%Color:~1,1%%Color:~0,1%
set "Button_text=%~4"
REM Loop Breaking Statements...
if not defined _X (goto :EOF)
if /i "%_X%" == "X" (Goto :End)
REM Checking the length of button according to Button_text
Call Getlen "..%button_text%.."
set button_width=%errorlevel%
REM Little math is important... :)
Set /A _X_Text=%_X% + 2
Set /A _Y_Text=%_Y% + 1
Set /A _X_End=%_X% + %button_width% - 1
Set /A _Y_End=%_Y% + %Button_height% - 1
REM Printing a Button like layout using Box Function!
Call Box %_X% %_Y% %Button_height% %button_width% - - %Color% 0
REM Saving Global variables...
Set "_Text=!_Text!/g !_X_Text! !_Y_Text! /c 0x!color! /d "!Button_text!" "
Set "_Hover=!_Hover!!_Invert_Color! "
Set "_Box=!_Box!!_X! !_Y! !_X_End! !_Y_End! "
REM Shifting the parameters for next button Code...
For /L %%A In (1,1,4) Do (Shift /1)
Goto :Loop_of_button_fn
:End
Batbox %_Text% /c 0x07
Endlocal && set "%~2=%_Box%" && set "%~3=%_Hover%"
Goto :EOF
:help
Echo.
Echo. This function helps in Adding a little GUI effect into your batch program...
echo. It Prints simple Button on the cmd console at specified X Y co-ordinate...
Echo. After printing, Returns the area of the button on CMD and the Inverted color
Echo. You can use this information in the main program with GetInput.exe Plugin of
Echo. Batch. And, it will make your life much more easier than before.
Echo.
echo.
echo. Syntax: call Button [Item 1] [Item 2] [Item 3] ... X _Var_Box _Var_Hover
echo. Syntax: call Button [help ^| /^? ^| -h ^| -help]
echo. Syntax: call Button ver
echo.
echo. Where:-
Echo.
Echo. [Item] is short for = [X] [Y] [color] "[Button Text]"
Echo.
echo. [X] = X-ordinate of top-left corner of Button
echo. [Y] = Y-co_ordinate of top-left corner of Button
echo. ver = Version of Button function
Echo. [Item #]= The Items to display. And, Item Represents elements as told above.
Echo. X = Here, the Single 'X' (Must be third last element) indicates the Loop
Echo. Sequence breaker for the Function. After 'X' You need to provide two -
Echo. Variables. Which will return the Corresponding values for the GetInput
Echo. Batch Plugin by aacini.
Echo. _Var_Box = The Second last parameter, which is name of the variable to save
Echo. the values of All Buttons on the console.
Echo. _Var_Hover = The Last parameter, which is name of the variable to save the
Echo. mouse hover color for each button seperately.
Echo.
Echo. Use the above two output variables with 'GetInput.exe' Plugin as follows:
Echo. GetInput /M %%_Var_Box%% /H %%_Var_Hover%%
echo.
echo. This version %_Ver% of Button function contains much more GUI Capabilities.
echo. As it uses batbox.exe and calls it only once at the end of calculation...
Echo. For the most efficient output. This ver. uses GetInput By Aacini too. For the
Echo. Advanced Output on the console.
Echo.
echo. Visit www.thebateam.org for more...
echo. #TheBATeam
goto :EOF

Binary file not shown.

@ -0,0 +1,62 @@
@echo off
Setlocal EnableDelayedExpansion
REM This Getlen function is not created by Kvc...but it is modified and enhanced by kvc...
REM I don't Know about the original Programmer, but I appriciate his/her work...
REM
REM Modified: 06-FEB-2016, 12:28 PM {2 Days after my Brother's [NK's] Birthday...}
REM
REM The algorithm of this program repeats for loop only 13 times for each call from the main batch file...
REM It makes it fast and efficient for calculating the length of longer strings...
REM It can calculate upto 8100 aprox. characters...
REM Get More Extensions Like this @ https://batchprogrammers.blogspot.com
REM It is an upgrade to the older getlen.exe function, which was created using cpp's getlen function...
Set ver=2.0
REM Setting up initial length...
set len=0
REM Checking for various inputs to the fucntion...
IF /i "%~1" == "" (Goto :End)
IF /i "%~1" == "/h" (Goto :Help)
IF /i "%~1" == "/?" (Goto :Help)
IF /i "%~1" == "-h" (Goto :Help)
IF /i "%~1" == "Help" (Goto :Help)
IF /i "%~1" == "" (Echo.%ver% && Goto :EOF)
:Main
set "s=%~1#"
for %%P in (4096 2048 1024 512 256 128 64 32 16 8 4 2 1) do (
if "!s:~%%P,1!" NEQ "" (
set /a "len+=%%P"
set "s=!s:~%%P!"
)
)
:End
REM The Method Used below is called 'Tunnelling in batch'...
REM Using the variable of previous block in new block...
Endlocal && Exit /b %len%
:Help
Echo.
Echo. Calculates the Length of The Given String.
Echo.
Echo. Syntax: Call Getlen [String]
Echo. Where
Echo.
Echo. String: It is the String, Whose length to be calculated.
Echo.
Echo. The length of the string is Returned in to the Main fucntion through the
Echo. Environmental Errorlevel variable.
Echo.
Echo. Try these lines in a Batch file: [E.g.]
Echo.
Echo. Call Getlen "Karan Veer Chouhan"
Echo. Echo. %%Errorlevel%%
Echo.
ECHo. #TheBATeam
Goto :End

Binary file not shown.

@ -0,0 +1,5 @@
[QuickSFV]
UpdateDB=1
Signature=MedicatUSB
WindowInfo=LAAAAAAAAAABAAAA/////////////////////w0DAACKAAAAvQUAAJICAAA=
LVWindowInfo=AwAAADEBAAByAAAApQAAAA==

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save