Command snippet into a number

I’m trying to negotiate the transition of a player’s command into a temporary number variable. From the example below, the issue (I think) are the two lines:

if the player's command matches "[number]":
		let N be the player's command;

I’ve tried multiple variations of turning the player’s command into “N”. How might I accomplish that within this framework? Bear in mind that the example below is just a quick test but the real thing needs to fit into a huge game without breaking anything else.

The Bedroom is a room. The clock is scenery in Bedroom.

TimerCountdown is a number which varies. TimerCountdown is initially 0.
ComputerGate is a number which varies. ComputerGate is initially 0.

Instead of pushing clock:
	say "You press the 'time' button on the clock and it waits for you to change its 'minutes'.";
	now ComputerGate is 1;
	now the command prompt is "ENTER NUMBER (0-59) ";

After reading a command while ComputerGate is 1:
	if the player's command matches "[number]":
		let N be the player's command;
		if N is less than 0 and N is greater than 59:
			say "The clock's screen blinks to indicate an invalid entry.";
			reject the player's command;
		otherwise if N is greater than -1 and N is less than 60:
			now TimerCountdown is N;
			now ComputerGate is 0;
			now the command prompt is ">";
			say "The clock now reads, '12:[TimerCountDown]'";
			reject the player's command;	

Instead of using After reading a command, which circumvents the parser, you should be able to do this with actions and check rules.

To get the number from a grammar line, you need to read the number understood:

Frotzing is an action applying to one number. Understand "frotz [number]" as frotzing.

Instead of frotzing:
	say "[the number understood].";
6 Likes