Read exactly what the player typed
BASIC IN YOUR GAME
Three answers are enough to tell whether the whole connection works. Try an empty box, a wrong word, and a correct word typed in mixed case.
FUNCTION Run()
DIM raw = GetGUIElementProperty("station", "entry", "text", "")
DIM answer = Lower(Trim(raw))
DIM reply = "Read the sign again."
IF answer = "" THEN
reply = "Type a direction."
ELSEIF answer = "west" THEN
reply = "The latch clicks."
END IF
SetGUIElementProperty("station", "reply", "text", reply)
RETURN reply
END FUNCTIONThe running preview after the player entered WeSt and selected Check direction.
| Empty box or spaces | Trim leaves an empty string. The label reads “Type a direction.” |
|---|---|
| east | The starting reply stays in place, so the label reads “Read the sign again.” |
| WeSt | Lower turns it into west. The label reads “The latch clicks.” |
The last empty string in GetGUIElementProperty is the fallback. If every entry acts blank, check the GUI ID, element ID and property name. RETURN also gives the calling script the answer.
