| View previous topic :: View next topic |
| Author |
Message |
Engineer Expert Cheater
Reputation: 1
Joined: 25 Nov 2007 Posts: 170
|
Posted: Sat Dec 29, 2007 1:05 pm Post subject: [batch] I wonder waths wrong with this |
|
|
This is like my 2nd batch program and its all messed up O.O
Yes i know that the user interact wont 80% of the times match the user logic but meh.
| Code: |
@echo off
echo Simple move engine
echo.
echo Move with your arrow keys w,a,s,d.
echo.
echo Press a key!
PAUSE
cls
echo !-!
echo !--!
echo When you move, your "player" will apper.
:walk
set /p mov
if '%mov%' == 'w' goto %up%
if '%mov%' == 's' goto %down%
if '%mov%' == 'd' goto %right%
if '%mov%' == 'a' goto %left%
PAUSE
:up
cls
echo !d!
echo !--!
goto %walk%
:down
cls
echo !-!
echo !-d!
goto %walk%
:right
cls
echo !-!
echo !-d!
goto %walk%
:left
cls
echo !-!
echo !d-!
goto %walk%
[quote]
can anyone fix this? :shock: :shock: :shock: [/quote] |
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25957 Location: The netherlands
|
Posted: Sat Dec 29, 2007 1:29 pm Post subject: |
|
|
set /p mov= instead of set /p mov
and your down is the same as right
and don't forget to press enter
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sat Dec 29, 2007 1:45 pm Post subject: |
|
|
Try this code: | Code: | @echo off
echo Simple move engine
echo.
echo Move with your arrow keys w,a,s,d.
echo.
echo Press a key!
PAUSE
cls
echo !-!
echo !--!
echo When you move, your "player" will apper.
:walk
set /p mov=
if %mov% == w goto up
if %mov% == s goto down
if %mov% == d goto right
if %mov% == a goto left
:up
cls
echo !d!
echo !---!
goto walk
:down
cls
echo !-!
echo !-d-!
goto walk
:right
cls
echo !-!
echo !--d!
goto walk
:left
cls
echo !-!
echo !d--!
goto walk |
|
|
| Back to top |
|
 |
Elec0 Expert Cheater
Reputation: 0
Joined: 21 Nov 2007 Posts: 188 Location: Out of my mind, back in five minutes.
|
Posted: Sat Dec 29, 2007 3:07 pm Post subject: |
|
|
Wow. I didn't know that you could do that with a batch file. Apparently I need to look into batch's again.
~Elec0
_________________
|
|
| Back to top |
|
 |
Engineer Expert Cheater
Reputation: 1
Joined: 25 Nov 2007 Posts: 170
|
Posted: Sun Dec 30, 2007 8:18 am Post subject: |
|
|
AAAAAAAAwwwwwwwww.... its still glitched.
After i press any movement key it closes
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sun Dec 30, 2007 8:57 am Post subject: |
|
|
| It's working i checked again.
|
|
| Back to top |
|
 |
Elec0 Expert Cheater
Reputation: 0
Joined: 21 Nov 2007 Posts: 188 Location: Out of my mind, back in five minutes.
|
Posted: Sun Dec 30, 2007 9:28 am Post subject: |
|
|
Indeed, I tried what HolyBlah posted, and it worked for me.
_________________
|
|
| Back to top |
|
 |
Engineer Expert Cheater
Reputation: 1
Joined: 25 Nov 2007 Posts: 170
|
Posted: Sun Dec 30, 2007 12:05 pm Post subject: |
|
|
Nvm thanks for fixing my code blah
|
|
| Back to top |
|
 |
|