I will rewrite that in a moment and edit it into this post.
Do you want it to delete the "request" when it has read it into the chat?
EDIT:Below is the edited code, it will respond "There is nothing in the queue.2 if there is nothing in the text file
it will delete line 1 when you have used !trackrequest whilst also reading it into the chat. No way of retrieving this if not log is held.
[Note: might be worth adding a second .write but instead of writing to:
write trackrequest $+ $chan $+ .txt $2-
do this alongside
write trackrequestBACKUP $+ $chan $+ .txt $2-
So that you will have a file of every request submitted just in case you need to refer back to it without it being fully deleted.
on *:text:!trackrequest *:#: {
write trackrequest $+ $chan $+ .txt $2-
msg $chan $qt($2-) is now added to the queue.
}
on *:text:!tracklist:#: {
if ($read(trackrequest $+ $chan $+ .txt ,1) == $null) { msg # There is nothing in the queue. | return }
else {
msg $chan Next in line is: $read(trackrequest $+ $chan $+ .txt ,1)
.write -dl1 trackrequest $+ $chan $+ .txt
}
}
Will work on it listing everything into chat when I get back later.