Batch Index du Forum
S’enregistrerRechercherFAQMembresGroupesConnexion
Répondre au sujet Page 2 sur 2
Aller à la page: <  1, 2
Aide a EdgeKiller
Auteur Message
Répondre en citant
Message Aide a EdgeKiller 
Revue du message précédent :

Salut à tous,

Volilà, voilà... Le code du game batch terminal a avancé, les comptes utilisateurs fonctionnent enfin (avec mot de passe et tout Okay ). Finalemen,t il y auras que deux types de connections possible: FTP pour les connections normale et ssh/scg/sftp pour les connections sécurisé (FTP est en cours de codage avec un Chat FTP qui fonctionne déjà, je mettrais le code prochainement sur le forum).


Le code de GameBatchTerminal.bat:

-il doit êtres encoder en CP 850 (OEM-850), tous les caractères sont bon, rien a changer.

Code:

@echo off
setlocal enabledelayedexpansion


REM Auteur Original: Juillard Jean-Baptiste

REM Ce fichier est publier en Open Source, il peut êtres copier, modifier ou redistribuer
REM qu'à la condition que l'auteur original, les auteurs de modifications ainsi que cette licence
REM soit toujours explicitement citer.


set ValidPwd=0
::Definition des fichiers de reponse
set "DefaultFilePath=%cd%\Files"
set ConfigFileName=ConfigFile.txt
set GameFileName=GameFile.txt
::Definition des parmetres d'affichage par defaut
set DefaultNbCols=80
set DefaultNbLines=25

if not exist "%DefaultFilePath%\%ConfigFileName%" goto FirstInit
call :ReadAllFilesFunction
call :SetScreenSize
goto LogUser

::**********Fonction ReadGameFile
:ReadConfFiles
for /f "skip=1 delims=" %%A in ('type "%DefaultFilePath%\%ConfigFileName%"') do ( set InLine=%%A& call :ReadFilesFunction )
goto :eof
::**********Fin Fonction ReadGameFile

::**********Fonction ReadGameFile
:ReadGameFile
for /f "skip=1 delims=" %%B in ('type "%DefaultFilePath%\%GameFileName%"') do ( set InLine=%%B& call :ReadFilesFunction )
goto :eof
::**********Fin Fonction ReadGameFile

::**********Fonction ReadLangFile
:ReadLangFile
set LangFileName=!Lang!LangFile.txt
for /f "skip=1 delims=" %%C in ('type "%DefaultFilePath%\%LangFileName%"') do ( set InLine=%%C& call :ReadFilesFunction )
goto :eof
::**********Fin Fonction ReadGameFile

::**********Fonction ReadFiles
:ReadFilesFunction
for /f "tokens=1* delims=~" %%a in ("!InLine!") do set "%%a=%%b"
goto :eof
::**********Fin Fonction ReadFiles

::**********Fonction ReadAllFilesFunction
:ReadAllFilesFunction
call :ReadConfFiles
call :ReadGameFile
call :ReadLangFile
goto :eof
::**********Fin Fonction ReadAllFilesFunction

::**********Fonction WhriteConfigFile
:WhriteConfigFile
if exist "%DefaultFilePath%\!ConfigFileName!" del /Q "%DefaultFilePath%\!ConfigFileName!"
echo Config File for Game Batch Terminal>"%DefaultFilePath%\!ConfigFileName!"
echo.>>"%DefaultFilePath%\!ConfigFileName!"
echo ScreenSize~!ScreenSize!>>"%DefaultFilePath%\!ConfigFileName!"
echo ScreenMode~!ScreenMode!>>"%DefaultFilePath%\!ConfigFileName!"
::echo NbCols~!NbCols!>>"%DefaultFilePath%\!ConfigFileName!"
::echo NbLines~!NbLines!>>"%DefaultFilePath%\!ConfigFileName!"
echo BackgroundColor~!BackgroundColor!>>"%DefaultFilePath%\!ConfigFileName!"
echo CharColor~!CharColor!>>"%DefaultFilePath%\!ConfigFileName!"
echo Lang~!Lang!>>"%DefaultFilePath%\!ConfigFileName!"
echo NbPlayers~!NbPlayers!>>"%DefaultFilePath%\!ConfigFileName!"
for /l %%e in (1 1 !NbPlayers!) do echo PlayerName%%e~!PlayerName%%e!>>"%DefaultFilePath%\!ConfigFileName!"
echo KeyMap~!KeyMap!>>"%DefaultFilePath%\!ConfigFileName!"
if defined ConnectType echo ConnectType~!ConnectType!>>"%DefaultFilePath%\!ConfigFileName!"
if defined UrlFTP echo UrlFTP~!UrlFTP!>>"%DefaultFilePath%\!ConfigFileName!"
if defined IpV4Link echo IpV4Link~!IpV4Link!>>"%DefaultFilePath%\!ConfigFileName!"
if defined IpV6Link echo IpV6Link~!IpV4Link!>>"%DefaultFilePath%\!ConfigFileName!"
goto :eof
::**********Fin Fonction WhriteConfigFile

::**********Fonction FirstInit
:FirstInit
call :ReadGameFile
title %GameCaption%
set ScreenSize=%GameScreenMode1%
call :SetScreenSize
set RunFirstInit=0
set NbPlayers=1
:ReturnFirstInit
cls
echo !BodySpace!╔!HorizontalBorder!╗
echo !BodySpace!║!TitleSpace!!ParsingCaption!!TitleSpace!║
echo !BodySpace!╚!HorizontalBorder!╝
if "%RunFirstInit%"=="0" (
   echo.
   echo.!BodySpace!Fr. Français
   echo.!BodySpace!En. English
   echo.
   set /p "Lang=%BodySpace%Set language:    "
   set RunFirstInit=1
   goto ReturnFirstInit
)
if "%RunFirstInit%"=="1" (
   echo.
   set /p "PlayerName1=%BodySpace%Set first player name:    "
   set "UserName=!PlayerName1!"
)
call :ReadLangFile
set ScreenSize=%GameScreenMode1%
set ScreenMode=1
set BackgroundColor=%DefaultBackgroundColor%
set CharColor=%DefaultCharColor%
set KeyMap=%DefaultKeyMap%
call :WhriteConfigFile
call :SetPWD
call "%cd%\GameBatchTerminal.bat"& exit /b
::**********Fin Fonction FirstInit

