Sign in to follow this  
Followers 0
mesale0077

bat code does not work

4 posts in this topic

hi

bat file code

@echo off

title Batch Movie 



set framecount=0
set framedelay=3

:CallFrameLoop
set /a framecount= %framecount% + 1
set /a endtime= %time:~9,1% + %framedelay%
if /i %endtime% geq 10 set /a endtime= endtime - 10
call :FrameCheck
Call :Frame%FrameCount% 2>nul
goto CallFrameLoop

:FrameCheck
if /i %time:~9,1% neq %endtime% goto FrameCheck
exit /b



:Frame1
cls
echo ()
echo /\
echo /\
exit /b

:frame2
cls
echo ()__  Who's that?      []
echo /                      /\
echo /\                     /\
exit /b

:frame4
cls
echo ()__               __[] Ooh hello!
echo /                     \
echo /\                   /\
exit /b

:frame6
cls
echo ()__               []
echo /                  /\
echo /\                 /\
exit /b

:frame7
cls
echo ()__             []
echo /                /\
echo /\               /\
exit /b

:frame8
cls
echo ()__           []
echo /              /\
echo /\             /\
exit /b

:frame9
cls
echo ()__         []
echo /            /\
echo /\           /\
exit /b

:frame10
cls
echo ()__       [] Hey
echo /          /\
echo /\         /\
exit /b


:frame13
cls
echo ()__      [] I'm student.
echo /         /\
echo /\        /\
exit /b

:frame16
cls
echo () Oh     []
echo /\        /\
echo /\        /\
exit /b

:frame19
cls
echo ()Okay... []
echo /\        /\
echo /\        /\
echo.
echo.
exit /b

:frame21
cls
echo ()        [] Wanna explode?
echo /\        /\
echo /\        /\
echo.
echo.
exit /b


:frame24
cls
echo () What?  [] 
echo /\ No..   /\
echo /\        /\
echo.
echo.
exit /b


:frame29
cls
echo () You're []
echo /\ Weird. /\
echo /\        /\
echo.
echo.
exit /b


:frame32
cls
echo ()        [] Fine, Just me then...
echo /\        /\
echo /\        /\
echo.
echo.
exit /b


:frame34
cls
echo ()        [!]
echo /\        /!\
echo /\        /!\
echo.
echo.
FRAMEDELAY=1
exit /b

:frame35
cls
echo ()        [!~!]
echo /\        /! !\
echo /\        /!v!\
echo.             
echo.
exit /b

:frame36
cls
echo ()        [  ]
echo /\       /    \
echo /\      /      \ 
echo.                  
echo.
exit /b


