I need help with adding.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ThermicKestrel
Posts: 1
Joined: 21 Jun 2015 03:00

I need help with adding.

#1 Post by ThermicKestrel » 15 Jul 2015 16:22

Im coding a .bat game and I need a way to increase/decrease health and money. I just want a smallish command instead of:

if %money%=05 set %money% 00
if %money%=10 set %money% 05
if %money%=15 set %money% 10
if %money%=20 set %money% 15
if %money%=25 set %money% 20
if %money%=30 set %money% 25

and etc. Is there just a command that subtracts or adds a specific number to a variable? :?:

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: I need help with adding.

#2 Post by Squashman » 15 Jul 2015 20:52

set /a money-=5

Post Reply