mIRC Home    About    Download    Register    News    Help

Print Thread
Auto Reload when modified by another program #245916 13/05/14 10:59 PM
Joined: Apr 2014
Posts: 19
D
dude22072 Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
Is there a way so that when
Code:
This file has been changed by another application: remote.ini Do you want to reload it?
pops up I can have it automatically say yes?

Re: Auto Reload when modified by another program [Re: dude22072] #245927 14/05/14 09:49 AM
Joined: Apr 2014
Posts: 191
B
blessing Offline
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Afaik, there is no way to auto say yes for the pops up, but you can script it to auto reload remote.ini file.
Code:
on *:START:.timerscriptcheck -o 0 5 scriptcheck 

alias scriptcheck {
  var %t $calc($timer(scriptcheck).delay / 1000), %i 1
  while $script(%i) {
    var %s $v1
    if $calc($ctime - $file(%s).mtime) < %t { .reload -rs $+ %i $qt(%s) }
    inc %i
  }
}

In order to make this works, you need to turn off monitor file changes (In script editor, press alt+O then untick "monitor file changes" option), otherwise you will still get the pops up.




Re: Auto Reload when modified by another program [Re: blessing] #246010 18/05/14 01:26 AM
Joined: Apr 2014
Posts: 19
D
dude22072 Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
I've put that in my remote.ini file but it doesn't seem to work... The remote.ini is being modified by DropBox if that affects anything.

Re: Auto Reload when modified by another program [Re: dude22072] #246012 18/05/14 03:19 AM
Joined: Apr 2014
Posts: 191
B
blessing Offline
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
check if timer scriptcheck is active?
If it is not, you may need restart your mIRC to activate it, or you can activate it manually if you know how wink

Re: Auto Reload when modified by another program [Re: blessing] #246016 18/05/14 04:05 AM
Joined: Apr 2014
Posts: 19
D
dude22072 Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
idk how to check if its active. I've restarted mIRC a few times since i've added it.

Re: Auto Reload when modified by another program [Re: dude22072] #246017 18/05/14 04:41 AM
Joined: Apr 2014
Posts: 191
B
blessing Offline
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Ok. so that version doesnt work for you. Idk if dropbox affects anything or not. lets try this version.
Code:
on *:START:.timerscriptcheck -o 0 5 scriptcheck 

alias scriptcheck {
  var %i 1
  while $script(%i) {
    var %s $v1, %ft $readini(scriptcheck.ini,scripts,$hash(%s,32)), %ct $file(%s).mtime
    if %ft != %ct { 
      writeini scriptcheck.ini scripts $hash(%s,32) %ct
      echo -agt ( $nopath(%s) ) has been reloaded.
      .reload -rs $+ %i $qt(%s) 
    }
    inc %i
  }
}

Re: Auto Reload when modified by another program [Re: blessing] #246020 18/05/14 06:27 AM
Joined: Apr 2014
Posts: 19
D
dude22072 Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
That version worked, thanks.