:frame37
cls
echo ()            ]
echo /\        [     
echo /\     / /    \\
echo.                    
echo.
exit /b

:frame38
cls
echo ()          
echo /\        [       ]      
echo /\    / /      \\  
echo.       
echo.
exit /b


:frame39
cls
echo ()  Weirdo.
echo /\              
echo /\    / /[    \\  ]           
echo.      
echo.
echo.
echo.
FRAMEDELAY=3
echo.      
echo.
echo.
echo.
exit /b

but

this autoit code dont work

why?

$bat=""& @CRLF
$bat&="@echo off"& @CRLF
$bat&="title Batch Movie "& @CRLF
$bat&="set framecount=0"& @CRLF
$bat&="set framedelay=3"& @CRLF
$bat&=":CallFrameLoop"& @CRLF
$bat&="set /a framecount= %framecount% + 1"& @CRLF
$bat&="set /a endtime= %time:~9,1% + %framedelay%"& @CRLF
$bat&="if /i %endtime% geq 10 set /a endtime= endtime - 10"& @CRLF
$bat&="call :FrameCheck"& @CRLF
$bat&="Call :Frame%FrameCount% 2>nul"& @CRLF
$bat&="goto CallFrameLoop"& @CRLF
$bat&=":FrameCheck"& @CRLF
$bat&="if /i %time:~9,1% neq %endtime% goto FrameCheck"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":Frame1"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()"& @CRLF
$bat&="echo /\"& @CRLF
$bat&="echo /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame2"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__  Who's that?      []"& @CRLF
$bat&="echo /                      /\"& @CRLF
$bat&="echo /\                     /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame4"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__               __[] Ooh hello!"& @CRLF
$bat&="echo /                     \"& @CRLF
$bat&="echo /\                   /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame6"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__               []"& @CRLF
$bat&="echo /                  /\"& @CRLF
$bat&="echo /\                 /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame7"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__             []"& @CRLF
$bat&="echo /                /\"& @CRLF
$bat&="echo /\               /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame8"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__           []"& @CRLF
$bat&="echo /              /\"& @CRLF
$bat&="echo /\             /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame9"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__         []"& @CRLF
$bat&="echo /            /\"& @CRLF
$bat&="echo /\           /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame10"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__       [] Hey"& @CRLF
$bat&="echo /          /\"& @CRLF
$bat&="echo /\         /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame13"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__      [] I'm student."& @CRLF
$bat&="echo /         /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame16"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo () Oh     []"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame19"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()Okay... []"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame21"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [] Wanna explode?"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame24"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo () What?  [] "& @CRLF
$bat&="echo /\ No..   /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame29"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo () You're []"& @CRLF
$bat&="echo /\ Weird. /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame32"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [] Fine, Just me then..."& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame34"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [!]"& @CRLF
$bat&="echo /\        /!\"& @CRLF
$bat&="echo /\        /!\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="FRAMEDELAY=1"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame35"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [!~!]"& @CRLF
$bat&="echo /\        /! !\"& @CRLF
$bat&="echo /\        /!v!\"& @CRLF
$bat&="echo.             "& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame36"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [  ]"& @CRLF
$bat&="echo /\       /    \"& @CRLF
$bat&="echo /\      /      \ "& @CRLF
$bat&="echo.                  "& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame37"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()            ]"& @CRLF
$bat&="echo /\        [     "& @CRLF
$bat&="echo /\     / /    \\"& @CRLF
$bat&="echo.                    "& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame38"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()          "& @CRLF
$bat&="echo /\        [       ]      "& @CRLF
$bat&="echo /\    / /      \\  "& @CRLF
$bat&="echo.       "& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame39"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()  Weirdo."& @CRLF
$bat&="echo /\              "& @CRLF
$bat&="echo /\    / /[    \\  ]           "& @CRLF
$bat&="echo.      "& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="FRAMEDELAY=3"& @CRLF
$bat&="echo.      "& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
Run(@Comspec & " /c "& $bat)

thank you now

Share this post


Link to post
Share on other sites



hi mesale0077,

Your approach is a bit tedious, did you try something like this:

Run("batchmovie.bat")

Also, you might be interested in the FileRead() and FileReadLine() functions.

Hope this helps :unsure:

-smartee

Share this post


Link to post
Share on other sites

hi

can it run the code as

write bat file okey but

dont work the code as

Share this post


Link to post
Share on other sites

hi

but

this autoit code dont work

why?

'Couse you never wrote it to a .bat

Try this. See the last couple of lines.

$bat=""& @CRLF
$bat&="@echo off"& @CRLF
$bat&="title Batch Movie "& @CRLF
$bat&="set framecount=0"& @CRLF
$bat&="set framedelay=3"& @CRLF
$bat&=":CallFrameLoop"& @CRLF
$bat&="set /a framecount= %framecount% + 1"& @CRLF
$bat&="set /a endtime= %time:~9,1% + %framedelay%"& @CRLF
$bat&="if /i %endtime% geq 10 set /a endtime= endtime - 10"& @CRLF
$bat&="call :FrameCheck"& @CRLF
$bat&="Call :Frame%FrameCount% 2>nul"& @CRLF
$bat&="goto CallFrameLoop"& @CRLF
$bat&=":FrameCheck"& @CRLF
$bat&="if /i %time:~9,1% neq %endtime% goto FrameCheck"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":Frame1"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()"& @CRLF
$bat&="echo /\"& @CRLF
$bat&="echo /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame2"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__  Who's that?      []"& @CRLF
$bat&="echo /                      /\"& @CRLF
$bat&="echo /\                     /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame4"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__               __[] Ooh hello!"& @CRLF
$bat&="echo /                     \"& @CRLF
$bat&="echo /\                   /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame6"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__               []"& @CRLF
$bat&="echo /                  /\"& @CRLF
$bat&="echo /\                 /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame7"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__             []"& @CRLF
$bat&="echo /                /\"& @CRLF
$bat&="echo /\               /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame8"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__           []"& @CRLF
$bat&="echo /              /\"& @CRLF
$bat&="echo /\             /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame9"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__         []"& @CRLF
$bat&="echo /            /\"& @CRLF
$bat&="echo /\           /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame10"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__       [] Hey"& @CRLF
$bat&="echo /          /\"& @CRLF
$bat&="echo /\         /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame13"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()__      [] I'm student."& @CRLF
$bat&="echo /         /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame16"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo () Oh     []"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame19"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()Okay... []"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame21"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [] Wanna explode?"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame24"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo () What?  [] "& @CRLF
$bat&="echo /\ No..   /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame29"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo () You're []"& @CRLF
$bat&="echo /\ Weird. /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame32"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [] Fine, Just me then..."& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo /\        /\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame34"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [!]"& @CRLF
$bat&="echo /\        /!\"& @CRLF
$bat&="echo /\        /!\"& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="FRAMEDELAY=1"& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame35"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [!~!]"& @CRLF
$bat&="echo /\        /! !\"& @CRLF
$bat&="echo /\        /!v!\"& @CRLF
$bat&="echo.             "& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame36"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()        [  ]"& @CRLF
$bat&="echo /\       /    \"& @CRLF
$bat&="echo /\      /      \ "& @CRLF
$bat&="echo.                  "& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame37"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()            ]"& @CRLF
$bat&="echo /\        [     "& @CRLF
$bat&="echo /\     / /    \\"& @CRLF
$bat&="echo.                    "& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame38"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()          "& @CRLF
$bat&="echo /\        [       ]      "& @CRLF
$bat&="echo /\    / /      \\  "& @CRLF
$bat&="echo.       "& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
$bat&=":frame39"& @CRLF
$bat&="cls"& @CRLF
$bat&="echo ()  Weirdo."& @CRLF
$bat&="echo /\              "& @CRLF
$bat&="echo /\    / /[    \\  ]           "& @CRLF
$bat&="echo.      "& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="FRAMEDELAY=3"& @CRLF
$bat&="echo.      "& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="echo."& @CRLF
$bat&="exit /b"& @CRLF
FileWrite("MyBat.bat", $bat)
$bat = "MyBat.bat"
Run(@Comspec & " /c "& $bat)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0