I7 Pills in a Pillbox Counter

I have designed my player with a disease who is hunting a permanent cure. The idea behind this is in the game there is a timer (already mocked up the code and playing around with that) so that every 24 hours he has to take a pill.
The player will not run out, or maybe be able to find more. The puzzle is not finding pills, it is remembering to take the pill. If they don’t then the game ends in death. My problem does not relate to the 24 hour timer. I am trying to figure that one out as I learn.

My problem is storing the pills. I know I can do:
Pill 1 is a thing
Pill 2 is a thing

What I want to do, if possible is:
Pill Box is a container. “Box of pills”

Then have like 7 pills in the box (its one of those week long pill tracker things).

I was thinking of something along the lines of
PillCount is a number. PillCount is 7.

Then when the player types Eat Pill that counter goes down by 1. If they find a pill it goes up by 1.

I am having fun trying to get the code right on that.

What I am asking is how do I have in my Inventory a Pill Box container and when I examine it it will say "A box of 7 sections for a week of pills. You have [PillCount] left.

The player carries a pillbox. The pillbox has a number called the count. The description of the pillbox is “You have [count] pills left.”

The description of the pillbox is “You have [count] pill[s] left.”

Just to handle correct pluralization with 1 pill.

Thanks, that is nearly there.
Do I create a ‘thing’ called pills? Or do I rely on the count and the word ‘pills’ is just text/string not relating to a thing?

You could implement this in a few different ways. If the puzzle really doesn’t depend on the number of pills remaining, this is easiest.

There are some pills in the pillbox. Understand "pill" as the pills.
Instead of taking the pills: say "You swallow another of the pills."

On the other hand, maybe the player will think of different usages that might be appropriate for a pill in the course of the game. Implementing the pills as actual objects that can be dropped, etc., would be more fun, and not too much harder to code. You might try something (untested and undoubtedly bad code) along the lines of, “Instead of taking a pill (called p) when p is already held: try eating p.”

If you’re doing it that way:

A pill is a kind of thing. There are 20 pills in the pillbox.

And for a bit of disambiguation:

Understand "take [a pill]" as a mistake ("You need to be more specific: try GET PILL or EAT PILL instead.").

Sorry, been really busy at work and dealing with kids.

The pills are part of the game. I am guesstimating that someone may need 7 days to complete the game (7 days in game, not real time) so I want to supply seven tablets. There is an assumption that you don’t need to take a pill on day 1 (when you start) so you only need to eat 6 pills giving 1 remainder.

I know, there could be other implementations on this and more challenges but for me personally I am terrible at taking tablets so its that little part of me going into the game.

thank you all for helping, I do appreciate it.

Looks like I’ll be doing a mixture of the responses.

A Pillbox is a type of thing. The pillbox has a number called the pillcount. The description of the pillbox is “You have [pillcount] pill[s] left.”

A Pill is a type of thing. There are 20 pills in the pillbox. Understand “pill” as the pills.
Instead of taking the pills: say “You swallow another of the pills.”; change pillcount to pillcount -1.

It won’t work to mix and match the two approaches like that. Either use one or the other. (The rules in the first method would apply to a single object called “some pills” and a number variable, while the rules in the second would apply to a collection of individual pill objects.)