I use the following as a "random fact" command for my bot. Works without problems. Just have to create your own fact file (which I saved in my mIRC folder). Feel free to use this and edit it to do whatever you want it to do on your bot.

Code:
ON *:TEXT:!fact:#: { 
  if ((%floodfact) || ($($+(%,floodfact.,$nick),2))) { return }
  set -u15 %floodfact. $+ $nick On
  msg $chan RANDOM FACT: $read(randomfact.txt,n)
}