var i = 1, n = prompt('Nick?', '!!'),
msg_text = prompt('Text of a message? (%i% stands for message id)', 'Message #%i%'),
end_text = prompt('Text when the hacking ended? (%i% stands for message id)', '%i% message(s) sended successfully.'),
msgs = parseInt(prompt('How many messages?',20)),
time = parseInt(prompt('Amount of time?', 100)),
t = setInterval(function() {
if (i == msgs+1) ref.push({name: n, text: end_text.replace('%i%',i-1)}), clearInterval(t);
else ref.push({name: n, text: msg_text.replace('%i%',i++)});