Are you trying to allow the player to enter a number?
Take a look at chapter 17.9, and then example 304 “Down in Oodville” in that chapter. That shows how to accept a player command which is a number. The number winds up in the number understood so then you can do whatever you want with it.
I actually ended up using your code from a previous forum topic.
To decide what number is the numeric equivalent of (P - snippet): (- SnippetToNumber({P}) -).
Include (-
! This only recognizes zero and positive numbers. It accepts English words "zero" to "thirty" and digit forms up to 10000. If the snippet is not a number, or contains more than one word, this returns -1000.
[SnippetToNumber snip snippos sniplen;
snippos = snip/100;
sniplen = snip%100;
if (sniplen ~= 1)
return -1000;
return TryNumber(snippos);
];
-).
Then I used this in my script:
let N be the numeric equivalent of the player's command;
The player input isn’t from a custom action; it’s from a “After reading a command when the command prompt is”