Hello!
I was wondering if there is any way to have if string($1) == succeed if there is literally any text entered after it. I am looking for a way to return an error if only the intercept command that triggers this check is entered.
Thanks!
Using if string($1) to check for any input
Re: Using if string($1) to check for any input
Can you describe your desired result a little more, please?
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Re: Using if string($1) to check for any input
Sure thing.
I have an intercept prog will echo in the room based upon what is entered after the intercept keyword. I would ideally like there to be a message echoedat the PC if they ONLY enter the intercept keyword, and no extra strings after the intercept keyword.
For example:
I have an intercept prog will echo in the room based upon what is entered after the intercept keyword. I would ideally like there to be a message echoedat the PC if they ONLY enter the intercept keyword, and no extra strings after the intercept keyword.
For example:
Code: Select all
>intercept_prog Keyword~
if string($1) == "" [Like, a wildcard here would be awesome, just checking to see if anything is there for string $1]
mpechoaround Whatever, it worked!
else
mpechoat $n Hey ya gotta put something else there, you!
endif
~
Re: Using if string($1) to check for any input
I have never had an empty stringprefix($x) check. I have used empty commands before by allowing a PC to enter anything and then used $0 to reference and use the PC's input. In this case, you could look for a specific $1, or a specific set of $1s, but you would have to try a blank $1 and see what happens. Quotes would not be required, just a blank space for the RHS. I do know that blank intercepts do work (e.g. intercept_prog ~), so it's possible that this might work.
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons