Originally Posted By: westor
Yes it is possible if you add this code into an other file and load it you can use this code to !load <filename> and !unload <filename>.

e.g:

!load test.mrc (and inside the test.mrc file put the code that you want to load)

!unload test.mrc

Code:
ON *:TEXT:!*:#: {
  tokenize 32 $strip($1-)
  if ($1 == !load) {
    if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify a file! | return }
    var %f = $mircdir $+ $remove($2,.mrc) $+ .mrc
    if (!$isfile(%f)) { .msg $chan ( $+ $nick $+ ): Error, The $qt($2) file does not exist! | return }
    if ($check_load(%f)) { .msg $chan ( $+ $nick $+ ): Error, The $qt($2) file is already loaded! | return }
    .load -rs $qt(%f)
    .msg $chan ( $+ $nick $+ ): The $qt($nopath(%f)) file has been loaded!
  }
  if ($1 == !unload) {
    if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify a file! | return }
    var %f = $remove($2,.mrc) $+ .mrc
    if (!$check_load(%f).short) { .msg $chan ( $+ $nick $+ ): Error, The $qt($2) file is NOT loaded! | return }
    .unload -rs $qt(%f)
    .msg $chan ( $+ $nick $+ ): The $qt($nopath(%f)) file has been unloaded!
  }
}

alias check_load {
  if (!$1) { return }
  var %t = $script(0)
  var %i = 1
  while (%i <= %t) {
    var %f = $iif($prop == short,$nopath($script(%i)),$script(%i))
    if (%f == $1-) { return 1 }
    inc %i
  }
  return 0
}


NOTE: The filename must be into .mrc format and must be placed into the mirc.exe direction in order to work.



Hey,

Thanks alot for the help, everything seems to be working.
The only problem though is that, I want to make it say "!unload test.mrc" automatically when "twitchnotify" writes in mIRC chat "viewers resubscribed".

I've been trying on another Twitch account, and just writing "viewers resubscribed", with this script:
Code:
ON *:TEXT:*viewers resubscribed*:#artiiz:{
  msg $chan !unload test.mrc
}


But it doesn't unloads the script, unless I type it in my Twitch chat by my own, and not though mIRC.