Need help

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Vats
Posts: 17
Joined: 15 May 2021 02:00
Contact:

Need help

#1 Post by Vats » 29 May 2021 00:11

I came across a game called CalmUntil NightTime by Nick. The creator has allowed me to use the ASCII Art in the game. I couldn't find the place where the game data is stored so yeah anyone please share it. :D
https://gamejolt.com/games/calm-until-n ... -rpg/20411 here's the link..
And anyone who would like to help me in my game dm me I need some help in batch. I'm fairly new in batch, just 6 months.

penpen
Expert
Posts: 1933
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Need help

#2 Post by penpen » 29 May 2021 08:48

Based on the first few files of the game i opened in notepad, i guess every file that contains an "echo" (no matter the case) might be a good candidate; assumed that the game main directory is located in "Z:", the following batch might help you to list them all:

Code: Select all

@echo off
setlocal enableExtensions disableDelayedExpansion
pushd "Z:"
for /f "tokens=* delims=" %%a in ('dir /a:d /b /s "*"') do (
	for %%b in ("%%~a\*.bat") do (
		findstr /M /I "echo" "%%~fb"
	)
)
popd

goto :eof
penpen

Compo
Posts: 538
Joined: 21 Mar 2014 08:50

Re: Need help

#3 Post by Compo » 29 May 2021 16:50

Or perhaps just this in the Command Prompt:

Code: Select all

%__AppDir__%findstr.exe /IS "Echo" Z:\*.bat
Which should list the full filename, the line number, and then the line containing the case insensitive string Echo of every .bat file on the Z: drive.

Vats
Posts: 17
Joined: 15 May 2021 02:00
Contact:

Re: Need help

#4 Post by Vats » 30 May 2021 04:36

How do I insert my ascii animation in the batch file, preferably stored in a text file.
I understand the :call sample.txt but i dont get it how to do it with an animation.
The letters are A and then B :lol: next i will interchange the a and b with my work, and both the arts are of more than one line :shock:
Thanks in advance

Vats
Posts: 17
Joined: 15 May 2021 02:00
Contact:

Re: Need help

#5 Post by Vats » 30 May 2021 04:39

Thanks, how do I insert a hyperlink kind of clickable text in batch? is there any 3rd party :mrgreen: files to do that? :?:

Vats
Posts: 17
Joined: 15 May 2021 02:00
Contact:

Batch online server

#6 Post by Vats » 02 Jun 2021 23:23

In my game, i want to make a online thing, called trade,
for example, I type trade and then the other username which is on a different pc with a different wifi getting the message (username) wants to trade. I have seen 000webhost.com, but I don't know how to use that, so a guide/ any other recommendations is appreciated. Thanks! 8) :mrgreen: :D
Edit: plus any batch file or exe to make a hyperlink in batch?

Vats
Posts: 17
Joined: 15 May 2021 02:00
Contact:

Re:Animated Loading Screen help

#7 Post by Vats » 03 Jun 2021 06:56

https://www.facebook.com/groups/textpuz ... 929744615/
I want to do this in batch. Uh, I understand that the glowy effect is not possible. But can anyone please design one with the colours, any colors would work. :)
Please it should only take 10 seconds or less.
Thanks in advance!
I had also made one but it is not that good.

T3RRY
Posts: 159
Joined: 06 May 2020 10:14

Re: Re:Animated Loading Screen help

#8 Post by T3RRY » 03 Jun 2021 23:44

Vats wrote:
03 Jun 2021 06:56
https://www.facebook.com/groups/textpuz ... 929744615/
I want to do this in batch. Uh, I understand that the glowy effect is not possible. But can anyone please design one with the colours, any colors would work. :)
Please it should only take 10 seconds or less.
Thanks in advance!
I had also made one but it is not that good.
Have you consider using a game engine? https://www.youtube.com/watch?v=Wi3izdqbwcw
The engine exampled above uses macros to:
  • define objects as sprite in a visual manner
    attempt moves of sprites with arguments for collisions both fatal and non fatal
    updated display of the sprite (clear last position; display new)
    start or stop music or sound effects with the option to loop
The link bove is for a rather simple snake game [demo], but the engine is very versatile. There is a link to my games archive at the above link which includes a number of games that use the engine

Vats
Posts: 17
Joined: 15 May 2021 02:00
Contact:

Re: Need help

#9 Post by Vats » 04 Jun 2021 05:13

