Hello

I have a script that's mostly offline and I want to prevent it from being called while it's running by the user. I tried checking for a global that's only in use while the script is running, but this doesn't work because mirc periodically saves globals to remote.ini.

it looks something like this;

Code:
alias examplescript {
  if (%alreadyloaded != $null) {
    echo This script cannot be loaded when it's already running.
    halt
  }
  set %alreadyloaded $true
}
; ...imagine several aliases that link together...
alias endofsamplescript {
  unset %alreadyloaded
}


This causes a few problems, the first is that if it saves the value as $true to the remote.ini file and then mirc is closed out without the script ending properly(it unsets the variable when it ends), then mirc is reloaded and loads the variable with it as $true. The other problem is that you can't load another instance of mirc and then load the script again because(assuming you're loading mirc from the same installation) it will load remote.ini.

Does anyone know a better approach to this?

Last edited by silimon; 13/06/08 06:32 AM.