mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2007
Posts: 280
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
Is there any setting to reload scripts automaticly when they've been changed?

My bot is running on an other pc where I connect to using FTP. Using the FTP I edit it's scripts, but I need to use .reload <script> to have it reloaded.

The popup "<script> has been changed, reload from disk?" comes back every time.

Any idea?


Squee whenever a squee squee's. Squee whenever a squee does not squee.
Joined: Mar 2010
Posts: 146
Vogon poet
Offline
Vogon poet
Joined: Mar 2010
Posts: 146
Well, you just answered your own question...
If you have no clue, here is an example:
Code:
on *:Text:.reload *:#:{
  var %file = $+($scriptdir,$1,.mrc)
  if ($exists($qt(%file))) {
    .load -rs $qt(%file)
    notice $nick $nopath(%file) successfully reloaded.
  }
}

You should change the path to your script directory path, or adjust the code in the way you want...

Hope this helps.


Nothing...
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Open the script editor. On the top menu choose Options > (uncheck) Initialization Warning

This should help.

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
I'm thinking he means the Monitor File Changes option.

Open the script editor. On the top menu choose Options > (un-check) Monitor File Changes

Joined: Mar 2010
Posts: 146
Vogon poet
Offline
Vogon poet
Joined: Mar 2010
Posts: 146
How could i miss the last line, lol
DJ_Sol & RoCk, i think you both are right. He needs to uncheck both of them...


Nothing...
Joined: Jan 2007
Posts: 280
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
@Masoud,

I already said that I was using a script, which was the problem because I don't want to reload the script manually, that's why I asked for an automaticly <----- option for this. Not a manually. But thanks tho.

@DJ_Sol and RoCk

Both options didn't help. Maybe I didn't explain well, I'll try better now:


I'm running a mirc bot, which has scripts loaded (doh). Because it's on an other PC, I'm editing the scripts by FTP.

So, I connect to it's ftp server and edit a file and then save it. Now the script has been edited, but needs to be reloaded to make the changes work.

Let's say the script first had a !command which replied with 'hello!'. I've edited the 'hello!' to 'hello $nick $+ !'.

When saving the file (by FTP!) I want it to reload automaticly in mIRC, because when I've saved it and using !command it'll still shout 'hello!'.

So actuallly I'm looking for an mIRC option that reloads and loaded mIRC script when edited, without doing ANYTHING.

Maybe this explanation was better? If it wasn't clear enough tho.



--- EDIT ----
@Masoud; .load -rs is quite double, reload will work as well :P

Last edited by DuXxXieJ; 16/06/11 08:34 PM.

Squee whenever a squee squee's. Squee whenever a squee does not squee.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You would need a timer that automatically checks the script file for changes (compare $md5 or similar to find out) and then use /reload if it changes.


Invision Support
#Invision on irc.irchighway.net
Joined: Jan 2007
Posts: 280
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
Originally Posted By: Riamus2
You would need a timer that automatically checks the script file for changes (compare $md5 or similar to find out) and then use /reload if it changes.


Lol, I just wanted to post again with having a idea, which is a timer to check the 'edited at..' date/time and if that was later than the var %time (or something that's been set while loading) it should reload itself.

I'll go try yours


Squee whenever a squee squee's. Squee whenever a squee does not squee.
Joined: Jan 2007
Posts: 280
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
Originally Posted By: Riamus2
You would need a timer that automatically checks the script file for changes (compare $md5 or similar to find out) and then use /reload if it changes.


Ok, I've been looking in the mIRC help file $md5. So, if I do //echo -a $md5(files/fun/fortune.txt) I get 0bca7c6a0c47c954973fd24783c7ce5b.

Can't really figure out how this should say the file has been edited (can't decode it.)



- EDIT -

Didn't saw the Nth part, I now have used //echo -a $md5(files/fun/fortune.txt,2) which appears to be different when I've changed the file.

Hope this'll work! Thanks

Last edited by DuXxXieJ; 16/06/11 11:50 PM.

Squee whenever a squee squee's. Squee whenever a squee does not squee.

Link Copied to Clipboard