Is There A Function Like Shell.run() for Normal Lua(without any cc apis)?
#1
Posted 04 January 2013 - 06:37 AM
P.S. I Have No Way To Access lua.org
Regards'
Dusty_rebel
#2
Posted 04 January 2013 - 06:42 AM
#3
Posted 04 January 2013 - 06:53 AM
#4
Posted 04 January 2013 - 06:56 AM
#5
Posted 04 January 2013 - 07:11 AM
local f = io.open("program", "r")
local content = f:read("*all")
f:close()
local runCode = loadstring(content)
runCode()
Although the above code should work, I don't really see a need to use loadstring in this case. Just encapsulate your quiz code in a function, and then use simple if/else statements to decide whether to restart or continue.
#6
Posted 04 January 2013 - 07:16 AM
#8
Posted 04 January 2013 - 07:33 AM
#9
Posted 04 January 2013 - 07:55 AM
so can anyone help me with that?
#10
Posted 04 January 2013 - 07:57 AM
#11
Posted 04 January 2013 - 08:42 AM
#12
Posted 04 January 2013 - 08:44 AM
#13
Posted 04 January 2013 - 08:51 AM
#14
Posted 04 January 2013 - 08:55 AM
Windows (not sure about this full path):
C:\Users\yourusernamehere\My Documents\Lua\test.lua
Mac:
/Users/yourusernamehere/Documents/Lua/test.lua or ~/Documents/Lua/test.lua
The error unknown file or directory means that Lua could not find the file - it doesn't exist. That's because you didn't specify the full path to it.
#15
Posted 04 January 2013 - 08:59 AM
#16
Posted 04 January 2013 - 09:56 AM
EDIT: /Quiz Still doesnt work :/
Edited by Dusty_Rebel, 04 January 2013 - 10:13 AM.
#17
Posted 04 January 2013 - 10:18 AM
#19
Posted 04 January 2013 - 10:28 AM
EDIT: nope still don't work :/
#20
Posted 04 January 2013 - 10:38 AM
EDIT: I tried documents/quiz and it just didn't work I saw that's where the directory is and it didn't work :/
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












