Чтобы включить скрипт необходимо открыть блокнот, вставить туда vbs скрипт и сохранить с расширением *.vbs, а затем просто запустить
Описание: Игра змейка.
Скрипт:
PHP:
@echo off
if "%~1" == "startGame" goto :game
if "%~1" == "startController" goto :controller
::---------------------------------------------------------------------
:: setup some global variables used by both the game and the controller
setlocal disableDelayedExpansion
:getSession
if defined temp (set "tempFileBase=%temp%\") else if defined tmp set "tempFileBase=%tmp%\"
set "tempFileBase=%tempFileBase%Snake%time::=_%"
set "keyFile=%tempFileBase%_key.txt"
set "cmdFile=%tempFileBase%_cmd.txt"
set "gameLock=%tempFileBase%_gameLock.txt"
set "gameLog=%tempFileBase%_gameLog.txt"
set "signal=%tempFileBase%_signal.txt"
set "saveLoc=%userprofile%\Snake"
set "userPref=%saveLoc%\SnakeUserPref.txt"
set "hiFile=%saveLoc%\Snake!growth!Hi"
set "keyStream=9"
set "cmdStream=8"
set "lockStream=7"
::------------------------------------------
:: Lock this game session and launch.
:: Loop back and try a new session if failure.
:: Cleanup and exit when finished
call :launch %lockStream%>"%gameLock%" || goto :getSession
del "%tempFileBase%*"
exit /b
::------------------------------------------
:launch the game and the controller
call :fixLogs
copy nul "%keyFile%" >nul
copy nul "%cmdFile%" >nul
start "" /b cmd /c ^""%~f0" startController %keyStream%^>^>"%keyFile%" %cmdStream%^<"%cmdFile%" 2^>nul ^>nul^"
cmd /c ^""%~f0" startGame %keyStream%^<"%keyFile%" %cmdStream%^>^>"%cmdFile%" ^<nul^"
echo(
::--------------------------------------------------------------
:: Upon exit, wait for the controller to close before returning
:close
2>nul (»"%keyFile%" call )||goto :close
if not exist "%~dp0CursorPos.exe" (
echo Game play can be improved by installing
echo Aacini's CursorPos.exe, available at
echo http://*******/hr6Kkn
echo(
echo %cmdcmdline%|find /i "%~f0">nul&&pause
)
exit /b 0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:game
title %~nx0
cls
::---------------------------------------
:: Playfield size
:: max playing field: (width-2)*(height-2) <= 1365
set "width=40" max=99
set "height=25" max=99
::----------------------------
:: resize the console window
set /a cols=width+1, lines=height+10, area=(width-2)*(height-2)
if %area% gtr 1365 (
echo ERROR: Playfield area too large
%sendCmd% quit
exit
)
if %lines% lss 14 set lines=14
if %cols% lss 46 set cols=46
mode con: cols=%cols% lines=%lines%
::----------------------------
:: define variables
set "configOptions=diffCode difficulty growth moveKeys up down left right"
set "configOptionCnt=9"
set "moveKeys=4"
set "up=W"
set "down=S"
set "left=A"
set "right=D"
set "pause=P"
set "space= "
set "bound=#"
set "food=+"
set "head=@"
set "body=O"
set "death=X"
set "growth=1"
if exist "%userPref%" for /f "usebackq delims=" %%V in ("%userPref%") do set "%%V"
set "spinner1=-"
set "spinner2=\"
set "spinner3=|"
set "spinner4=/"
set "spinner= spinner1 spinner2 spinner3 spinner4 "
set "delay1=20"
set "delay2=15"
set "delay3=10"
set "delay4=7"
set "d
Автор: Неизвестно.