Hi, here is what I am trying to accomplish, but I cannot seem to find a good way to do it (if it is possible).
I want to read a random line from a file ( $read(filename.txt) ), then delete that line.
I know that $readn will return the line number of the recently $read(..) line, and that /write -dl<number> filename.txt will delete line <number>.
Is there any way to get mirc to evaluate $readn within the parameters of the write command, to delete line number ($readn)?
for instance, something like:
/write -dl[$readn] filename.txt
When I try that command, it just deletes line 1 every time.
The only way I've been able to accomplish this so far is with a really long and ugly if/then else/then statement with a line for every possible line number that $readn might have returned. Anyone know of a more elegant way to do this?
For more information, I have a text file that represents a deck of cards, with one card on each line, and I want to remove each card from the deck once I have randomly $read it to avoid dealing duplicate cards. If there is another more elegant alternative to avoid dealing duplicate cards, that would be welcome information also.
Thanks for any input on this,
Ben