I have made changes to the script code you provided so that it does what you request.

Try using this variant:
Code
alias top {
  if ($active !ischan) { echo -sac own This command can only be used on a channel. | return }  
  if ($1 == -v) { if ($chan($active).topic) topic $active | else { echo -sac own No topic. } }
  elseif ($1 == -r && $nick($active,$me,~&@) && $chan($active).topic) { 
    if ($?!="Are you sure you want to remove the channel topic?") { topic -r $active }
  }
  elseif ($nick($active,$me,~&@)) { 
    var %newtopic $$?="Enter your channel topic:"
    if ($?!="Are you sure you want to change the channel topic?") { topic $active %newtopic }
  }
}


Available commands:

  • Call a pop-up window for entering a new topic in the active channel window: /top
  • View topic in active channel window: /top -v
  • Remove topic in the active channel window: /top -r



🕮 Also useful information to study: https://en.wikichip.org/wiki/mirc/identifiers/$%3F


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