::**********Fonction SetScreenSize
:SetScreenSize
set NbCols=
set NbLines=
if "%ScreenSize:~2,1%"=="*" (
   set NbCols=!ScreenSize:~0,2!
   set NbLines=!ScreenSize:~3,2!
)
if "%ScreenSize:~3,1%"=="*" (
   set NbCols=!ScreenSize:~0,3!
   set NbLines=!ScreenSize:~4,2!
)
set ScallingScreenMode=0
set "NbColsScreenMode=%GameScreenMode1:~0,2%"
set "NbLinesScreenMode=%GameScreenMode1:~3,2%"
for /l %%L in (1 1 !NbGameScreenMode!) do (
   if not "!GameScreenMode%%L!"=="CustomizScreen" (
      if "!GameScreenMode%%L:~2,1!"=="*" (
         if !NbColsScreenMode! LSS !NbCols! (
            if "!GameScreenMode%%L:~2,1!"=="*" set "NbColsScreenMode=!GameScreenMode%%L:~0,2!"
            if "!GameScreenMode%%L:~3,1!"=="*" set "NbColsScreenMode=!GameScreenMode%%L:~0,3!" )
         if !NbLinesScreenMode! LSS !NbLines! (
            if "!GameScreenMode%%L:~2,1!"=="*" set "NbLinesScreenMode=!GameScreenMode%%L:~3,2!"
            if "!GameScreenMode%%L:~3,1!"=="*" set "NbLinesScreenMode=!GameScreenMode%%L:~4,2!" )
      )
      if "!GameScreenMode%%L:~3,1!"=="*" (
         if !NbColsScreenMode! LSS !NbCols! (
            if "!GameScreenMode%%L:~3,1!"=="*" set "NbColsScreenMode=!GameScreenMode%%L:~0,3!" )
         if !NbLinesScreenMode! LSS !NbLines! (
            if "!GameScreenMode%%L:~3,1!"=="*" set "NbLinesScreenMode=!GameScreenMode%%L:~4,2!" )
      )
   )
)
if %NbColsScreenMode% LSS %NbCols% (
   if %NbLinesScreenMode% LSS %NbLines% (
      set ScallingScreenMode=1
   )
)
if "%ScallingScreenMode%"=="1" set /a "ScallingScreenModeSyze=%NbCols%-%NbColsScreenMode%"
if "%ScallingScreenMode%"=="0" set /a BodySizeY="%NbCols%-4"
if "%ScallingScreenMode%"=="1" set /a BodySizeY="%NbCols%-4-%ScallingScreenModeSyze%"
set /a BodySizeYDec1="%BodySizeY%-1"
set /a BodyMarginY="%NbCols%-(%NbColsScreenMode%-2)"
set HorizontalBorder=
for /l %%C in (1 1 %BodySizeY%) do set "HorizontalBorder=!HorizontalBorder!═"
if "%ScallingScreenMode%"=="0" set /a "NbBodySpace=%BodyMarginY%/2"
if "%ScallingScreenMode%"=="1" set /a "NbBodySpace=(%BodyMarginY%+%ScallingScreenModeSyze%)/2"
set BodySpace=
for /l %%E in (1 1 %NbBodySpace%) do set "BodySpace=!BodySpace! "
mode con cols=!NbCols! lines=!NbLines!
call :ParseCaption
call :ParsePostCommand
call :SetMenuMargin
call :ParseBaner
goto :eof
:ParseCaption
set NbCaptionChar=0
for /l %%F in (0 1 %BodySizeYDec1%) do (
   if not "!GameCaption:~%%F,1!"=="" set /a "NbCaptionChar+=1"
)
set /a "TitlePaddingEval=%BodySizeY%-!NbCaptionChar!"
set /a "TitlePadding=TitlePaddingEval/2"
set IncOnError=0
set /a ErrorCaptionSpace="TitlePaddingEval %% 2"
set TitleSpace=
for /l %%D in (1 1 %TitlePadding%) do set "TitleSpace=!TitleSpace! "
if %ErrorCaptionSpace% NEQ 0 set IncOnError=1
if "%IncOnError%"=="0" set "ParsingCaption=!GameCaption!"
if "%IncOnError%"=="1" set "ParsingCaption= !GameCaption!"
set NbCaptionChar=
set IncOnError=
set TitlePaddingEval=
set TitlePadding=
set ErrorCaptionSpace=
goto :eof
:ParsePostCommand
set HorizontalBorderCommandSection=
set PostCommandSizeYModuloSpace=
set PostCommandSizeYModuloBorder=
set /a "PostCommandSizeYModulo=(!BodySizeYDec1!-4) %% 5"
set /a "PostCommandSizeY=(!BodySizeYDec1!-4)/5"
set /a "PostCommandSizeYDec1=!PostCommandSizeY!-1"
for /l %%K in (1 1 !PostCommandSizeY!) do set "HorizontalBorderCommandSection=!HorizontalBorderCommandSection!═"
for /l %%L in (1 1 !PostCommandSizeYModulo!) do set "PostCommandSizeYModuloSpace=!PostCommandSizeYModuloSpace! "
for /l %%M in (1 1 !PostCommandSizeYModulo!) do set "PostCommandSizeYModuloBorder=!PostCommandSizeYModuloBorder!═"
set HorizontalBorderCommandHight=!HorizontalBorderCommandSection!!PostCommandSizeYModuloBorder!╦!HorizontalBorderCommandSection!╦!HorizontalBorderCommandSection!╦!HorizontalBorderCommandSection!╦!HorizontalBorderCommandSection!!PostCommandSizeYModuloBorder!
set HorizontalBorderCommandLow=!HorizontalBorderCommandSection!!PostCommandSizeYModuloBorder!╩!HorizontalBorderCommandSection!╩!HorizontalBorderCommandSection!╩!HorizontalBorderCommandSection!╩!HorizontalBorderCommandSection!!PostCommandSizeYModuloBorder!
if not defined Up call :SetKeyMap
set "PostCommand1=!UpToucheAction!: %Up%"
set "PostCommand2=!DownToucheAction!: %Down%"
set "PostCommand3=!SelectToucheAction!: %Select%"
set "PostCommand4=!ReturnToucheAction!: %Return%"
set "PostCommand5=!QuitToucheAction!: %Quit%"
for /l %%I in (1 1 5) do (
   set "PostCommandEval=!PostCommand%%I!"
   set PostPointer=%%I
   call :ParsePostCommandText
)
set "PostCommand=!PostCommand1!!PostCommandSizeYModuloSpace!║!PostCommand2!║!PostCommand3!║!PostCommand4!║!PostCommand5!!PostCommandSizeYModuloSpace!"
goto :eof
:ParsePostCommandText
set PostCommand%PostPointer%=
for /l %%J in (0 1 !PostCommandSizeYDec1!) do (
   if not "!PostCommandEval:~%%J,1!"=="" set "PostCommand%PostPointer%=!PostCommand%PostPointer%!!PostCommandEval:~%%J,1!"
   if "!PostCommandEval:~%%J,1!"=="" set "PostCommand%PostPointer%=!PostCommand%PostPointer%! "
)
set PostCommandEval=
goto :eof
:SetMenuMargin
set /a "MenuSizeY=%BodySizeY%/2"
set /a "MenuMarginSpace=%MenuSizeY%/2"
set MenuMargin=
for /l %%N in (1 1 %MenuMarginSpace%) do set "MenuMargin=!MenuMargin! "
set HorizontalBorderMenu=
for /l %%O in (1 1 %MenuSizeY%) do set "HorizontalBorderMenu=!HorizontalBorderMenu!═"
goto :eof
:ParseBaner
set BanerDegrad1=░
set BanerDegrad2=▒
set BanerDegrad3=▓
set BanerDegrad4=█
set "BanerText=Powered by Game Batch Studio"
set /a "BanerFloatRightSizeY=%BodySizeY%-28"
set /a "BanerFloatCaseRightSizeY=%BanerFloatRightSizeY%/4"
set /a "BanerFloatCaseRightSizeYModulo=BanerFloatRightSizeY %% 4"
set /a "BanerFloatCaseLeftNbSpace=%BanerFloatCaseRightSizeYModulo%/2"
set /a "BanerFloatCaseLeftSpaceModulo=BanerFloatCaseRightSizeYModulo %% 2"
for /l %%P in (1 1 4) do (
   set CaseNumber=%%P
   call :ParseBanerFloatCaseRight
)
set BanerFloatCaseLeftSpace=
for /l %%R in (1 1 %BanerFloatCaseLeftNbSpace%) do set "BanerFloatCaseLeftSpace=!BanerFloatCaseLeftSpace! "
if %BanerFloatCaseLeftSpaceModulo% EQU 0 set "Baner=!Case1!!Case2!!Case3!!Case4!!BanerFloatCaseLeftSpace!%BanerText%!BanerFloatCaseLeftSpace!"
if %BanerFloatCaseLeftSpaceModulo% NEQ 0 set "Baner=!Case1!!Case2!!Case3!!Case4!!BanerFloatCaseLeftSpace! %BanerText%!BanerFloatCaseLeftSpace!"
set BanerDegrad1=
set BanerDegrad2=
set BanerDegrad3=
set BanerDegrad4=
set BanerText=
set Case1=
set Case2=
set Case3=
set Case4=
set BanerFloatRightSizeY=
set BanerFloatCaseRightSizeY=
set BanerFloatCaseRightSizeYModulo=
set BanerFloatCaseLeftNbSpace=
set BanerFloatCaseLeftSpaceModulo=
set BanerFloatCaseLeftSpace=
goto :eof
:ParseBanerFloatCaseRight
set Case%CaseNumber%=
for /l %%Q in (1 1 !BanerFloatCaseRightSizeY!) do set "Case%CaseNumber%=!Case%CaseNumber%!!BanerDegrad%CaseNumber%!"
goto :eof
::**********Fin Fonction SetScreenSize

::**********Fonction SetKeyMap
:SetKeyMap
if "!KeyMap!"=="PaveNum" (
   set Up=8
   set Down=2
   set Left=6
   set Right=4
   set Select=c
   set Pad1=x
   if "%DefaultKeyMap%"=="Azertyuiop" set Pad2=w
   if "%DefaultKeyMap%"=="Qwertyuiop" set Pad2=z
   set Return=r
   set Quit=q
)
if "!KeyMap!"=="Azertyuiop" (
   set Up=z
   set Down=s
   set Left=e
   set Right=a
   set Select=1
   set Pad1=4
   set Pad2=5
   set Return=2
   set Quit=9
)
if "!KeyMap!"=="Qwertyuiop" (
   set Up=w
   set Down=s
   set Left=e
   set Right=q
   set Select=1
   set Pad1=4
   set Pad2=5
   set Return=2
   set Quit=9
)
goto :eof
::**********Fin Fonction SetKeyMap

::**********Fonction LogUser
:LogUser
set NbChoice=!NbPlayers!
set /a BodySizeX="(%NbLines%-14-%NbChoice%)/2"
set /a BodySizeXModulo="(%NbLines%-14-%NbChoice%) %% 2"
set /a "MenuSizeYDec4=%MenuSizeY%-4"
set ChoiceChaine=
for /l %%D in (1 1 %NbChoice%) do set "MenuChoice%%D==!PlayerName%%D!"
set SelectedChoice=1
:ReturnAfficheLogUser
set Touche=
set LineCounter=0
for /l %%G in (1 1 %NbChoice%) do (
   set "Data=!MenuChoice%%G!"
   set CharCounter=
   set /a "LineCounter+=1"
   call :ParseAfficheLogUser
   set Line!LineCounter!=!CharCounter!
)
call :AfficheLogUser
choice /c !Up!!Down!!Select!!Quit!>nul
set Touche=%ErrorLevel%
if "%Touche%"=="1" (
   if "%SelectedChoice%" GTR "1" set /a "SelectedChoice-=1"
)
if "%Touche%"=="2" (
   if not "%SelectedChoice%"=="!NbChoice!" set /a "SelectedChoice+=1"
)
if "%Touche%"=="3" (
   set UserName=!PlayerName%SelectedChoice%!
   set SelectedChoice=1
   goto Init
)
if "%Touche%"=="4" goto End
goto ReturnAfficheLogUser
:AfficheLogUser
cls
echo.
echo !BodySpace!╔!HorizontalBorder!╗
echo !BodySpace!║!TitleSpace!!ParsingCaption!!TitleSpace!║
echo !BodySpace!╚!HorizontalBorder!╝
for /l %%I in (1 1 %BodySizeX%) do echo.
echo !BodySpace!!MenuMargin!╔!HorizontalBorderMenu!╗
for /l %%H in (1 1 %NbChoice%) do (
   if "%%H"=="%SelectedChoice%" echo !BodySpace!!MenuMargin!║██!Line%%H!██║
   if not "%%H"=="%SelectedChoice%" echo !BodySpace!!MenuMargin!║  !Line%%H!  ║
)
echo !BodySpace!!MenuMargin!╚!HorizontalBorderMenu!╝
goto :eof
:ParseAfficheLogUser
for /l %%c in (1 1 %MenuSizeYDec4%) do (
   if not "!Data:~%%c,1!"=="" (
      if not "!Data:~%%c,1!"=="▒" set "CharCounter=!CharCounter!!Data:~%%c,1!"
      if "!Data:~%%c,1!"=="▒" (
         if "%LineCounter%"=="%SelectedChoice%" set "CharCounter=!CharCounter!█"
         if not "%LineCounter%"=="%SelectedChoice%" set "CharCounter=!CharCounter! "
      )
   )
   if "!Data:~%%c,1!"=="" (
      if "%LineCounter%"=="%SelectedChoice%" set "CharCounter=!CharCounter!█"
      if not "%LineCounter%"=="%SelectedChoice%" set "CharCounter=!CharCounter! "
   )
)
goto :eof
::**********Fin Fonction LogUser


