Scripts / User text input issue.

Author
Message
SAR1
7
Years of Service
User Offline
Joined: 9th Jun 2017
Location:
Posted: 21st Feb 2018 18:56
I'm relatively new to Lua and so this is probably an issue of ignorance but I can't seem to get to the bottom of this one:

I would like a simple means of getting user text input and storing it in a variable. I have seen Small_g's password script which works just fine but I wonder if it is possible to do this with much less coding similar to BASIC style, Input A$.

I've tried using:
io.write("Input some text:")
text = io.read()
io.write(text)

or print(text) or Prompt(text)

but in the context of GameGuru this didn't seem to do anything and the 'text' variable remained null.

I suspect my misconception of how GameGuru handles these commands and text input in general is to blame here, but it would be so much more convienient if I could find a simple way of reading user input. Any pointers would be much appreciated.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Feb 2018 19:04
Basic answer is that no, there is no simple way to redirect the keyboard input in the way you describe.
Been there, done that, got all the T-Shirts!
PM
SAR1
7
Years of Service
User Offline
Joined: 9th Jun 2017
Location:
Posted: 21st Feb 2018 19:11
Hmm. That's a shame as it appears to be a fairly standard deal in Lua itself. Maybe it could be considered in a future revision of GG ? It would be quite handy to have a simple input for user typed data.

Many thanks for clearing it up for me though AmenMoses !
PM

Login to post a reply

Server time is: 2024-12-22 20:01:40
Your offset time is: 2024-12-22 20:01:40