I'm currently working on a project involving a textbot that outputs information in the console based on user input. It sounds simple, but I've encountered a frustrating problem that I can't seem to solve. There must be an easy fix for this issue, but it's eluding me.
My goal is to have the textbox recognize a command that includes both the user input and a variable provided by the user. Here is an example of what I'm aiming for:
case "input " + condition {
//execute code based on 'condition'
}
My inquiry is how can I differentiate between the user input and the specified condition within the textbox? It may sound confusing, but I'm struggling to frame it differently.
Edit: Here's an illustration for clarity:
Textbox input:
"!locate p.actionValue"
Depending on the value assigned to 'actionvalue' by the user, the response should vary like so:
if (actionvalue = 32) {
//perform an action when actionvalue equals 32
}
The challenge lies in distinguishing between the command and the condition. Any advice or suggestions would be greatly appreciated.