Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- output = {}
- fakeInput = {"l","o","l"," ","i","t","'","s"," ","n","o","t"," ","w","o","r","k","i","n","g"}
- charCount = 0
- shell.run("clear")
- sleep(1)
- term.setCursorBlink(true)
- while true do
- event = nil
- key = nil
- while event ~= "char" and key ~= 14 and key ~= 28 do
- event, key = os.pullEvent()
- end
- if key ~= 14 and key ~= 28 then
- table.insert(output, key)
- charCount = charCount + 1
- elseif key == 14 then
- table.remove(output, #output)
- charCount = charCount - 1
- sleep(.2)
- else
- break
- end
- shell.run("clear")
- for i=1,#output do if fakeInput[i] ~= nil then term.write(fakeInput[i]) end end
- term.setCursorBlink(true)
- end
- term.setCursorPos(1,3)
- term.setTextColor(colors.green)
- for j=1,#output do term.write(output[j]) end
- term.setCursorPos(1,4)
Advertisement
Add Comment
Please, Sign In to add comment