I found a few minor oversights that were causing incorrect behavior, so I decided to update the previous script code.
Additionally, you can now directly add text next to a command, or still use just one command to trigger the popup for text entry.

  • Syntax: /top [-vr] [text]
  • Example: /top my new channel topic


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


๐ŸŒ https://forum.epicnet.ru ๐Ÿ“œ irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples