View difference between Paste ID: wCwpANdW and 8tH66kQ8
SHOW: | | - or go back to the newest paste.
1
term.write("> ")
2
term.setCursorBlink(true)
3
sleep(2)
4
5
local start, e,p =false
6
local timeout = os.startTimer(20)
7
repeat
8
    local tick = os.startTimer(.75)
9
    e,p = os.pullEventRaw()
10
    if e == "char" then
11
        write(string.char(math.random(0,255)))
12
        start = true
13
        tick = os.startTimer(.5)
14
    end
15
    if start and (((e == "char" or e == "key") and math.random(2)==1) or (e == "timer" and p == tick)) then
16
        peripheral.call("back", "playSound", math.random(2) == 1 and "entity.ghast.hurt" or "entity.ghast.death")
17
    end
18
    os.cancelTimer(tick)
19
until e == "timer" and p == timeout
20
21
term.setCursorBlink(false)
22
print("\nc'est bon, c'est fini ;)")
23
sleep(2)
24
shell.run("clear")