here's a bit of code near line 123
... elseif l==i and k==(cmd1) then (cmd1e) elseif -- This is line 123 l==i and k==(cmd2) then (cmd2e) elseif ...I have no idea what caused this error message.
Posted 06 May 2013 - 10:13 AM
... elseif l==i and k==(cmd1) then (cmd1e) elseif -- This is line 123 l==i and k==(cmd2) then (cmd2e) elseif ...I have no idea what caused this error message.
Posted 06 May 2013 - 10:20 AM
Posted 06 May 2013 - 10:23 AM
Posted 06 May 2013 - 10:46 AM
Posted 06 May 2013 - 11:20 AM
(cmd1e)
Posted 06 May 2013 - 11:28 AM
cmd1e=read()I want somone to for example type turtle.suck() and it to run when the code reaches the (cmd1e)
Posted 06 May 2013 - 11:30 AM
(cmd1e)
turtle[cmd1e]()
Posted 06 May 2013 - 11:38 AM
Posted 06 May 2013 - 11:40 AM
Kingdaro, on 06 May 2013 - 11:30 AM, said:
cmd1e = read() -- some code here local func, err = loadstring(cmd1e, "userinput") -- "userinput" will cause errors like "userinput:1: some message" if the given operation failed if not func then -- this happens if the given operation was unloadable, eg. an if-end wasn't closed properly (compile error) -- err describes the error message returned by loadstring error(err) end setfenv(func, getfenv()) local ok, err = pcall(func) -- this will call the function that contains the given operation if not ok then -- this happens when the given operation failed, eg. if it called turtle.Suck() (that's nil, of course) (runtime error) -- err describes the error message returned by pcall error(err) end
Posted 06 May 2013 - 03:45 PM
Posted 06 May 2013 - 04:27 PM
0 members, 1 guests, 0 anonymous users