::**********Fonction ReadPWD
:ReadPWD
set NbChar=
reg export HKCU\Software\GameBatchStudio\%GameCaption%\!UserName! "%TMP%\PassWord.txt" /y>nul
for /f "skip=3 delims=" %%c in ('type "%TMP%\PassWord.txt"') do (set line=%%c& call :RecupNbChar)
del /Q "%TMP%\PassWord.txt"
set line=
set ParseNbChar=
set Memory=
set $logScanSetP=
call :AffichePWD
set ErrorLevel=
for /l %%c in (1 1 %NbChar%) do ( choice /n /c ­÷×±ƒ¬£¢¥¤¦«¡¸¯´¿»9®¶§┤┼├│┘┬┌─┐┴└‗╣╬╠║╝╦╔═╗╩╚8▄▀■▓▒░½¼¾¹³²ªº°·¨AÄÅÁÂÀÃaäåáâàãEËÉÊÈeëéêè75IÏÍÎÌıiïíîìOÖÕÓÔÒØoöõ0óôòøµUÜÚÛÙuüúûùYÝyýÿBbCÇcçDÐdFfGgHhJjKkLlMmNÑnñP2p1QqRrS4sTtVvWwXxZz©█Æ6æß3þÞð /cs /t 30 /d a& set "$logScanSetP=!ERRORLEVEL!"& set "Memory=!Memory!!$logScanSetP!" )>nul
set NbChar=
reg add HKCU\Software\GameBatchStudio\%GameCaption% /v !UserName! /t REG_SZ /d %Memory%>nul
set ErrorLevel=
reg compare HKCU\Software\GameBatchStudio\%GameCaption%\!UserName! HKCU\Software\GameBatchStudio\%GameCaption% /v !UserName!>nul
set TestPassWord=%ErrorLevel%
reg delete HKCU\Software\GameBatchStudio\%GameCaption% /v !UserName! /f>nul
::Les clefs sont identiques.
if "!TestPassWord!"=="0" (
   set ValidPwd=1
   !RedirectType!
)
::Échec de la commande de comparaison.
if "!TestPassWord!"=="1" (
   set ValidPwd=0
   !RedirectType!
)
::Les clefs sont différentes.
if "!TestPassWord!"=="2" (
   set ValidPwd=0
   !RedirectType!
)
:RecupNbChar
for /f "tokens=1*" %%d in (%line%) do (
echo %line%|find /c "!UserName!Parse">nul
if !errorlevel!==0 set ParseNbChar=%%e
)
if defined ParseNbChar set NbChar=%ParseNbChar:~1%
goto :eof
:AffichePWD
set /a "MenuSizeYDec5=%MenuSizeY%-5"
set /a "BodySizeXDiv2=%BodySizeX%/2"
set PostSetPWD=
set "PostPWD=%PostPWD%"
for /l %%d in (0 1 %MenuSizeYDec5%) do (
   if not "!PostPWD:~%%d,1!"=="" set "PostSetPWD=!PostSetPWD!!PostPWD:~%%d,1!"
   if "!PostPWD:~%%d,1!"=="" set "PostSetPWD=!PostSetPWD! "
)
cls
echo.
echo !BodySpace!╔!HorizontalBorder!╗
echo !BodySpace!║!TitleSpace!!ParsingCaption!!TitleSpace!║
echo !BodySpace!╚!HorizontalBorder!╝
for /l %%I in (1 1 %BodySizeXDiv2%) do echo.
echo !BodySpace!!MenuMargin!╔!HorizontalBorderMenu!╗
echo !BodySpace!!MenuMargin!║  !PostSetPWD!  ║
echo !BodySpace!!MenuMargin!╚!HorizontalBorderMenu!╝
for /l %%I in (1 1 %BodySizeXDiv2%) do echo.
set PostSetPWD=
set MenuSizeYDec5=
set BodySizeXDiv2=
goto :eof

::**********Fin Fonction ReadPWD

::**********Fonction SetPWD
:SetPWD
set /p "Password=Entrez votre mot de passe:    "
if not defined Password (
   set ErrorPassword="!ErrorPassword!+1"
   goto :eof
)
if "%Password%"==" " (
   set ErrorPassword="!ErrorPassword!+1"
   goto :eof
)
set Parsing=0
for /l %%Z in (0 1 31) do set "CharIn=!Password:~%%Z,1!" & call :ParseKey
)
reg add HKCU\Software\GameBatchStudio\%GameCaption%\!UserName! /v !UserName! /t REG_SZ /d !CryptKey!>nul
set CryptKey=
reg add HKCU\Software\GameBatchStudio\%GameCaption%\!UserName! /v !UserName!Parse /t REG_SZ /d "!Parsing!">nul
set Parsing=
goto :eof
:ParseKey
if not "%CharIn%"=="" set /a "Parsing+=1"
if "%CharIn%"=="" goto :eof
if "%CharIn%"=="­" set "ParseKey=1"
if "%CharIn%"=="÷" set "ParseKey=2"
if "%CharIn%"=="×" set "ParseKey=3"
if "%CharIn%"=="±" set "ParseKey=4"
if "%CharIn%"=="ƒ" set "ParseKey=5"
if "%CharIn%"=="¬" set "ParseKey=6"
if "%CharIn%"=="£" set "ParseKey=7"
if "%CharIn%"=="¢" set "ParseKey=8"
if "%CharIn%"=="¥" set "ParseKey=9"
if "%CharIn%"=="¤" set "ParseKey=10"
if "%CharIn%"=="¦" set "ParseKey=11"
if "%CharIn%"=="«" set "ParseKey=12"
if "%CharIn%"=="¡" set "ParseKey=13"
if "%CharIn%"=="¸" set "ParseKey=14"
if "%CharIn%"=="¯" set "ParseKey=15"
if "%CharIn%"=="´" set "ParseKey=16"
if "%CharIn%"=="¿" set "ParseKey=17"
if "%CharIn%"=="»" set "ParseKey=18"
if "%CharIn%"=="9" set "ParseKey=19"
if "%CharIn%"=="®" set "ParseKey=20"
if "%CharIn%"=="¶" set "ParseKey=21"
if "%CharIn%"=="§" set "ParseKey=22"
if "%CharIn%"=="┤" set "ParseKey=23"
if "%CharIn%"=="┼" set "ParseKey=24"
if "%CharIn%"=="├" set "ParseKey=25"
if "%CharIn%"=="│" set "ParseKey=26"
if "%CharIn%"=="┘" set "ParseKey=27"
if "%CharIn%"=="┬" set "ParseKey=28"
if "%CharIn%"=="┌" set "ParseKey=29"
if "%CharIn%"=="─" set "ParseKey=30"
if "%CharIn%"=="┐" set "ParseKey=31"
if "%CharIn%"=="┴" set "ParseKey=32"
if "%CharIn%"=="└" set "ParseKey=33"
if "%CharIn%"=="‗" set "ParseKey=34"
if "%CharIn%"=="╣" set "ParseKey=35"
if "%CharIn%"=="╬" set "ParseKey=36"
if "%CharIn%"=="╠" set "ParseKey=37"
if "%CharIn%"=="║" set "ParseKey=38"
if "%CharIn%"=="╝" set "ParseKey=39"
if "%CharIn%"=="╦" set "ParseKey=40"
if "%CharIn%"=="╔" set "ParseKey=41"
if "%CharIn%"=="═" set "ParseKey=42"
if "%CharIn%"=="╗" set "ParseKey=43"
if "%CharIn%"=="╩" set "ParseKey=44"
if "%CharIn%"=="╚" set "ParseKey=45"
if "%CharIn%"=="8" set "ParseKey=46"
if "%CharIn%"=="▄" set "ParseKey=47"
if "%CharIn%"=="▀" set "ParseKey=48"
if "%CharIn%"=="■" set "ParseKey=49"
if "%CharIn%"=="▓" set "ParseKey=50"
if "%CharIn%"=="▒" set "ParseKey=51"
if "%CharIn%"=="░" set "ParseKey=52"
if "%CharIn%"=="½" set "ParseKey=53"
if "%CharIn%"=="¼" set "ParseKey=54"
if "%CharIn%"=="¾" set "ParseKey=55"
if "%CharIn%"=="¹" set "ParseKey=56"
if "%CharIn%"=="³" set "ParseKey=57"
if "%CharIn%"=="²" set "ParseKey=58"
if "%CharIn%"=="ª" set "ParseKey=59"
if "%CharIn%"=="º" set "ParseKey=60"
if "%CharIn%"=="°" set "ParseKey=61"
if "%CharIn%"=="·" set "ParseKey=62"
if "%CharIn%"=="¨" set "ParseKey=63"
if "%CharIn%"=="A" set "ParseKey=64"
if "%CharIn%"=="Ä" set "ParseKey=65"
if "%CharIn%"=="Å" set "ParseKey=66"
if "%CharIn%"=="Á" set "ParseKey=67"
if "%CharIn%"=="Â" set "ParseKey=68"
if "%CharIn%"=="À" set "ParseKey=69"
if "%CharIn%"=="Ã" set "ParseKey=70"
if "%CharIn%"=="a" set "ParseKey=71"
if "%CharIn%"=="ä" set "ParseKey=72"
if "%CharIn%"=="å" set "ParseKey=73"
if "%CharIn%"=="á" set "ParseKey=74"
if "%CharIn%"=="â" set "ParseKey=75"
if "%CharIn%"=="à" set "ParseKey=76"
if "%CharIn%"=="ã" set "ParseKey=77"
if "%CharIn%"=="E" set "ParseKey=78"
if "%CharIn%"=="Ë" set "ParseKey=79"
if "%CharIn%"=="É" set "ParseKey=80"
if "%CharIn%"=="Ê" set "ParseKey=81"
if "%CharIn%"=="È" set "ParseKey=82"
if "%CharIn%"=="e" set "ParseKey=83"
if "%CharIn%"=="ë" set "ParseKey=84"
if "%CharIn%"=="é" set "ParseKey=85"
if "%CharIn%"=="ê" set "ParseKey=86"
if "%CharIn%"=="è" set "ParseKey=87"
if "%CharIn%"=="7" set "ParseKey=88"
if "%CharIn%"=="5" set "ParseKey=89"
if "%CharIn%"=="I" set "ParseKey=90"
if "%CharIn%"=="Ï" set "ParseKey=91"
if "%CharIn%"=="Í" set "ParseKey=92"
if "%CharIn%"=="Î" set "ParseKey=93"
if "%CharIn%"=="Ì" set "ParseKey=94"
if "%CharIn%"=="ı" set "ParseKey=95"
if "%CharIn%"=="i" set "ParseKey=96"
if "%CharIn%"=="ï" set "ParseKey=97"
if "%CharIn%"=="í" set "ParseKey=98"
if "%CharIn%"=="î" set "ParseKey=99"
if "%CharIn%"=="ì" set "ParseKey=100"
if "%CharIn%"=="O" set "ParseKey=101"
if "%CharIn%"=="Ö" set "ParseKey=102"
if "%CharIn%"=="Õ" set "ParseKey=103"
if "%CharIn%"=="Ó" set "ParseKey=104"
if "%CharIn%"=="Ô" set "ParseKey=105"
if "%CharIn%"=="Ò" set "ParseKey=106"
if "%CharIn%"=="Ø" set "ParseKey=107"
if "%CharIn%"=="o" set "ParseKey=108"
if "%CharIn%"=="ö" set "ParseKey=109"
if "%CharIn%"=="õ" set "ParseKey=110"
if "%CharIn%"=="0" set "ParseKey=111"
if "%CharIn%"=="ó" set "ParseKey=112"
if "%CharIn%"=="ô" set "ParseKey=113"
if "%CharIn%"=="ò" set "ParseKey=114"
if "%CharIn%"=="ø" set "ParseKey=115"
if "%CharIn%"=="µ" set "ParseKey=116"
if "%CharIn%"=="U" set "ParseKey=117"
if "%CharIn%"=="Ü" set "ParseKey=118"
if "%CharIn%"=="Ú" set "ParseKey=119"
if "%CharIn%"=="Û" set "ParseKey=120"
if "%CharIn%"=="Ù" set "ParseKey=121"
if "%CharIn%"=="u" set "ParseKey=122"
if "%CharIn%"=="ü" set "ParseKey=123"
if "%CharIn%"=="ú" set "ParseKey=124"
if "%CharIn%"=="û" set "ParseKey=125"
if "%CharIn%"=="ù" set "ParseKey=126"
if "%CharIn%"=="Y" set "ParseKey=127"
if "%CharIn%"=="Ý" set "ParseKey=128"
if "%CharIn%"=="y" set "ParseKey=129"
if "%CharIn%"=="ý" set "ParseKey=130"
if "%CharIn%"=="ÿ" set "ParseKey=131"
if "%CharIn%"=="B" set "ParseKey=132"
if "%CharIn%"=="b" set "ParseKey=133"
if "%CharIn%"=="C" set "ParseKey=134"
if "%CharIn%"=="Ç" set "ParseKey=135"
if "%CharIn%"=="c" set "ParseKey=136"
if "%CharIn%"=="ç" set "ParseKey=137"
if "%CharIn%"=="D" set "ParseKey=138"
if "%CharIn%"=="Ð" set "ParseKey=139"
if "%CharIn%"=="d" set "ParseKey=140"
if "%CharIn%"=="F" set "ParseKey=141"
if "%CharIn%"=="f" set "ParseKey=142"
if "%CharIn%"=="G" set "ParseKey=143"
if "%CharIn%"=="g" set "ParseKey=144"
if "%CharIn%"=="H" set "ParseKey=145"
if "%CharIn%"=="h" set "ParseKey=146"
if "%CharIn%"=="J" set "ParseKey=147"
if "%CharIn%"=="j" set "ParseKey=148"
if "%CharIn%"=="K" set "ParseKey=149"
if "%CharIn%"=="k" set "ParseKey=150"
if "%CharIn%"=="L" set "ParseKey=151"
if "%CharIn%"=="l" set "ParseKey=152"
if "%CharIn%"=="M" set "ParseKey=153"
if "%CharIn%"=="m" set "ParseKey=154"
if "%CharIn%"=="N" set "ParseKey=155"
if "%CharIn%"=="Ñ" set "ParseKey=156"
if "%CharIn%"=="n" set "ParseKey=157"
if "%CharIn%"=="ñ" set "ParseKey=158"
if "%CharIn%"=="P" set "ParseKey=159"
if "%CharIn%"=="2" set "ParseKey=160"
if "%CharIn%"=="p" set "ParseKey=161"
if "%CharIn%"=="1" set "ParseKey=162"
if "%CharIn%"=="Q" set "ParseKey=163"
if "%CharIn%"=="q" set "ParseKey=164"
if "%CharIn%"=="R" set "ParseKey=165"
if "%CharIn%"=="r" set "ParseKey=166"
if "%CharIn%"=="S" set "ParseKey=167"
if "%CharIn%"=="4" set "ParseKey=168"
if "%CharIn%"=="s" set "ParseKey=169"
if "%CharIn%"=="T" set "ParseKey=170"
if "%CharIn%"=="t" set "ParseKey=171"
if "%CharIn%"=="V" set "ParseKey=172"
if "%CharIn%"=="v" set "ParseKey=173"
if "%CharIn%"=="W" set "ParseKey=174"
if "%CharIn%"=="w" set "ParseKey=175"
if "%CharIn%"=="X" set "ParseKey=176"
if "%CharIn%"=="x" set "ParseKey=177"
if "%CharIn%"=="Z" set "ParseKey=178"
if "%CharIn%"=="z" set "ParseKey=179"
if "%CharIn%"=="©" set "ParseKey=180"
if "%CharIn%"=="█" set "ParseKey=181"
if "%CharIn%"=="Æ" set "ParseKey=182"
if "%CharIn%"=="6" set "ParseKey=183"
if "%CharIn%"=="æ" set "ParseKey=184"
if "%CharIn%"=="ß" set "ParseKey=185"
if "%CharIn%"=="3" set "ParseKey=186"
if "%CharIn%"=="þ" set "ParseKey=187"
if "%CharIn%"=="Þ" set "ParseKey=188"
if "%CharIn%"=="ð" set "ParseKey=189"
set "CryptKey=%CryptKey%!ParseKey!"
set ParseKey=
goto :eof
::**********Fin Fonction SetPWD