Thanks terry,
one more question, in my game I am making a coin feature, and i want a coin image beside its left. Is there any bitmap ( pixel like ) figure or view i can add to it and how? I know i can add bmps in a . bat with a tool ( forgot its name ), but is there any possible way, with a tool or something?
Edit: @terry how did u make a multi select batch menu, and if you have discord send me your tag, i am avaliable there

T3RRY
Posts: 159
Joined: 06 May 2020 10:14

Re: Need help

#10 Post by T3RRY » 04 Jun 2021 06:07

Vats wrote:
04 Jun 2021 05:13
Thanks terry,
one more question, in my game I am making a coin feature, and i want a coin image beside its left. Is there any bitmap ( pixel like ) figure or view i can add to it and how? I know i can add bmps in a . bat with a tool ( forgot its name ), but is there any possible way, with a tool or something?
You could concievable use steffans printbmp tool at: viewtopic.php?t=9869
which in steffan's own words will "convert the pixel array of the bitmap file into a file containing "true color" ANSI escape sequences".
As far as batch is concerned its very efficient for what it achieves, however it is not fast enough for use as a frame in an animation sequence.
Edit: @terry how did u make a multi select batch menu, and if you have discord send me your tag, i am avaliable there
Heres the code for the multi select menu. The choice command is used to make selections, and the key pressed is used as the index for the array of possible selections passed to the menu macro upon expansion. To facilitate multiple selections, a loop is used to repeat the menu until the user makes the selection to continue.

Code: Select all

::: Multi-Use Menu :: Author - T3RRY ::  Version 4.2 :: October 2020 ::
::: %Menu% macro - accepts up to 36 options for selection as quoted Args in list form.
::: parameters to call functions with via a given menu can be supplied using Substring modification as exampled.
::: - Multiple selection of menu items achieved using loops.
::: Default is to assume a menu option is a label to be called. If the label doesn't exist error is suppressed and the option is added as a quoted ...
::: ... string to the #Sel Variable for assessment - builds a list of selected options [ that can be deselected ] when used in a loop.
::: Windows 10 users will experience faster display of menus thanks to VT codes
::: Users not running Windows 10 are compensated with more dynamic color output from :C_Out when using the menu.
::: "&&" and "||" conditional operators are used heavily to control script flow, and are used with findstr as an alternative to ...
::: ... If Not "!Errorlevel!" == "0" (Command)Else (other command) statements.
@Echo off & Goto :Main
:::::::::::::::::::::::::: [* Balances Environment stack on script completion *]
:End [Endlocal ^& Set "_End=Y" ^& Exit /B 0]
 Color 07 & %CLOSE%
:::::::::::::::::::::::::::::::::::::::::::::: Findstr based Colorprint function
::: No longer used within menu macro
::: Unsupported Chars: "<" ">" ":" "\" "/" "?" "&"
:C_out [BG:a-f|0-9][FG:a-f|0-9] ["Quoted Strings" "to print"]
 Set "Str_=%*" &  Set "_Str=" & For %%G in (!Str_!)Do Set "_Str=!_Str! %%~G"
 Set "C_Out=%~1"
 Set "_Str=!_Str:%1 =!" & For /F "Delims=" %%G in ("!_Str!")Do Set "_Str=%%~G"
 For %%G in (!_Str!) Do Set ".Str=%%G"
  If /I "!.Str!" == "Exit"  (Set "C_Out=04") Else If /I "!.Str!" == "Next" (Set "C_Out=02") Else If /I "!.Str!" == "Continue" (Set "C_Out=02") Else If /I "!.Str!" == "Back" (Set "C_Out=05") Else If /I "!.Str!" == "Return" (Set "C_Out=05")
    <nul set /p ".=%DEL%" > " !_Str!"
    findstr /v /a:!C_Out! /R "^$" " !_Str!" nul
    del " !_Str!" > nul 2>&1
    Echo/
Exit /B 0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Key variable and Macro definition
:main
::::::::::::::::::::: [ For readablities sake - %Menu% macro is built from the following ]:
rem ::: Order of definition must be preserved.
rem [* prepare default findstr color for non windows 10 users *]
 For /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (set "DEL=%%a")
