batch file - Multiplying error: * was unexpected at this time -
i got problem. making game module in batch , got strange error:
multiplying error "*!map_playerlengthx! unexpected @ time"
this whole code:
@echo off setlocal enabledelayedexpansion pause >nul cls call :map_defineplayer 4 2 loloolol echo %px1y1%%px2y1%%px3y1%%px4y1% echo %px1y2%%px2y2%%px3y2%%px4y2% pause >nul ::::::::::::::::::::::::::: :: map v0.10 kkziomek :: ::::::::::::::::::::::::::: :map_init set map_running=1 goto :eof :map_load if !map_running!==0 goto :eof set map_load_filetoload=%~1 set map_load_borderx=%~2 set map_load_bordery=%~3 set map_load_bchar=%~4 set map_load_linetotal=0 /f "tokens=* delims= usebackq" %%l in (!map_load_filetoload!) ( set /a map_load_linetotal+=1 set map_line!map_load_linetotal!=%%l ) :map_load_applycoords /l %%g in (1,1,!map_load_linetotal!) ( call :map_load_strlen map_line%%g map_line%%g_len set /a map_load_applycoords_decidedlen+=!map_line%%g_len! ) set /a map_load_applycoords_decidedlen/=!map_load_linetotal! /l %%y in (1,1,!map_load_linetotal!) ( /l %%x in (1,1,!map_load_applycoords_decidedlen!) ( set x%%xy%%y=!map_line%%y:~%%x,1! ) ) goto :eof :map_load_strlen setlocal disabledelayedexpansion set map_load_strlen_len=0 if defined %~1 /f "delims=:" %%n in ( '"(cmd /v:on /c echo(!%~1!&echo()|findstr /o ^^"' ) set /a "map_load_strlen_len=%%n-3" endlocal & if "%~2" neq "" (set %~2=%map_load_strlen_len%) else echo %map_load_strlen_len% exit /b :map_display cls /l %%y in (1,1,!map_load_linetotal!) ( set map_display_line%%y= /l %%x in (1,1,!map_load_applycoords_decidedlen!) ( set map_display_line%%y=!map_display_line%%y!!x%%xy%%y! ) ) /l %%z in (1,1,!map_load_linetotal!) ( echo !map_display_line%%z! ) goto :eof :map_reloadpos set xpos=%~1 set ypos=%~2 set x!xpos!y!ypos!=!map_line%ypos%:~%xpos%,1! goto :eof :map_defineplayer set map_playerlengthx=%~1 set map_playerwidthy=%~2 set map_defineplayer_scheme=%~3 set /a map_defineplayer_modifier=!map_playerlengthx!-1 /l %%p in (1,1,!map_playerwidthy!) ( /l %%q in (0,1,!map_defineplayer_modifier!) ( set /a localq=%%q+1 set /a modq=%%q+((%%p-1)*!map_playerlengthx!) set px%localq%y%%p=!map_defineplayer_scheme:~%modq%,1! ) ) ::::::::::::::::::::::::::: ::::::::::::::::::::::::::: :::::::::::::::::::::::::::
i error in function :map_defineplayer
. think it's in line: set /a modq=%%q+((%%p-1)*!map_playerlengthx!)
every function works fine instead of function because of weird multiplying error. tried enbling delayed expansion again, changing !map_playerlengthx!
%map_playerlengthx%
changed error in *4 unexpected @ time
anyone has idea causes , how fix it?
try :
set /a "modq=%%q+((%%p-1)*!map_playerlengthx!)"
the brackets in expression taken closing brackets for
loop
Comments
Post a Comment