:Init
call :SetKeyMap
set NbChoice=6
set State=GeneralMenu
title %GameCaption%
color %BackgroundColor%%CharColor%
set SelectedChoice=1
set "RedirectType=goto :ExecMiniBox"
set SettingUserName=!UserName!
call :ReadPWD
set RedirectType=


:ExecMiniBox
if "!ValidPwd!"=="0" !%State%NoValidPwd!
set ValidPwd=0
set NbChoice=!Nb%State%!
set /a BodySizeX="(%NbLines%-14-%NbChoice%)/2"
set /a BodySizeXModulo="(%NbLines%-14-%NbChoice%) %% 2"
set /a "MenuSizeYDec4=%MenuSizeY%-4"
set ChoiceChaine=
for /l %%D in (1 1 %NbChoice%) do set "MenuChoice%%D==!%State%Tab%%D!"
for /l %%E in (1 1 %NbChoice%) do set "MenuPointer%%E=!%State%Pointer%%E!"
if not "%State%"=="GeneralMenu" set BackState=!%State%BackState!
if "%State%"=="GeneralMenu" set BackState=GeneralMenu
:ReturnAfficheMiniBox
set Touche=
set LineCounter=0
for /l %%G in (1 1 %NbChoice%) do (
   set "Data=!MenuChoice%%G!"
   set CharCounter=
   set /a "LineCounter+=1"
   call :ParseAfficheMiniBox
   set Line!LineCounter!=!CharCounter!
)
call :AfficheMiniBox
choice /c !Up!!Down!!Select!!Return!!Quit!>nul
set Touche=%ErrorLevel%
if "%Touche%"=="1" (
   if "%SelectedChoice%" GTR "1" set /a "SelectedChoice=%SelectedChoice%-1"
)
if "%Touche%"=="2" (
   if not "%SelectedChoice%"=="!NbChoice!" set /a "SelectedChoice=%SelectedChoice%+1"
)
if "%Touche%"=="3" (
   if "%State%"=="Background" goto Background
   if "%State%"=="Char" goto Char
   if "%State%"=="Size" goto Size
   if "%State%"=="Lang" goto Lang
   if "%State%"=="KeyMap" goto KeyMap
   if "!MenuPointer%SelectedChoice%!"=="AddUser" goto AddUser
   if "!MenuPointer%SelectedChoice%!"=="DelUser" goto DelUser
   if "%State%"=="Local" goto Local
   if "!MenuPointer%SelectedChoice%!"=="FTP" goto FTP
   set State=!MenuPointer%SelectedChoice%!
   set SelectedChoice=1
   goto ExecMiniBox
)
if "%Touche%"=="4" goto ReturnLastPoint
if "%Touche%"=="5" goto End
goto ReturnAfficheMiniBox
:AfficheMiniBox
cls
echo.
echo !BodySpace!╔!HorizontalBorder!╗
echo !BodySpace!║!TitleSpace!!ParsingCaption!!TitleSpace!║
echo !BodySpace!╚!HorizontalBorder!╝
for /l %%I in (1 1 %BodySizeX%) do echo.
echo !BodySpace!!MenuMargin!╔!HorizontalBorderMenu!╗
for /l %%H in (1 1 %NbChoice%) do (
   if "%%H"=="%SelectedChoice%" echo !BodySpace!!MenuMargin!║██!Line%%H!██║
   if not "%%H"=="%SelectedChoice%" echo !BodySpace!!MenuMargin!║  !Line%%H!  ║
)
echo !BodySpace!!MenuMargin!╚!HorizontalBorderMenu!╝
for /l %%I in (1 1 %BodySizeX%) do echo.
if %BodySizeXModulo% NEQ 0 echo.
echo.
echo !BodySpace!╔!HorizontalBorderCommandHight!╗
echo !BodySpace!║!PostCommand!║
echo !BodySpace!╠!HorizontalBorderCommandLow!╣
echo !BodySpace!║!Baner!║
echo !BodySpace!╚!HorizontalBorder!╝
goto :eof
:ParseAfficheMiniBox
for /l %%c in (1 1 %MenuSizeYDec4%) do (
   if not "!Data:~%%c,1!"=="" (
      if not "!Data:~%%c,1!"=="▒" set "CharCounter=!CharCounter!!Data:~%%c,1!"
      if "!Data:~%%c,1!"=="▒" (
         if "%LineCounter%"=="%SelectedChoice%" set "CharCounter=!CharCounter!█"
         if not "%LineCounter%"=="%SelectedChoice%" set "CharCounter=!CharCounter! "
      )
   )
   if "!Data:~%%c,1!"=="" (
      if "%LineCounter%"=="%SelectedChoice%" set "CharCounter=!CharCounter!█"
      if not "%LineCounter%"=="%SelectedChoice%" set "CharCounter=!CharCounter! "
   )
)
goto :eof

:SetP
set NbChoice=!Nb%State%!
set /a "MenuSizeYDec5=%MenuSizeY%-5"
set /a "BodySizeXDiv2=%BodySizeX%/2"
for /l %%D in (1 1 %NbChoice%) do set "MenuChoice%%D=!%State%Tab%%D!"
for /l %%E in (1 1 %NbChoice%) do set "MenuPointer%%E=!%State%Pointer%%E!"
if not "%State%"=="GeneralMenu" set BackState=!%State%BackState!
if "%State%"=="GeneralMenu" set BackState=GeneralMenu
set OutSetP=
set PostSetP=
for /l %%d in (0 1 %MenuSizeYDec5%) do (
   if not "!MenuChoice1:~%%d,1!"=="" set "PostSetP=!PostSetP!!MenuChoice1:~%%d,1!"
   if "!MenuChoice1:~%%d,1!"=="" set "PostSetP=!PostSetP! "
)
cls
echo.
echo !BodySpace!╔!HorizontalBorder!╗
echo !BodySpace!║!TitleSpace!!ParsingCaption!!TitleSpace!║
echo !BodySpace!╚!HorizontalBorder!╝
for /l %%I in (1 1 %BodySizeXDiv2%) do echo.
echo !BodySpace!!MenuMargin!╔!HorizontalBorderMenu!╗
echo !BodySpace!!MenuMargin!║  !PostSetP!  ║
echo !BodySpace!!MenuMargin!╚!HorizontalBorderMenu!╝
for /l %%I in (1 1 %BodySizeXDiv2%) do echo.
set /p "OutSetP=!Post%State%!"
goto :eof

