Try to use this code:

Put this code into the "REMOTES" tab into a new file

To add access use: /set %owners NICK1 NICK2

Code:
ON *:TEXT:!autohost*:#:{
  if (!$istok(%owners,$nick,32)) { .msg $chan ( $+ $nick $+ ): Error, You have NOT access for this command! | return }
  if ($2 == on) {
    if ($timer(.hostON)) { .msg $chan ( $+ $nick $+ ): Error, The AUTOHOST is already enabled! | return }
    var %f = nowhosting.txt
    if (!$isfile(%f)) { .msg $chan ( $+ $nick $+ ): Error, The $qt(%f) file does NOT provide any nickname(s) for hosting! | return }
    if (!$lines(%f)) { .msg $chan ( $+ $nick $+ ): Error, The $qt(%f) file does NOT provide any nickname(s) in the list for hosting! | return }
    msg # /me Auto Hosting is now enabled.
    searchhost $chan
    .timer.hostON 0 1800 searchhost $chan
  }
  elseif ($2 == off) {
    if (!$timer(.hostON)) { .msg $chan ( $+ $nick $+ ): Error, The AUTOHOST is already disabled! | return }
    msg # /me Auto Hosting is now disabled.
    .timer.hostON off
    msg # /unhost
  }
}

alias searchhost {
  if (!$1) { return }
  if ($me !ison $1) { return }
  var %f = nowhosting.txt
  if (!$isfile(%f)) { return }
  if (!$lines(%f)) { return }
  var %r = $read(NowHosting.txt,n)
  msg $1 /me Now hosting $qt(%r)
  msg $1 /host %r
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-