Lua beginner
Posted: Mon May 19, 2008 12:41 pm
Hi!
Following script doesn't work, because it doesn't wait for user input:
Output is:
Where am I going wrong? I trying to make a simple menu to users...
Thanks in advance.
Following script doesn't work, because it doesn't wait for user input:
Code: Select all
startKey = key.VK_INSERT;
stopKey = key.VK_DELETE;
function main()
io.write("Are you OK? (Y/N): ");
answer = io.read(1);
-- answer = io.read("*line");
print("Your choice is:", answer);
end
startMacro(main);
Code: Select all
MicroMacro v0.97
SolarImpact
http://solarimpact.servegame.com
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script> entrada.lua
Opening entrada.lua...
Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and load a new script.
-------------------------------------------------
The macro is currently not running. Press the start key (Insert) to begin.
You may use (Delete) key to stop/pause the script.
Started.
Are you OK? (Y/N): Your choice is:
Stopping execution.
Thanks in advance.