:ReturnLastPoint
set State=%BackState%
set SelectedChoice=1
goto ExecMiniBox

:Background
set BackgroundColor=!MenuPointer%SelectedChoice%!
set State=%BackState%
set SelectedChoice=1
color !BackgroundColor!!CharColor!
call :WhriteConfigFile
goto ExecMiniBox

:Char
set CharColor=!MenuPointer%SelectedChoice%!
set State=%BackState%
set SelectedChoice=1
color !BackgroundColor!!CharColor!
call :WhriteConfigFile
goto ExecMiniBox

:Size
if "!MenuPointer%SelectedChoice%!"=="CustomizScreen" (
   set ScreenMode=%SelectedChoice%
   set State=!MenuPointer%SelectedChoice%!
   call :SetP
   set ScreenSize=!OutSetP!
)
if not "!MenuPointer%SelectedChoice%!"=="CustomizScreen" (
   set ScreenSize=!MenuPointer%SelectedChoice%!
   set ScreenMode=%SelectedChoice%
)
set State=%BackState%
set SelectedChoice=1
call :WhriteConfigFile
call :SetScreenSize
goto ExecMiniBox

:Lang
set Lang=!MenuPointer%SelectedChoice%!
set State=%BackState%
set SelectedChoice=1
call :WhriteConfigFile
call :ReadAllFilesFunction
goto ExecMiniBox

:KeyMap
set KeyMap=!MenuPointer%SelectedChoice%!
set State=%BackState%
set SelectedChoice=1
call :SetKeyMap
call :SetScreenSize
call :WhriteConfigFile
goto ExecMiniBox

:AddUser
set BackState=%State%
set State=!MenuPointer%SelectedChoice%!
call :SetP
set /a "NbPlayers+=1"
set PlayerName%NbPlayers%=!OutSetP!
call :WhriteConfigFile
set BkpUserName=!UserName!
set UserName=!OutSetP!
call :SetPWD
set UserName=!BkpUserName!
set BkpUserName=
set State=%BackState%
set SelectedChoice=1
goto ExecMiniBox

:DelUser
set BackState=%State%
set State=!MenuPointer%SelectedChoice%!
call :SetP
set UserDeleted=!OutSetP!
set "RedirectType=goto :eof"
set SettingUserName=!OutSetP!
call :ReadPWD
if "!ValidPwd!"=="0" !%State%NoValidPwd!
set ValidPwd=0
call :ReSetUsersList
call :WhriteConfigFile
set RedirectType=
reg delete HKCU\Software\GameBatchStudio\%GameCaption%\%UserDeleted% /f>nul
set UserDeleted=
set State=%BackState%
set SelectedChoice=1
goto ExecMiniBox
:ReSetUsersList
set TabDelUser0=%NbPlayers%
for /l %%X in (1 1 %TabDelUser0%) do set "TabDelUser%%X=!PlayerName%%X!"
set /a "NbPlayers-=1"
for /l %%W in (1 1 %TabDelUser0%) do (
   echo !PlayerName%%W! | find "!UserDeleted!">nul
   if !ErrorLevel!==0 set UserId=%%W
)
set TabDelUser!UserId!=
set ResetNbPlayers=1
for /l %%V in (1 1 %TabDelUser0%) do (
   if not "!TabDelUser%%V!"=="" (
      set "!TabDelUser%ResetNbPlayers%!=!TabDelUser%%V!
      set /a "ResetNbPlayers+=1"
   )
)
set TabDelUser0=!ResetNbPlayers!
for /l %%U in (1 1 %TabDelUser0%) do set "PlayerName%%U=!TabDelUser%%U!"
goto :eof

:Local
set BackState=%State%
set State=!MenuPointer%SelectedChoice%!
call :SetP
if "%State%"=="LocalIpV4" set IpV4Link=!OutSetP!
if "%State%"=="LocalIpV6" set IpV6Link=!OutSetP!
call :WhriteConfigFile
set State=%BackState%
set SelectedChoice=1
goto ExecMiniBox

:FTP
set BackState=%State%
set State=!MenuPointer%SelectedChoice%!
call :SetP
set UrlFTP=!OutSetP!
call :WhriteConfigFile
set State=%BackState%
set SelectedChoice=1
goto ExecMiniBox

:SSH
goto :eof

:IRCS
goto :eof




:End
exit


Le GameFile.txt:

Code:

Game Config File for Game Batch Terminal

GameCaption~RPGBatch
DefaultBackgroundColor~1
DefaultCharColor~F

NbGameScreenMode~3
GameScreenMode1~90*30
GameScreenMode2~180*60
GameScreenMode3~CustomizScreen

NbGeneralMenu~6
GeneralMenuNoValidPwd~exit
GeneralMenuPointer1~NewGame
GeneralMenuPointer2~LoadGame
GeneralMenuPointer3~Options
GeneralMenuPointer4~UpDate
GeneralMenuPointer5~WebSite
GeneralMenuPointer6~Credit


NbOptions~5
OptionsBackState~GeneralMenu
OptionsPointer1~Screen
OptionsPointer2~Lang
OptionsPointer3~KeyMap
OptionsPointer4~Users
OptionsPointer5~NetWork


NbScreen~2
ScreenBackState~Options
ScreenPointer1~Color
ScreenPointer2~Size


NbColor~2
ColorBackState~Screen
ColorPointer1~Background
ColorPointer2~Char


NbBackground~16
BackgroundBackState~Color
BackgroundPointer1~0
BackgroundPointer2~1
BackgroundPointer3~2
BackgroundPointer4~3
BackgroundPointer5~4
BackgroundPointer6~5
BackgroundPointer7~6
BackgroundPointer8~7
BackgroundPointer9~8
BackgroundPointer10~9
BackgroundPointer11~A
BackgroundPointer12~B
BackgroundPointer13~C
BackgroundPointer14~D
BackgroundPointer15~E
BackgroundPointer16~F


NbChar~16
CharBackState~Color
CharPointer1~0
CharPointer2~1
CharPointer3~2
CharPointer4~3
CharPointer5~4
CharPointer6~5
CharPointer7~6
CharPointer8~7
CharPointer9~8
CharPointer10~9
CharPointer11~A
CharPointer12~B
CharPointer13~C
CharPointer14~D
CharPointer15~E
CharPointer16~F

NbSize~3
SizeBackState~Screen
SizePointer1~90*30
SizePointer2~180*60
SizePointer3~CustomizScreen

NbCustomizScreen~1
CustomizScreenBackState~Size
CustomizScreenPointer1~

NbLang~2
LangBackState~Options
LangPointer1~En
LangPointer2~Fr

NbKeyMap~3
KeyMapBackState~Options
KeyMapPointer1~Azertyuiop
KeyMapPointer2~Qwertyuiop
KeyMapPointer3~PaveNum

NbUsers~4
UsersBackState~Options
UsersPointer1~AddUser
UsersPointer2~DelUser
UsersPointer3~SaveOnLocalHost
UsersPointer4~UpDateOnDistantHost

NbAddUser~1
AddUserBackState~Users
AddUserPointer1~

NbDelUser~1
DelUserBackState~Users
DelUserNoValidPwd~exit
DelUserPointer1~

NbSaveOnLocalHost~1
SaveOnLocalHostBackState~Users
SaveOnLocalHostPointer1~

NbUpDateOnDistantHost~1
UpDateOnDistantHostBackState~Users
UpDateOnDistantHostPointer1~

NbNetWork~5
NetWorkBackState~Options
NetWorkPointer1~GameProtocol
NetWorkPointer2~ChatProtocol
NetWorkPointer3~SecurityParameter
NetWorkPointer4~CreatServer
NetWorkPointer5~AdminServer

NbGameProtocol~2
GameProtocolBackState~NetWork
GameProtocolPointer1~FTP
GameProtocolPointer2~Local

NbFTP~1
FTPBackState~GameProtocol
FTPPointer1~

NbLocal~2
LocalBackState~GameProtocol
LocalPointer1~LocalIpV4
LocalPointer2~LocalIpV6

NbLocalIpV4~1
LocalIpV4BackState~Local
LocalIpV4Pointer1~

NbLocalIpV6~1
LocalIpV6BackState~Local
LocalIpV6Pointer1~

NbChatProtocol~1
ChatProtocolBackState~NetWork
ChatProtocolPointer1~IRCS

NbSecurityParameter~1
SecurityParameterBackState~NetWork
SecurityParameterPointer1~

NbCreatServer~1
CreatServerBackState~NetWork
CreatServerPointer1~

NbAdminServer~1
AdminServerBackState~NetWork
AdminServerPointer1~


