Example
tHistory = {}
tHistory[1] = ""
h = 1
if key == 14 then tHistory[h] = "" ..tHistory[h].. " " end
tHistory = {}
tHistory[1] = ""
h = 1
if key == 14 then tHistory[h] = "" ..tHistory[h].. " " end
tHistory[h] = string.sub(tHistory[h], 1, -2)
tHistory[h] = string.sub(tHistory[h], 1, string.len(tHistory[h]) - 1 )
Want to see my code?i cant see exactly where in your code you would want this but basically just dotHistory[h] = string.sub(tHistory[h], 1, -2)
if key == "q" then tHistory[h] = "" ..tHistory[h].. "q" end
if key == "w" then tHistory[h] = "" ..tHistory[h].. "w" end
if key == "e" then tHistory[h] = "" ..tHistory[h].. "e" end
if key == "r" then tHistory[h] = "" ..tHistory[h].. "r" end
if key == "t" then tHistory[h] = "" ..tHistory[h].. "t" end
if key == "y" then tHistory[h] = "" ..tHistory[h].. "y" end
if key == "u" then tHistory[h] = "" ..tHistory[h].. "u" end
if key == "i" then tHistory[h] = "" ..tHistory[h].. "i" end
if key == "o" then tHistory[h] = "" ..tHistory[h].. "o" end
if key == "p" then tHistory[h] = "" ..tHistory[h].. "p" end
if key == "a" then tHistory[h] = "" ..tHistory[h].. "a" end
if key == "s" then tHistory[h] = "" ..tHistory[h].. "s" end
if key == "d" then tHistory[h] = "" ..tHistory[h].. "d" end
if key == "f" then tHistory[h] = "" ..tHistory[h].. "f" end
if key == "g" then tHistory[h] = "" ..tHistory[h].. "g" end
if key == "h" then tHistory[h] = "" ..tHistory[h].. "h" end
if key == "j" then tHistory[h] = "" ..tHistory[h].. "j" end
if key == "k" then tHistory[h] = "" ..tHistory[h].. "k" end
if key == "l" then tHistory[h] = "" ..tHistory[h].. "l" end
if key == "z" then tHistory[h] = "" ..tHistory[h].. "z" end
if key == "x" then tHistory[h] = "" ..tHistory[h].. "x" end
if key == "c" then tHistory[h] = "" ..tHistory[h].. "c" end
if key == "v" then tHistory[h] = "" ..tHistory[h].. "v" end
if key == "b" then tHistory[h] = "" ..tHistory[h].. "b" end
if key == "n" then tHistory[h] = "" ..tHistory[h].. "n" end
if key == "m" then tHistory[h] = "" ..tHistory[h].. "m" end
if key == "1" then tHistory[h] = "" ..tHistory[h].. "1" end
if key == "2" then tHistory[h] = "" ..tHistory[h].. "2" end
if key == "3" then tHistory[h] = "" ..tHistory[h].. "3" end
if key == "4" then tHistory[h] = "" ..tHistory[h].. "4" end
if key == "5" then tHistory[h] = "" ..tHistory[h].. "5" end
if key == "6" then tHistory[h] = "" ..tHistory[h].. "6" end
if key == "7" then tHistory[h] = "" ..tHistory[h].. "7" end
if key == "8" then tHistory[h] = "" ..tHistory[h].. "8" end
if key == "9" then tHistory[h] = "" ..tHistory[h].. "9" end
if key == "0" then tHistory[h] = "" ..tHistory[h].. "0" end
if key == " " then tHistory[h] = "" ..tHistory[h].. " " end
if key == "backspace" then tHistory[h] = string.sub(tHistory[h], 1, string.len(tHistory[h]) - 1 ) end
if key == "return" then
if tHistory[h] == "exit" or tHistory[h] == "quit" then
quit()
elseif tHistory[h] == "move" then
-- Move code here
print("Move")
tHistory[h] = ""
else
x = x + 1
tLines[x] = "Invalid Command: ".. tHistory[h]
tHistory[h] = ""
end
if key~="backspace" and key~="enter" then -- and keep doing that to leave out irregular keys
tHistory[h]=""..tHistory[h]..key
end