rem [* default color args for Picked / Not Picked options. Overriden to Echo with Ascii Escape codes if Windows 10 *]
rem [* Color /? for the full combination of colors - BG + FG colors must differ. [BG:a-f|0-9][FG:a-f|0-9] *]
 Set "ColText=For %%l in (1 2)Do if %%l==2 (Set "_Str="&(Set "C_Out=!Oline:~0,2!" & Set "_Str=!Oline:~3!")&(For %%s in (!_Str!)Do Set ".Str=%%s")&(If /I "!.Str!" == "Exit"  (Set "C_Out=04") Else If /I "!.Str!" == "Next" (Set "C_Out=02") Else If /I "!.Str!" == "Continue" (Set "C_Out=02") Else If /I "!.Str!" == "Back" (Set "C_Out=05") Else If /I "!.Str!" == "Return" (Set "C_Out=05"))&( <nul set /p ".=%DEL%" > " !_Str!" )&( findstr /v /a:!C_Out! /R "^$" " !_Str!" nul )&( del " !_Str!" > nul 2>&1 )& Echo/)Else Set Oline="
 Set "_Win10="
 Set "_End="
rem [* Test if Windows 10 If true Overide defaults _nP and _P with Echo and VT codes for faster execution with windows 10 *]
 wmic OS get OSArchitecture,caption | FIND "10" >nul && ((For /F %%a in ('echo prompt $E ^| cmd')do Set "\E=%%a")&Set "_Win10=_")
  If Defined _Win10 (
   Set "_nP=Echo/%\E%[90m"& Set "_P=Echo/%\E%[33m"
   Echo/Menu Color mode: [L]egacy [W]indows [D]isabled & For /F "Delims=" %%C in (' Choice /N /C:LWD ')Do (
    If "%%C" =="L" (
     Set "_nP=For %%l in (1 2)Do if %%l==2 (Set "_Str="&(Set "C_Out=!Oline:~0,2!" & Set "_Str=!Oline:~3!")&(For %%s in (!_Str!)Do Set ".Str=%%s")&(If /I "!.Str!" == "Exit"  (Set "C_Out=04") Else If /I "!.Str!" == "Next" (Set "C_Out=02") Else If /I "!.Str!" == "Continue" (Set "C_Out=02") Else If /I "!.Str!" == "Back" (Set "C_Out=05") Else If /I "!.Str!" == "Return" (Set "C_Out=05"))&( <nul set /p ".=%DEL%" > " !_Str!" )&( findstr /v /a:!C_Out! /R "^$" " !_Str!" nul )&( del " !_Str!" > nul 2>&1 )& Echo/)Else Set Oline=08"
     Set "_P=For %%l in (1 2)Do if %%l==2 (Set "_Str="&(Set "C_Out=!Oline:~0,2!" & Set "_Str=!Oline:~3!")&(For %%s in (!_Str!)Do Set ".Str=%%s")&(If /I "!.Str!" == "Exit"  (Set "C_Out=04") Else If /I "!.Str!" == "Next" (Set "C_Out=02") Else If /I "!.Str!" == "Continue" (Set "C_Out=02") Else If /I "!.Str!" == "Back" (Set "C_Out=05") Else If /I "!.Str!" == "Return" (Set "C_Out=05"))&( <nul set /p ".=%DEL%" > " !_Str!" )&( findstr /v /a:!C_Out! /R "^$" " !_Str!" nul )&( del " !_Str!" > nul 2>&1 )& Echo/)Else Set Oline=06"
    )
    If "%%C" =="D" (Set "_nP=Echo/"& Set "_P=Echo/")
   )
  ) Else (
    Set "_nP=For %%l in (1 2)Do if %%l==2 (Set "_Str="&(Set "C_Out=!Oline:~0,2!" & Set "_Str=!Oline:~3!")&(For %%s in (!_Str!)Do Set ".Str=%%s")&(If /I "!.Str!" == "Exit"  (Set "C_Out=04") Else If /I "!.Str!" == "Next" (Set "C_Out=02") Else If /I "!.Str!" == "Continue" (Set "C_Out=02") Else If /I "!.Str!" == "Back" (Set "C_Out=05") Else If /I "!.Str!" == "Return" (Set "C_Out=05"))&( <nul set /p ".=%DEL%" > " !_Str!" )&( findstr /v /a:!C_Out! /R "^$" " !_Str!" nul )&( del " !_Str!" > nul 2>&1 )& Echo/)Else Set Oline=08"
    Set "_P=For %%l in (1 2)Do if %%l==2 (Set "_Str="&(Set "C_Out=!Oline:~0,2!" & Set "_Str=!Oline:~3!")&(For %%s in (!_Str!)Do Set ".Str=%%s")&(If /I "!.Str!" == "Exit"  (Set "C_Out=04") Else If /I "!.Str!" == "Next" (Set "C_Out=02") Else If /I "!.Str!" == "Continue" (Set "C_Out=02") Else If /I "!.Str!" == "Back" (Set "C_Out=05") Else If /I "!.Str!" == "Return" (Set "C_Out=05"))&( <nul set /p ".=%DEL%" > " !_Str!" )&( findstr /v /a:!C_Out! /R "^$" " !_Str!" nul )&( del " !_Str!" > nul 2>&1 )& Echo/)Else Set Oline=06"
    Echo/Menu Color mode: [L]egacy [D]isabled & For /F "Delims=" %%C in (' Choice /N /C:LD ')Do If "%%C" =="D" (Set "_nP=Echo/"& Set "_P=Echo/")
   )
  )