et le FrLangFile.txt (je met pas l'anglais il est pas à jour):

Code:

French Lang File for Game Batch Terminal

DefaultKeyMap~Azertyuiop
UpToucheAction~Haut
DownToucheAction~Bas
LeftToucheAction~Droite
RightToucheAction~Gauche
SelectToucheAction~Selectionner
ReturnToucheAction~Retour
QuitToucheAction~Quitter

PostPWD~Entrez votre mot de passe [%SettingUserName%]
PWDRest~essais restant(s)

GeneralMenuTab1~Nouvelle partie
GeneralMenuTab2~Charger une partie
GeneralMenuTab3~Options
GeneralMenuTab4~Mise à jour
GeneralMenuTab5~Site Web
GeneralMenuTab6~Crédits

OptionsTab1~Définir les options d'affichages
OptionsTab2~Définir la langue
OptionsTab3~Définir le type de clavier
OptionsTab4~Gérrer les utilisateurs
OptionsTab5~Définir les options du réseau

ScreenTab1~Définir les couleurs d'affichages
ScreenTab2~Définir la taille d'affichage

ColorTab1~Choisissez la couleur du fond.
ColorTab2~Choisissez la couleur des caractères.

BackgroundTab1~Noir
BackgroundTab2~Bleu foncé
BackgroundTab3~Vert
BackgroundTab4~Bleu Gris
BackgroundTab5~Marron
BackgroundTab6~Pourpre
BackgroundTab7~Kaki
BackgroundTab8~Gris claire
BackgroundTab9~Gris
BackgroundTab10~Blue claire
BackgroundTab11~Vert claire
BackgroundTab12~Cyan
BackgroundTab13~Rouge
BackgroundTab14~Rose
BackgroundTab15~Jaune
BackgroundTab16~Blanc

CharTab1~Noir
CharTab2~Bleu foncé
CharTab3~Vert
CharTab4~Bleu Gris
CharTab5~Marron
CharTab6~Pourpre
CharTab7~Kaki
CharTab8~Gris claire
CharTab9~Gris
CharTab10~Blue claire
CharTab11~Vert claire
CharTab12~Cyan
CharTab13~Rouge
CharTab14~Rose
CharTab15~Jaune
CharTab16~Blanc

SizeTab1~90*30
SizeTab2~180*60
SizeTab3~Définir une taille d'affichage personnalisée

CustomizScreenTab1~Veulliez définir une taille d'affichage sous la forme Colonnes*Lignes
PostCustomizScreen~Taille d'affichage:

LangTab1~English
LangTab2~Français

KeyMapTab1~Azertyuiop
KeyMapTab2~Qwertyuiop
KeyMapTab3~Pavé Numérique

UsersTab1~Ajouter un compte utilisateur
UsersTab2~Supprimer un compte utilisateur
UsersTab3~Sauvegarder mon compte utilisateur à partir du serveur
UsersTab4~Mettre à jour mon compte utilisateur sur le serveur

AddUserTab1~Entrez le noms d'utilisateur a ajouter

DelUserTab1~Entrez le noms d'utilisateur a supprimer

SaveOnLocalHostTab1~

UpDateOnDistantHostTab1~

NetWorkTab1~Paramètres de connection
NetWorkTab2~Paramètres du chat
NetWorkTab3~Paramètres de sécurité
NetWorkTab4~Créer un serveur
NetWorkTab5~Administrer un serveur

GameProtocolTab1~FTP
GameProtocolTab2~Réseau Local

FTPTab1~Entrer une Url FTP valide.
PostFTP~Url de connection:

LocalTab1~Utiliser IpV4
LocalTab2~Utiliser IpV6

LocalIpV4Tab1~Entrer une adresse IpV4 valide.
PostLocalIpV4~IP de connection:

LocalIpV6Tab1~Entrer une adresse IpV6 valide.
PostLocalIpV6~IP de connection:

ChatProtocolTab1~IRCS

SecurityParameterTab1~

CreatServerTab1~

AdminServerTab1~




PostMenuQuit~Quitter le jeu.
PostReturnMenu~Retour au menu principal.
NoSaveOption~Les options modifié ne seront pas sauvegardé.


Voilà, voilà Cool à tant que j'y pense d'ici quelques jours je vous mettrais une petite suprise sur le forum (tout ce que je peux vous dire c'est que c'est quelques chose qu'on pourrais penser impossible en batch Twisted Evil )

Message Publicité 
PublicitéSupprimer les publicités ?


Répondre en citant
Message Fin du sujet 
Bonjour à tous,

Le but de cette page été à la base d'aidé edgekiller à faire comminiquer plusieur batch emsembles afin de pouvoir jouer des partis en réseaux. Le but a été atteint il ya peut avec mise au point d'un chat et d'un module FTP.

entre temps Shocked EDGEKILLER A DISPARUT DES ÉCRANS Shocked , et c'est donc pour cette raison que ce tutto ce termine, mais ne vous inquiété pas le dévellopement continut.

Pour terminé ce tutto en beauté, je met a votre disposition le code du chat et en ce qui concerne le reste du programme je le mettrer sur le forum une fois finit (bientot,il y a quelque bug du au faite que j'ais déplacer la configuration vers le registre).

Voilà le code de la première version du chat

GameBatchCh@t.bat:

Code:

@echo off
setlocal enabledelayedexpansion


REM Auteur Original: Juillard Jean-Baptiste

REM Ce fichier est publier en Open Source, il peut êtres copier, modifier ou redistribuer
REM qu'à la condition que l'auteur original, les auteurs de modifications ainsi que la
REM présente déclaration de licence soit toujours explicitement citer.


set InitMode=1

goto SetParams
:ConfigParams
::Configuration des paramètres utilisateur
if /i "%Un%"=="-u" (
   for /f "tokens=1* delims=~" %%A in ("%Deux%") do (
      set "UserName=%%A"
      set "UserPassword=%%B"
   )
)
::Configuration des paramètres de connexion
if /i "%Un%"=="-s" (
   for /f "tokens=1* delims=~" %%C in ("%Deux%") do (
      set "ServerURL=%%C"
      set "MountPoint=%%D"
   )
)
::Configuration des caractères spéciaux
if /i "%Un%"=="-c" (
   set "VariableChar=%Deux:~0,1%"
   set "DefaultChar=%Deux:~1,1%"
)
::Configuration du mode d'initialisation
if /i "%Un%"=="-i" (
   set InitMode=0
   shift /1& goto SetParams
)
shift /1& shift /1
:SetParams
set "Un=%1"
set "Deux=%2"
if not "%Un%"=="" goto ConfigParams




::Définition des paramètres d'affichages
set "DefaultScreenSize=80*20"
set ScreenSize=
::Définition des fichiers de réponses
set "WorkPath=%cd%\%UserName%"
set "LogFile=ChatLog.txt"
set "UserList=UserList.txt"

::+
set "ConnectPost=est connecté."
set "DisConnectPost=est déconnecté."


:Init
mkdir "%WorkPath%"
call :SetScreenSize
title [%UserName%@//%ServerURL%/%MountPoint%]
mode con cols=%WindowsSizeY% lines=%WindowsSizeX%
set WindowsSizeX=
set WindowsSizeY=
if exist "%WorkPath%\%LogFile%" del /q "%WorkPath%\%LogFile%"
if "%InitMode%"=="0" (
   echo GameBatchCh@t v0.4>"%WorkPath%\%LogFile%"
   echo Powered by Game Batch Studio>>"%WorkPath%\%LogFile%"
   echo %Date% %Time:~0,8%>>"%WorkPath%\%LogFile%"
   echo *************************>>"%WorkPath%\%LogFile%"
   echo #>>"%WorkPath%\%LogFile%"
   echo #%UserName% %ConnectPost%>>"%WorkPath%\%LogFile%"
   echo #>>"%WorkPath%\%LogFile%"
   call :UpLoad "%WorkPath%\%LogFile%"
   echo %UserName%>"%WorkPath%\%UserList%"
   call :UpLoad "%WorkPath%\%UserList%"
)
if "%InitMode%"=="1" (
   call :DownLoad "%LogFile%"
   echo #>>"%WorkPath%\%LogFile%"
   echo #%UserName% %ConnectPost%>>"%WorkPath%\%LogFile%"
   echo #>>"%WorkPath%\%LogFile%"
   call :UpLoad "%WorkPath%\%LogFile%"
   call :DownLoad "%UserList%"
   echo %UserName%>>"%WorkPath%\%UserList%"
   call :UpLoad "%WorkPath%\%UserList%"
)
call :GenerateChoiceCharChaine
call :Affiche
set OperationalCounter=0
set OldOperationalCounter=0
set SpecialChar=0
goto ExecChat

:SetScreenSize
if not defined ScreenSize set "ScreenSize=%DefaultScreenSize%"
set WindowsSizeX=%ScreenSize:~3,2%
set WindowsSizeY=%ScreenSize:~0,2%
set DefaultScreenSize=
set ScreenSize=
set /a "BodySizeX=WindowsSizeX-4"
set /a "BodySizeY=WindowsSizeY-4"
set LogLine0=0
set /a "BodySizeYDec3=%BodySizeY%-3"
set /a "RatioMaxChar=2048/%BodySizeY%"
for /l %%G in (1 1 %BodySizeY%) do set "HorizontalBorder=!HorizontalBorder!═"
for /l %%G in (0 1 %BodySizeYDec3%) do set "NoTextFoundLine=!NoTextFoundLine! "
goto :eof

:ExecChat
call :Affiche
1>nul choice /c %DefaultChar%%VariableChar%ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%ParsingChoiceChaine% /n /cs /t 15 /d %DefaultChar%
set "CharCode=%ErrorLevel%"
if "%CharCode%"=="1" (
   set CharCode=
   call :DownLoad "%LogFile%"
   goto ExecChat
)
call :EvalCharCode
if  %OperationalCounter% NEQ %OldOperationalCounter% call :AddMSG
goto ExecChat
:EvalCharCode
if "%SpecialChar%"=="0" (
   if "%CharCode%"=="2" (
      set "BufferSpecialChar=%VariableChar%"
      set TempSpecialChar1=1
   )
)
if "%SpecialChar%"=="1" (
   if "%CharCode%"=="2" (
      set "BufferSpecialChar=%BufferSpecialChar%%VariableChar%"
      set SpecialChar=2
   )
)
for /l %%K in (3 1 189) do if "%CharCode%"=="%%K" set "Buffer=!CharCode%%K!"
if "%SpecialChar%"=="1" (
   set "BufferSpecialChar=%BufferSpecialChar%%Buffer%"
   set SpecialChar=2
   set Buffer=
)
if "%TempSpecialChar1%"=="1" (
   set SpecialChar=1
   set TempSpecialChar1=0
)
if "%SpecialChar%"=="2" (
   if "%BufferSpecialChar%"=="%VariableChar%%VariableChar%" set /a "OperationalCounter+=1"
   if "%BufferSpecialChar%"=="%VariableChar%r" set "Memory=%Memory:~0,-1%"
   if "%BufferSpecialChar%"=="%VariableChar%q" call :DisConnect & goto End
   if "%BufferSpecialChar%"=="%VariableChar%s" set "Memory=%Memory% "
   if "%BufferSpecialChar%"=="%VariableChar%p" set "Memory=%Memory%."
   if "%BufferSpecialChar%"=="%VariableChar%v" set "Memory=%Memory%,"
   set BufferSpecialChar=
   set SpecialChar=0
)
if defined Buffer set "Memory=%Memory%%Buffer%"
set CharCode=
if defined Buffer set Buffer=
goto :eof

:Affiche
call :ParseLog
cls
echo  ╔%HorizontalBorder%╗
for /l %%G in (1 1 %BodySizeX%) do echo  ║ !BufferLog%%G! ║
echo  ╚%HorizontalBorder%╝
if defined Memory echo  !Memory!
goto :eof
:ParseLog
set InputSysCounter=0
for /l %%A in (1 1 %BodySizeX%) do set LogLine%%A=
for /f "delims=" %%B in ('type "%WorkPath%\%LogFile%"') do (
   set "InLine=%%B"
   call :ParseLine
)
if !CounterLineBuffer! LEQ %BodySizeX% set DecalLog=0
if !CounterLineBuffer! GTR %BodySizeX% set /a "DecalLog=!CounterLineBuffer!-%BodySizeX%"
set CounterLineBuffer=
for /l %%F in (1 1 %BodySizeX%) do (
   set /a "DecalPointer=!DecalLog!+%%F"
   set "LinePointer=%%F"
   call :AddLine
   if not "!BufferLog!"=="" set "BufferLog%%F=!BufferLog!"
   if "!BufferLog!"=="" set "BufferLog%%F=!NoTextFoundLine!"
   set BufferLog=
)
set DecalLog=
set DecalPointer=
set LinePointer=
goto :eof
:ParseLine
set CounterLine=0
for /l %%C in (1 1 %RatioMaxChar%) do (
   if not "!InLine!"=="" set "Data=!InLine:~0,%BodySizeY%!"
   if not "!InLine:~%BodySizeY%!"=="" set "InLine=!InLine:~%BodySizeY%!"
   if "!InLine:~%BodySizeY%!"=="" set InLine=
   if not "!Data!"=="" (
      set "TMPLine%%C=!Data!"
      set /a "CounterLine+=1"
   )
   set Data=
)
for /l %%D in (1 1 !CounterLine!) do (
   set "Data=!TMPLine%%D!"
   call :AddSpace
)
set InLine=
set Data=
for /l %%D in (1 1 !CounterLine!) do set TMPLine%%D=
set CounterLine=
goto :eof
:AddSpace
for /l %%E in (0 1 %BodySizeYDec3%) do (
   if not "!Data:~%%E,1!"=="" set "Buffer=!Buffer!!Data:~%%E,1!"
   if "!Data:~%%E,1!"=="" set "Buffer=!Buffer! "
)
set /a "CounterLineBuffer+=1"
set "LogLine%CounterLineBuffer%=!Buffer!"
set LogLine0=%CounterLineBuffer%
set Buffer=
goto :eof
:AddLine
if not "!LogLine%DecalPointer%!"=="" set "BufferLog=!LogLine%DecalPointer%!"
set LogLine%DecalPointer%=
goto :eof

:AddMSG
set "TMPMemory=!Memory!"
set Memory=
call :Affiche
call :DownLoad "%LogFile%"
1>>"%WorkPath%\%LogFile%" echo [%UserName%:] %TMPMemory%
call :UpLoad "%WorkPath%\%LogFile%"
set OldOperationalCounter=%OperationalCounter%
goto :eof

:UpLoad
pushd "%WorkPath%"
call ..\FTP_Mod.bat 1  "%%~1" %MountPoint% %UserName% %UserPassword% %ServerURL%
popd
goto :eof

:DownLoad
pushd "%WorkPath%"
call ..\FTP_Mod.bat 0  "%%~1" %MountPoint% %UserName% %UserPassword% %ServerURL%
popd
goto :eof

:DisConnect
call :DownLoad "%LogFile%"
echo #>>"%WorkPath%\%LogFile%"
echo #%UserName% %DisConnectPost%>>"%WorkPath%\%LogFile%"
echo #>>"%WorkPath%\%LogFile%"
call :DownLoad "%UserList%"
findstr /c:%UserName% /l /v "%WorkPath%\%UserList%">>"%WorkPath%\TMP%UserList%"
move /y "%WorkPath%\TMP%UserList%" "%WorkPath%\%UserList%"
for /f "delims=" %%R in ('type "%WorkPath%\%UserList%"') do (
   if not "%%R"=="" (
      call :UpLoad "%WorkPath%\%UserList%"
      call :UpLoad "%WorkPath%\%LogFile%"
   )
)
goto :eof

:GenerateChoiceCharChaine
set "CharCode1=%DefaultChar%"
set "CharCode2=%VariableChar%"
set "CharChaine=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
for /l %%N in (3 1 64) do (
   set "CharCode%%N=!CharChaine:~0,1!"
   set "CharChaine=!CharChaine:~1!"
)
for /f "tokens=1* delims=%DefaultChar%" %%G in ("ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■") do set "TMPChaine=%%G%%H"
for /f "tokens=1* delims=%VariableChar%" %%I in ("%TMPChaine%") do set "ChoiceChaine=%%I%%J"
set "ParsingChoiceChaine=!ChoiceChaine!"
for /l %%K in (65 1 189) do (
   set "CharCode%%K=!ChoiceChaine:~0,1!"
   set "ChoiceChaine=!ChoiceChaine:~1!"
)
goto :eof

:End
pause
exit


Pour l'utilisé la synthaxe est la suivante:

Attention le caractère ~ doit étre dans la commande, c'est le séparateur entre les deux valeurs de chaque paramètre

GameBatchCh@t.bat -u UserName~UserPassword -s ServerURL~MountPoint -c VariableCharDefaultChar

UserName Noms de l'utilisateur sur le serveur
UserPassword MDP de l'utilisateur sur le serveur
ServerURL URL du serveur
MountPoint Chemin daccés du répertoire de travaille (sur le serveur) en partant du répertoire racine de l'utilisateur (sur le serveur)
VariableChar utlisé le caractère "£" ou un caractère codé de 0x80 à 0xFE. Vous entrerais ££ pour validé, £s pour entré un espace, £r pour éffacé une lettre, £v pour entré une virgule et £p pour un point.
DefaultChar utlisé le caractère "€" ou un caractère codé de 0x80 à 0xFE.




et le FTP_Mod.bat

Code:

@echo off



REM Auteur Original: Juillard Jean-Baptiste

REM Ce fichier est publier en Open Source, il peut êtres copier, modifier ou redistribuer
REM qu'à la condition que l'auteur original, les auteurs de modifications ainsi que la
REM présente déclaration de licence soit toujours explicitement citer.


::Configuration des parametres FTP
set "UpAndDown=%1"
set "WorkingFile=%2"
set "MountPoint=%3"
::Configuration des parametres de l'utilisateur
set "UserName=%4"
set "UserPassword=%5"
set "ServerURL=%6"

set "FTPScriptPath=%TMP%\%UserName%FTPScript.txt"

::Creation du script FTP
call :WrhiteFTPScript
::Transaction avec le serveur et initialisation du code d'erreur
1>nul ftp -v -s:"%FTPScriptPath%" %ServerURL%
set "ExitCode=%ErrorLevel%"
::Suppression du script FTP
del /Q "%FTPScriptPath%"
goto End

:WrhiteFTPScript
if exist "%FTPScriptPath%" del /d "%FTPScriptPath%"
echo %UserName%>%FTPScriptPath%
echo %UserPassword%>>%FTPScriptPath%
echo ascii>>%FTPScriptPath%
echo cd %MountPoint% >>%FTPScriptPath%
if "%UpAndDown%"=="0" (
   echo get %WorkingFile%>>%FTPScriptPath%
   echo !if exist %WorkingFile% ^& exit /b ^& delete %WorkingFile%
)
if "%UpAndDown%"=="1" echo put %WorkingFile%>>%FTPScriptPath%
echo bye>>%FTPScriptPath%
goto :eof

:End
exit /b %ExitCode%




Répondre en citant
Message Re: Fin du sujet 
totor a écrit:
Bonjour à tous,

Le but de cette page été à la base d'aidé edgekiller à faire comminiquer plusieur batch emsembles afin de pouvoir jouer des partis en réseaux. Le but a été atteint il ya peut avec mise au point d'un chat et d'un module FTP.

entre temps Shocked EDGEKILLER A DISPARUT DES ÉCRANS Shocked , et c'est donc pour cette raison que ce tutto ce termine, mais ne vous inquiété pas le dévellopement continut.

Pour terminé ce tutto en beauté, je met a votre disposition le code du chat et en ce qui concerne le reste du programme je le mettrer sur le forum une fois finit (bientot,il y a quelque bug du au faite que j'ais déplacer la configuration vers le registre).

Voilà le code de la première version du chat

GameBatchCh@t.bat:

Code:

@echo off
setlocal enabledelayedexpansion


REM Auteur Original: Juillard Jean-Baptiste

REM Ce fichier est publier en Open Source, il peut êtres copier, modifier ou redistribuer
REM qu'à la condition que l'auteur original, les auteurs de modifications ainsi que la
REM présente déclaration de licence soit toujours explicitement citer.


set InitMode=1

goto SetParams
:ConfigParams
::Configuration des paramètres utilisateur
if /i "%Un%"=="-u" (
   for /f "tokens=1* delims=~" %%A in ("%Deux%") do (
      set "UserName=%%A"
      set "UserPassword=%%B"
   )
)
::Configuration des paramètres de connexion
if /i "%Un%"=="-s" (
   for /f "tokens=1* delims=~" %%C in ("%Deux%") do (
      set "ServerURL=%%C"
      set "MountPoint=%%D"
   )
)
::Configuration des caractères spéciaux
if /i "%Un%"=="-c" (
   set "VariableChar=%Deux:~0,1%"
   set "DefaultChar=%Deux:~1,1%"
)
::Configuration du mode d'initialisation
if /i "%Un%"=="-i" (
   set InitMode=0
   shift /1& goto SetParams
)
shift /1& shift /1
:SetParams
set "Un=%1"
set "Deux=%2"
if not "%Un%"=="" goto ConfigParams




::Définition des paramètres d'affichages
set "DefaultScreenSize=80*20"
set ScreenSize=
::Définition des fichiers de réponses
set "WorkPath=%cd%\%UserName%"
set "LogFile=ChatLog.txt"
set "UserList=UserList.txt"

::+
set "ConnectPost=est connecté."
set "DisConnectPost=est déconnecté."


:Init
mkdir "%WorkPath%"
call :SetScreenSize
title [%UserName%@//%ServerURL%/%MountPoint%]
mode con cols=%WindowsSizeY% lines=%WindowsSizeX%
set WindowsSizeX=
set WindowsSizeY=
if exist "%WorkPath%\%LogFile%" del /q "%WorkPath%\%LogFile%"
if "%InitMode%"=="0" (
   echo GameBatchCh@t v0.4>"%WorkPath%\%LogFile%"
   echo Powered by Game Batch Studio>>"%WorkPath%\%LogFile%"
   echo %Date% %Time:~0,8%>>"%WorkPath%\%LogFile%"
   echo *************************>>"%WorkPath%\%LogFile%"
   echo #>>"%WorkPath%\%LogFile%"
   echo #%UserName% %ConnectPost%>>"%WorkPath%\%LogFile%"
   echo #>>"%WorkPath%\%LogFile%"
   call :UpLoad "%WorkPath%\%LogFile%"
   echo %UserName%>"%WorkPath%\%UserList%"
   call :UpLoad "%WorkPath%\%UserList%"
)
if "%InitMode%"=="1" (
   call :DownLoad "%LogFile%"
   echo #>>"%WorkPath%\%LogFile%"
   echo #%UserName% %ConnectPost%>>"%WorkPath%\%LogFile%"
   echo #>>"%WorkPath%\%LogFile%"
   call :UpLoad "%WorkPath%\%LogFile%"
   call :DownLoad "%UserList%"
   echo %UserName%>>"%WorkPath%\%UserList%"
   call :UpLoad "%WorkPath%\%UserList%"
)
call :GenerateChoiceCharChaine
call :Affiche
set OperationalCounter=0
set OldOperationalCounter=0
set SpecialChar=0
goto ExecChat

:SetScreenSize
if not defined ScreenSize set "ScreenSize=%DefaultScreenSize%"
set WindowsSizeX=%ScreenSize:~3,2%
set WindowsSizeY=%ScreenSize:~0,2%
set DefaultScreenSize=
set ScreenSize=
set /a "BodySizeX=WindowsSizeX-4"
set /a "BodySizeY=WindowsSizeY-4"
set LogLine0=0
set /a "BodySizeYDec3=%BodySizeY%-3"
set /a "RatioMaxChar=2048/%BodySizeY%"
for /l %%G in (1 1 %BodySizeY%) do set "HorizontalBorder=!HorizontalBorder!═"
for /l %%G in (0 1 %BodySizeYDec3%) do set "NoTextFoundLine=!NoTextFoundLine! "
goto :eof

:ExecChat
call :Affiche
1>nul choice /c %DefaultChar%%VariableChar%ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%ParsingChoiceChaine% /n /cs /t 15 /d %DefaultChar%
set "CharCode=%ErrorLevel%"
if "%CharCode%"=="1" (
   set CharCode=
   call :DownLoad "%LogFile%"
   goto ExecChat
)
call :EvalCharCode
if  %OperationalCounter% NEQ %OldOperationalCounter% call :AddMSG
goto ExecChat
:EvalCharCode
if "%SpecialChar%"=="0" (
   if "%CharCode%"=="2" (
      set "BufferSpecialChar=%VariableChar%"
      set TempSpecialChar1=1
   )
)
if "%SpecialChar%"=="1" (
   if "%CharCode%"=="2" (
      set "BufferSpecialChar=%BufferSpecialChar%%VariableChar%"
      set SpecialChar=2
   )
)
for /l %%K in (3 1 189) do if "%CharCode%"=="%%K" set "Buffer=!CharCode%%K!"
if "%SpecialChar%"=="1" (
   set "BufferSpecialChar=%BufferSpecialChar%%Buffer%"
   set SpecialChar=2
   set Buffer=
)
if "%TempSpecialChar1%"=="1" (
   set SpecialChar=1
   set TempSpecialChar1=0
)
if "%SpecialChar%"=="2" (
   if "%BufferSpecialChar%"=="%VariableChar%%VariableChar%" set /a "OperationalCounter+=1"
   if "%BufferSpecialChar%"=="%VariableChar%r" set "Memory=%Memory:~0,-1%"
   if "%BufferSpecialChar%"=="%VariableChar%q" call :DisConnect & goto End
   if "%BufferSpecialChar%"=="%VariableChar%s" set "Memory=%Memory% "
   if "%BufferSpecialChar%"=="%VariableChar%p" set "Memory=%Memory%."
   if "%BufferSpecialChar%"=="%VariableChar%v" set "Memory=%Memory%,"
   set BufferSpecialChar=
   set SpecialChar=0
)
if defined Buffer set "Memory=%Memory%%Buffer%"
set CharCode=
if defined Buffer set Buffer=
goto :eof

:Affiche
call :ParseLog
cls
echo  ╔%HorizontalBorder%╗
for /l %%G in (1 1 %BodySizeX%) do echo  ║ !BufferLog%%G! ║
echo  ╚%HorizontalBorder%╝
if defined Memory echo  !Memory!
goto :eof
:ParseLog
set InputSysCounter=0
for /l %%A in (1 1 %BodySizeX%) do set LogLine%%A=
for /f "delims=" %%B in ('type "%WorkPath%\%LogFile%"') do (
   set "InLine=%%B"
   call :ParseLine
)
if !CounterLineBuffer! LEQ %BodySizeX% set DecalLog=0
if !CounterLineBuffer! GTR %BodySizeX% set /a "DecalLog=!CounterLineBuffer!-%BodySizeX%"
set CounterLineBuffer=
for /l %%F in (1 1 %BodySizeX%) do (
   set /a "DecalPointer=!DecalLog!+%%F"
   set "LinePointer=%%F"
   call :AddLine
   if not "!BufferLog!"=="" set "BufferLog%%F=!BufferLog!"
   if "!BufferLog!"=="" set "BufferLog%%F=!NoTextFoundLine!"
   set BufferLog=
)
set DecalLog=
set DecalPointer=
set LinePointer=
goto :eof
:ParseLine
set CounterLine=0
for /l %%C in (1 1 %RatioMaxChar%) do (
   if not "!InLine!"=="" set "Data=!InLine:~0,%BodySizeY%!"
   if not "!InLine:~%BodySizeY%!"=="" set "InLine=!InLine:~%BodySizeY%!"
   if "!InLine:~%BodySizeY%!"=="" set InLine=
   if not "!Data!"=="" (
      set "TMPLine%%C=!Data!"
      set /a "CounterLine+=1"
   )
   set Data=
)
for /l %%D in (1 1 !CounterLine!) do (
   set "Data=!TMPLine%%D!"
   call :AddSpace
)
set InLine=
set Data=
for /l %%D in (1 1 !CounterLine!) do set TMPLine%%D=
set CounterLine=
goto :eof
:AddSpace
for /l %%E in (0 1 %BodySizeYDec3%) do (
   if not "!Data:~%%E,1!"=="" set "Buffer=!Buffer!!Data:~%%E,1!"
   if "!Data:~%%E,1!"=="" set "Buffer=!Buffer! "
)
set /a "CounterLineBuffer+=1"
set "LogLine%CounterLineBuffer%=!Buffer!"
set LogLine0=%CounterLineBuffer%
set Buffer=
goto :eof
:AddLine
if not "!LogLine%DecalPointer%!"=="" set "BufferLog=!LogLine%DecalPointer%!"
set LogLine%DecalPointer%=
goto :eof

:AddMSG
set "TMPMemory=!Memory!"
set Memory=
call :Affiche
call :DownLoad "%LogFile%"
1>>"%WorkPath%\%LogFile%" echo [%UserName%:] %TMPMemory%
call :UpLoad "%WorkPath%\%LogFile%"
set OldOperationalCounter=%OperationalCounter%
goto :eof

:UpLoad
pushd "%WorkPath%"
call .\FTP_Mod.bat 1  "%%~1" %MountPoint% %UserName% %UserPassword% %ServerURL%
popd
goto :eof

:DownLoad
pushd "%WorkPath%"
call .\FTP_Mod.bat 0  "%%~1" %MountPoint% %UserName% %UserPassword% %ServerURL%
popd
goto :eof

:DisConnect
call :DownLoad "%LogFile%"
echo #>>"%WorkPath%\%LogFile%"
echo #%UserName% %DisConnectPost%>>"%WorkPath%\%LogFile%"
echo #>>"%WorkPath%\%LogFile%"
call :DownLoad "%UserList%"
findstr /c:%UserName% /l /v "%WorkPath%\%UserList%">>"%WorkPath%\TMP%UserList%"
move /y "%WorkPath%\TMP%UserList%" "%WorkPath%\%UserList%"
for /f "delims=" %%R in ('type "%WorkPath%\%UserList%"') do (
   if not "%%R"=="" (
      call :UpLoad "%WorkPath%\%UserList%"
      call :UpLoad "%WorkPath%\%LogFile%"
   )
)
goto :eof

:GenerateChoiceCharChaine
set "CharCode1=%DefaultChar%"
set "CharCode2=%VariableChar%"
set "CharChaine=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
for /l %%N in (3 1 64) do (
   set "CharCode%%N=!CharChaine:~0,1!"
   set "CharChaine=!CharChaine:~1!"
)
for /f "tokens=1* delims=%DefaultChar%" %%G in ("ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■") do set "TMPChaine=%%G%%H"
for /f "tokens=1* delims=%VariableChar%" %%I in ("%TMPChaine%") do set "ChoiceChaine=%%I%%J"
set "ParsingChoiceChaine=!ChoiceChaine!"
for /l %%K in (65 1 189) do (
   set "CharCode%%K=!ChoiceChaine:~0,1!"
   set "ChoiceChaine=!ChoiceChaine:~1!"
)
goto :eof

:End
pause
exit


Pour l'utilisé la synthaxe est la suivante:

Attention le caractère ~ doit étre dans la commande, c'est le séparateur entre les deux valeurs de chaque paramètre

GameBatchCh@t.bat -u UserName~UserPassword -s ServerURL~MountPoint -c VariableCharDefaultChar

UserName Noms de l'utilisateur sur le serveur
UserPassword MDP de l'utilisateur sur le serveur
ServerURL URL du serveur
MountPoint Chemin daccés du répertoire de travaille (sur le serveur) en partant du répertoire racine de l'utilisateur (sur le serveur)
VariableChar utlisé le caractère "£" ou un caractère codé de 0x80 à 0xFE. Vous entrerais ££ pour validé, £s pour entré un espace, £r pour éffacé une lettre, £v pour entré une virgule et £p pour un point.
DefaultChar utlisé le caractère "€" ou un caractère codé de 0x80 à 0xFE.




et le FTP_Mod.bat

Code:

@echo off



REM Auteur Original: Juillard Jean-Baptiste

REM Ce fichier est publier en Open Source, il peut êtres copier, modifier ou redistribuer
REM qu'à la condition que l'auteur original, les auteurs de modifications ainsi que la
REM présente déclaration de licence soit toujours explicitement citer.


::Configuration des parametres FTP
set "UpAndDown=%1"
set "WorkingFile=%2"
set "MountPoint=%3"
::Configuration des parametres de l'utilisateur
set "UserName=%4"
set "UserPassword=%5"
set "ServerURL=%6"

set "FTPScriptPath=%TMP%\%UserName%FTPScript.txt"

::Creation du script FTP
call :WrhiteFTPScript
::Transaction avec le serveur et initialisation du code d'erreur
1>nul ftp -v -s:"%FTPScriptPath%" %ServerURL%
set "ExitCode=%ErrorLevel%"
::Suppression du script FTP
del /Q "%FTPScriptPath%"
goto End

:WrhiteFTPScript
if exist "%FTPScriptPath%" del /d "%FTPScriptPath%"
echo %UserName%>%FTPScriptPath%
echo %UserPassword%>>%FTPScriptPath%
echo ascii>>%FTPScriptPath%
echo cd %MountPoint% >>%FTPScriptPath%
if "%UpAndDown%"=="0" (
   echo get %WorkingFile%>>%FTPScriptPath%
   echo !if exist %WorkingFile% ^& exit /b ^& delete %WorkingFile%
)
if "%UpAndDown%"=="1" echo put %WorkingFile%>>%FTPScriptPath%
echo bye>>%FTPScriptPath%
goto :eof

:End
exit /b %ExitCode%




Message Aide a EdgeKiller 


Montrer les messages depuis:
Répondre au sujet Page 2 sur 2
Aller à la page: <  1, 2
  



Index | créer un forum | Forum gratuit d’entraide | Annuaire des forums gratuits | Signaler une violation | Conditions générales d'utilisation
Copyright 2008 - 2016 // Batch