mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Hi,

Is there anyway to automatically say yes to this prompt? I have an automated process which amends a script and I need it to reload it so it can continue processing within Mirc. So how can I do it?



Any help would be very much appreciated!

Thanks smile

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
ALT + R - Options - Uncheck Monitor File Changes.

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
I NEED it to reload the script, because my process alters it. I just need it to do with without asking me if it's ok to do so!

If I untick "Monitor File Changes" it doesn't detect changes to the script at all.

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
So do the above^, edit the file, run a timer to load the .mrc and unload it.. perhaps that'd work?

or alternatively, perhaps /reload might work?

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Ah yes maybe.... this has to be done automatically, so I will need it to reload it every 5 seconds or something. So what command do I use in a mrc to reload another script?

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Well if your running the reload inside a "remotes script" you can just use:

/reload -rs $+(",$script,") - to reload the file this command is being run from, this could be put AFTER you /write to the file.

or, /reload -rs location\file.mrc - to reload a differnet file (this could also be run from a /timer if your doing it so frequently)..

- Note that prefixing with a . (DOT) will silence the:
* Reloaded script '....' message that appears.

Eamonn.

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Great! Thanks smile
My script starts:

alias releaser-djsi {
/reload -rs $script

Do I put the /reload line there or do I put it before the alias line?

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Put it directly under the /write statements that your using..

i.e.

/write myfile.mrc something something something
/write myfile.mrc something something something
/reload -rs $+(",$script,")

Note that you should use $+() around the $script incase your scripting file paths contain spaces, i.e. c:\program files\

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Ah it is working smile

Thanks!!! smile

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
So how often will it reload the script? The script I currently have on a timer to run every 30seconds... so I guess it will reload then?

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
yup, simply decrease the timer to make it sooner.

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
I've just been testing it further, and although it is reloading the script, it doesn't appear to be running the rest of the script... not sure why.

I've put the reload command at the end, but it still doesn't seem to have helped!

Alternatively, is there a script I could write that would reload the other script when a certain file is created? Then I can get my process to create this file, once the original script has been updated, which would then reload it. Is this possible? Sorry maybe I haven't explained that very well... wink

Thanks for your help with this laugh

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Perhaps its because your using "/reload" as reload does not trigger the ON START/LOAD commands, and this is perhaps where your commands are being held? (dunno?)

If they are, then simply replace /reload with:

/timer 1 2 load -rs $+(",$script,")
/unload -rs $+(",$script,")

Eamonn.

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
I don't think so...

Here's my script, hopefully this should make this a lot easier:

alias releaser-djsi {
var %rls_ready =
var %site_ready =
var %rls = D:\System_Stats
var %site = D:\Site1
if %rls_ready = $date && $isfile(%rls) { set %rls_ready $date
msg #chan 12(NEW RELEASE) Ready:
msg #chan 12(NEW RELEASE) $nopath(%rls)
if %site_ready = $date && $isfile(%site) { set %site_ready $date
msg #chan 12(NEW RELEASE) System: $nopath(%site)  }
/reload -rs $+(",$script,")
}

I think best solution is to have another script reload this script (when a certain file is created), cause I only want it to reload the script when it needs to. That should be possible right?

Thanks smile


Link Copied to Clipboard