rem [* Menu supports 36 choices using _O array index with substring modification on _Cho var to index choice selection of Array Elements *]
 Set "_Cho=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 Set "DisplayArray=(Echo/!#Sel!| Findstr /LIC:"%%~G" > Nul 2> Nul && ( %_P% [!_Cho:~%%z,1!] X %%~G ) ) || ( %_nP% [!_Cho:~%%z,1!] - %%~G )"
 Set "#Sel=_Nil"
 Set "ClearArray=(For /F "Tokens=1,2 Delims==" %%i in (' Set Opt[ 2^> Nul ')Do "Set %%i=")"
 Set "ResetVars=(Set "#L=F" &  Set "OptL=" & Set "_O=0")"
 Set "CLOSE=POPD & Endlocal & Set "_End=Y" & Exit /B 0"
 Set "BuildArray=((If !_O! GTR 35 (Call :C_Out 04 "Maximum options [!_O!] Exceeded" & (Timeout /T 5 /NOBREAK) & %CLOSE%))&Set "OptL=!OptL!!_Cho:~%%z,1!"&Set "Opt[!_Cho:~%%z,1!]=%%~G")"
 Set "MakeChoice=(For /F "Delims=" %%C in ('Choice /N /C:!OptL!')Do findstr.exe /BLIC:":!Opt[%%C]!" "%~F0" > nul 2> nul && Call :!Opt[%%C]! "Param" 2> Nul || (For %%. in (!#Sel!)do if "!Opt[%%C]!" == "%%~." (Set /A "_F=(!_F!+1) %%2" & If "!_F!" == "0" For /F "Delims=" %%r in ("!Opt[%%C]!")Do If Not "!#Sel!" == "" (Set "#Sel=!#Sel:"%%r"=!") Else (Set "#Sel=_Nil"))) Else (Set "#Sel=!#Sel! "!Opt[%%C]!""))"
 Set "MakeChoice=(For /F "Delims=" %%C in ('Choice /N /C:!OptL!')Do findstr.exe /BLIC:":!Opt[%%C]!" "%~F0" > nul 2> nul && Call :!Opt[%%C]! "Param" 2> Nul || ((Echo/"!#Sel!"| Findstr /LIC:"!Opt[%%C]!" > Nul 2> Nul && (For /F "Delims=" %%r in ("!Opt[%%C]!")Do If Not "!#Sel!" == "" (Set "#Sel=!#Sel:"%%r"=!")Else (Set "#Sel=_Nil"))) || (Set "#Sel=!#Sel! "!Opt[%%C]!"")))"
 Set "Return=For /L %%s in (0 1 4)Do (If not "!#Sel!" == "" (If "!#Sel:~0,1!" == " " (If "!#L!" == "F" (Set "#Sel=!#Sel:~1!"))Else (Set "#L=T"))Else (Set "#Sel=_Nil"))&if not "!#Sel!" == "_Nil" if not "!#Sel!" == "" (Set "#Sel=!#Sel:_Nil=!")"
 Set "Menu=(If defined _End Goto :End) &For %%n in (1 2)Do if %%n==2 (%ClearArray% & %ResetVars% &(For %%G in (!Options!)Do For %%z in (!_O!)Do %BuildArray% & %DisplayArray% &Set /A "_O+=1")& %MakeChoice% & %Return% )Else Set Options="
 For %%M in ( ClearArray ResetVars BuildArray DisplayArray MakeChoice Return )Do Set "%%M="
 IF NOT EXIST "%TEMP%\colorize" md "%TEMP%\colorize"
 PUSHD "%TEMP%\colorize" || (Echo/"%TEMP%\colorize" Could not be found & %CLOSE%)

 Setlocal EnableExtensions EnableDelayedExpansion & REM [* required to be activated AFTER definition of Macro's. *]
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Commence script main body | Demonstration of usages
:Loop
rem [* doublequoting of options recommended - Required for strings containing standard delimiters. *]
 If not defined _End cls
 If not defined _End %ColText%05 Make a selection.
rem [* Param Substring modification examples passing parameters to labels called when selected - Optional feature. *]
 Set /A "PRM=!Random! %%100 + 100" & Rem [* Example param only *]
 %Menu:Param=PRM% "Exit" "Next" "Option 1" "Option 2" "Option 3" "Option 4"
 Echo/"!#Sel!" | Findstr.exe /LIC:"Exit" > Nul 2> Nul && (Goto :End)
Goto :Loop
 
:Next
rem [* Selection of a single option occurs by using the macro without a loop or resetting the #Sel variable
rem - between %menu% use and next iteration of a loop *]
rem [* Process #Sel items using the !#Sel! variable - then ** SET "#Sel-_Nil" prior to next usage of Menu macro** *]
 Set "Menu1Opts=!#Sel!"
 Set "#Sel="
 Cls
 Call :C_Out 03 "[Demo - Parameter usage.  %%1 ~ '%1' == '!%~1!' ] Selected =" !Menu1opts!
 %Menu% "Exit" " + Continue" ".. Back"
 Echo/!#Sel! | Findstr.exe /LIC:".. Back" > Nul 2> Nul && (Set "#Sel=!Menu1opts!"& Exit /B 0)
 Echo/!#Sel! | Findstr.exe /LIC:"Exit" > Nul 2> Nul && (%CLOSE%)
 Set "#Sel="
 Echo/!Menu1opts! | Findstr.exe /LIC:"_Nil" > Nul 2> Nul && (Call :C_Out 04 "Selection Required."&(Pause & Exit /B 0)) || Call :C_Out 02 "Confirmed=" !Menu1opts!
 Call :C_Out 02 "Example complete."
 Pause
rem [* to exit at end of script or by user selection *]
 %CLOSE%
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: End of example

Vats
Posts: 17
Joined: 15 May 2021 02:00
Contact:

Re: Need help

#11 Post by Vats » 05 Jun 2021 05:07

Also what about the clickable menu? I have cmdmenusel, but i am searching for clickable text, which acts like a hyperlink, but shouldn't take as much space as cmdmenusel, as cmdmenusel covers the whole line.
If u know then pls tell

T3RRY
Posts: 159
Joined: 06 May 2020 10:14

Re: Need help

#12 Post by T3RRY » 05 Jun 2021 05:45

Vats wrote:
05 Jun 2021 05:07
Also what about the clickable menu? I have cmdmenusel, but i am searching for clickable text, which acts like a hyperlink, but shouldn't take as much space as cmdmenusel, as cmdmenusel covers the whole line.
If u know then pls tell
I've not encountered a 3rd party exe that can satisfactorily report mouse click positions correctly for any given line and column position of the console.
Every one I've tried reports the position of the displays y,x axis, not the actual y;x coordinate clicked within the console. Trying to match the two is an effort and a half given you
need to account for screen resolution, scaling, console position, console dimensions, as well as console font type and size.

Conhost was never designed to accept mouse input to the standard required to be able to program batch file to act as a GUI.

Windows terminal may be the place to irect your attention if your just starting out. See: https://github.com/microsoft/terminal

Vats
Posts: 17
Joined: 15 May 2021 02:00
Contact:

Re: Need help

#13 Post by Vats » 07 Jun 2021 19:40

Im making an online function in my game. I want to use 000webhost for that, i have my account, so how do i do it? main file in www.vatsalya.itch.io

T3RRY
Posts: 159
Joined: 06 May 2020 10:14

Re: Need help

#14 Post by T3RRY » 13 Jun 2021 07:55

T3RRY wrote:
05 Jun 2021 05:45

I've not encountered a 3rd party exe that can satisfactorily report mouse click positions correctly for any given line and column position of the console.
After a bit of digging around and testing I've found a suitable mouse input tool - Mouse.exe by IcarusLiaves at topic: viewtopic.php?t=9222

Vats
Posts: 17
Joined: 15 May 2021 02:00
Contact:

Re: Need help

#15 Post by Vats » 13 Jun 2021 21:54

Thats nice!
How can i make a multiplayer part in my game with a ftp server, i have my server, but dont know how..
game at vatsalya.itch.io
uh my post got deleted
Last edited by Vats on 16 Jun 2021 08:50, edited 2 times in total.

Post Reply