It seems your question has already gone far beyond the title of the topic under discussion :-]

Ok. You can do it like this:

  • Save to variable a random file line number.
  • Save to variable file line with the specified number.
  • Remove the specified line number from the file.
  • Write this line to a new adjacent file.
  • When the old file becomes empty, it must be deleted, and the new file must be renamed to the old file name.



So, after the above plan, you can try using this code modification:
Code
on *:TEXT:*:#channel:{
  if ($nick == ServiceBot) { return }
  if ($nick isop $chan && $1 === !ON) { bot_stop | bot_start $chan }
  elseif ($nick isop $chan && $1 === !OFF) { bot_stop }
  else { bot_stop | .timerBOTSTART 1 1800 bot_start $unsafe($chan) }
}
alias -l bot_start {
  msg $1 Va beh...nessuno parla allora parlo io...
  rand_msg $1 | .timerRANDMSG 0 60 rand_msg $unsafe($1)
}
alias -l bot_stop { .timerBOTSTART off | .timerRANDMSG off }
alias -l rand_msg {
  var %colors 2,3,4,5,6,7,8,9,10,11,12,13, %cc $chr(3)
  var %rc $gettok(%colors,$rand(1,$numtok(%colors,44)),44)
  var %file addons\miefrasibot\frasibot.txt
  var %file1 $+($file(%file).path,$file(%file).name,1,.txt)
  var %rn $rand(1,$lines(%file)), %str $read(%file,nt,%rn)
  .write $+(-dl,%rn) %file | .write -i $qt(%file1) %str
  if ($lines(%file) == 0) { .remove $qt(%file) | .rename $qt(%file1) $qt(%file) }
  msg $1 $+(%cc,%rc,%str,%cc)
}


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples