이전에 corona sdk를 사용 해본 적이 없으며 키로거를 작성하여 코로나를 좋아하는지 확인하기로 결정했습니다.io.open을 사용하여 파일을 열려고 시도 할 때 corona sdk가 충돌 함
입력을 확인하고 파일 경로를 지정할 수 있지만 코드가 io.open에 도달하면 시뮬레이터가 멈추고 충돌이 발생하고 입력이 텍스트 파일에 추가되지 않습니다.
나는 모든 대답을 생각할 수있는 곳을 찾아 보았고 아무 것도 발견하지 못했습니다.
이 코드가 가장 효율적인 코드는 아닙니다. 저는 ROBLOX 엔진 외부의 프로그래밍에 초보자입니다.
function WriteToFile(String)
local path = system.pathForFile("[email protected]", system.DocumentsDirectory)
print("Path") -- Just to try and determine the origin of the crash
local File, ErrorString = io.open(path, "W")
print("File")
if not File then
print('File error: ' .. ErrorString)
else
print("else")
File:write(String)
io.close(File)
end
File = nil
end
function ReturnInput(Key)
if Key.phase == 'down' then
print(Key.keyName)
WriteToFile(tostring(Key.keyName))
end
end
Runtime:addEventListener('key', ReturnInput)
'io.open (경로, "W")' "W"는 소문자 여야합니다. –
나는 이것을 이미 알아낼 수 있었지만 주석을 주셔서 감사합니다. – AZDev