Вот блокнот. Теперь при нажатии ентер каретка не будет возвращена и вы сможете писать дальше. Надеюсь хоть теперь кто-то начнет писать приложения, благо теперь это можно делать прямо в дримшелл.
Кратко о notepad v0.3full:
1)Для работы требует клавиатуру
2)Теперь при нажатии на ентер вы можете писать дальше
3)Сохраняет при нажатии на "~"(консоль, тильда)
Код:
-- Lua notepad v 0.3full by zaero
-- Большое спасибо Swat'y за помощь и поддержку
-- This is notepad.
-- http://bbrclan.dc-swat.net.ru/dreamshell/
-- This is filter ASCII => in char.
function convert_ascii(num)
-- Special symbol and digital
if num == 96 then return "" end
if num == 61 then return "=" end
if num == 59 then return ";" end
if num == 126 then return "~" end
if num == 32 then return " " end
if num == 48 then return "0" end
if num == 49 then return "1" end
if num == 50 then return "2" end
if num == 51 then return "3" end
if num == 52 then return "4" end
if num == 53 then return "5" end
if num == 54 then return "6" end
if num == 55 then return "7" end
if num == 56 then return "8" end
if num == 57 then return "9" end
if num == 33 then return "!" end
if num == 64 then return "@" end
if num == 35 then return "#" end
if num == 36 then return "$" end
if num == 37 then return "%" end
if num == 94 then return "^" end
if num == 38 then return "&" end
if num == 42 then return "*" end
if num == 40 then return "(" end
if num == 41 then return ")" end
if num == 45 then return "-" end
if num == 95 then return "_" end
if num == 43 then return "+" end
if num == 124 then return "|" end
if num == 91 then return "[" end
if num == 93 then return "]" end
if num == 123 then return "{" end
if num == 125 then return "}" end
if num == 46 then return "." end
if num == 44 then return "," end
if num == 58 then return ":" end
if num == 39 then return "'" end
if num == 34 then return '"' end
if num == 60 then return "<" end
if num == 62 then return ">" end
if num == 47 then return "/" end
if num == 63 then return "?" end
if num == 10 then return "\n" end
-- Big char
if num == 65 then return "A" end
if num == 66 then return "B" end
if num == 67 then return "C" end
if num == 68 then return "D" end
if num == 69 then return "E" end
if num == 70 then return "F" end
if num == 71 then return "G" end
if num == 72 then return "H" end
if num == 73 then return "I" end
if num == 74 then return "J" end
if num == 75 then return "K" end
if num == 76 then return "L" end
if num == 77 then return "M" end
if num == 78 then return "N" end
if num == 79 then return "O" end
if num == 80 then return "P" end
if num == 81 then return "Q" end
if num == 82 then return "R" end
if num == 83 then return "S" end
if num == 84 then return "T" end
if num == 85 then return "U" end
if num == 86 then return "V" end
if num == 87 then return "W" end
if num == 88 then return "X" end
if num == 89 then return "Y" end
if num == 90 then return "Z" end
-- Little char
if num == 97 then return "a" end
if num == 98 then return "b" end
if num == 99 then return "c" end
if num == 100 then return "d" end
if num == 101 then return "e" end
if num == 102 then return "f" end
if num == 103 then return "g" end
if num == 104 then return "h" end
if num == 105 then return "i" end
if num == 106 then return "j" end
if num == 107 then return "k" end
if num == 108 then return "l" end
if num == 109 then return "m" end
if num == 110 then return "n" end
if num == 111 then return "o" end
if num == 112 then return "p" end
if num == 113 then return "q" end
if num == 114 then return "r" end
if num == 115 then return "s" end
if num == 116 then return "t" end
if num == 117 then return "u" end
if num == 118 then return "v" end
if num == 119 then return "w" end
if num == 110 then return "x" end
if num == 121 then return "y" end
if num == 122 then return "z" end
end
function save_data(filename, data, size)
local i
local buff = {}
fout_write = assert(io.open(filename,"w"))
for i = 0, size do
buff[i] = convert_ascii(data[i])
fout_write:write(buff[i])
end
io.close(fout_write)
end
local ibuff = {}
local bc = 0
local exit = 1
-- open input outpat streem. This need to buffer.
while exit do
ibuff[bc] = DS.getchar()
if ibuff[bc] == 96 then
save_data("/ram/note.txt", ibuff, bc)
print("Saved in /ram/note.txt\n")
break end
bc = bc+1
end