Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ##########################
- -- modify_editcmd
- -- version 0.1
- -- http://hevohevo.hatenablog.com/
- -- This program modifies "/rom/programs/edit"
- -- to convert acces menu key (ctrl_key) into alt_key.
- input_file = "/rom/programs/edit"
- output_file = "edit2"
- trans = {}
- trans['local sStatus = "Press Ctrl to access menu"'] = 'local sStatus = "Press Alt to access menu"'
- trans[' elseif param == keys.leftCtrl or param == keys.rightCtrl then'] = ' elseif param == keys.leftAlt or param == keys.rightAlt then'
- if fs.exists(output_file) then
- print("Error: output file exists")
- else
- print("input file: ",input_file)
- local tmp = {}
- for line in io.lines(input_file) do
- table.insert(tmp,(trans[line] or line))
- end
- local fh = fs.open(output_file,"w")
- for _,l in ipairs(tmp) do
- fh.writeLine(l)
- end
- fh.close()
- print("output file: ",output_file)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement