mIRC Home    About    Download    Register    News    Help

Print Thread
Automatic disconnect after file transfer #57162 24/10/03 08:01 AM
Joined: Oct 2003
Posts: 11
F
fackue Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Oct 2003
Posts: 11
Would it be possible if you can add an option to automatically disconnect from the internet after all DCC's are completed? Or even disconnect from the internet and shut down the computer? Thanks, I appriciate your time.

Re: Automatic disconnect after file transfer #57163 24/10/03 01:03 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i don't use DCC so this is a lucky guess :tongue:

on *:filercvd:{
if (!$get(0)) { run cmd /c shutdown -s }
}


new username: tidy_trax
Re: Automatic disconnect after file transfer #57164 25/10/03 12:16 AM
Joined: Oct 2003
Posts: 11
F
fackue Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Oct 2003
Posts: 11
Where would I stick that, and would I be able to turn it of and on? I don't do it often, but when I do leave my DCC's downloading over night, I'd like to be able to just do a /shutdownon to turn it on, and a /shutdownoff to turn it off. I've never messed with scripts this way, only self installed scripts.

Re: Automatic disconnect after file transfer #57165 25/10/03 12:28 AM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
Code:
menu status,channel,menubar {
  dcc auto shutdown
  .$iif($dccsh,$style(3)) on: .enable #dccsh
  .$iif(!$dccsh,$style(3)) off: .disable #dccsh
}
alias dccsh {
  return $iif($group(#dccsh).status == on,1,0)
}
on *:filercvd:*.*:{
  if ($dccsh) && (!$get(0)) { run cmd /c shutdown -s }
}
#dccsh off
blah
#dccsh end

that has a switch to turn it on and off, i also read up about on *:filercvd ^.^, i'm not willing to test it, *hates dcc*.
you will have to change run cmd to: run <path to ms dos> if you have ms dos.


new username: tidy_trax
Re: Automatic disconnect after file transfer #57166 25/10/03 04:34 AM
Joined: Oct 2003
Posts: 11
F
fackue Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Oct 2003
Posts: 11
Thanks, I really appriciate it. I'll try it out next time I download something.

Re: Automatic disconnect after file transfer #57167 25/10/03 09:41 PM
Joined: Oct 2003
Posts: 11
F
fackue Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Oct 2003
Posts: 11
I just now tried this, it wouldn't work for me. I turned it on, recived a DCC, then when the transfer was over, nothing happened, just as if the script was never there.

I also tried it by turning it on right after I recieved the file, during the download, I turned it on - same thing.

I have Win98, I'm assuming the "cmd" is for Win2K/XP? So I did what you said, changed the "cmd" to the path of MS DOS. This is what I came up with:

Code:
if ($dccsh) &amp;&amp; (!$get(0)) { run c:\command.com /c shutdown -s }


I even tried just 'c:\command.com /c shutdown -s' under Run, and all it did was open DOS and quickly close. Sorry - I just don't know what to do?

Re: Automatic disconnect after file transfer #57168 25/10/03 09:57 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
try shutdown /s


new username: tidy_trax
Re: Automatic disconnect after file transfer #57169 25/10/03 10:26 PM
Joined: Dec 2002
Posts: 155
S
Strider Offline
Vogon poet
Offline
Vogon poet
S
Joined: Dec 2002
Posts: 155
"/run rundll.exe user.exe,exitwindows" shuts down Win98.

Re: Automatic disconnect after file transfer #57170 25/10/03 10:32 PM
Joined: Oct 2003
Posts: 11
F
fackue Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Oct 2003
Posts: 11
'c:\command.com /c shutdown /s' gives "Bad command or file name".

Re: Automatic disconnect after file transfer #57171 25/10/03 10:44 PM
Joined: Dec 2002
Posts: 155
S
Strider Offline
Vogon poet
Offline
Vogon poet
S
Joined: Dec 2002
Posts: 155
Well, like I mentioned before (maybe you didn't see my reply), "/run rundll.exe user.exe,exitwindows" works fine with Windows 98.

Re: Automatic disconnect after file transfer #57172 25/10/03 10:48 PM
Joined: Oct 2003
Posts: 11
F
fackue Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Oct 2003
Posts: 11
OK, changing the line, I still get the same problem. It's acting like that script not even there after a transfer was completed.

EDIT: Yeah :tongue:, I was in the middle of typing that reply when you replied back.

Last edited by fackue; 25/10/03 10:51 PM.
Re: Automatic disconnect after file transfer #57173 25/10/03 11:13 PM
Joined: Dec 2002
Posts: 155
S
Strider Offline
Vogon poet
Offline
Vogon poet
S
Joined: Dec 2002
Posts: 155
if ($dccsh) && (!$get(0))

That's because the second part of that condition is wrong.

I'm assuming that pheonix added that condition to check if no other DCC get windows are open when the transfer ends; but he forgot that, when the event triggers, the window is still open, which means that $get(0) returns 1 and not 0 when no other receive windows are open; the NOT (!) operator should not be used here.

The line should be:

if ($dccsh) && ($get(0)) { run rundll.exe user.exe,exitwindows }

In any case, you might not want it to check if other DCC windows are open, since you are able to turn this feature on and off, meaning that you'll turn it on only when you want mIRC to shut down your computer after you receive a file.

You might want to leave this line like this:

if ($dccsh) { run rundll.exe user.exe,exitwindows }

Re: Automatic disconnect after file transfer #57174 26/10/03 01:24 AM
Joined: Oct 2003
Posts: 11
F
fackue Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Oct 2003
Posts: 11
Thanks a lot, I really appriciate your help Strider, I'll try this out after I nothing really to do on my computer. Thanks also to pheonix, appriciate it.

Another thing - will I have to change the options in mIRC to not confirm closing if a channel is open, or connected to server? Or will it shut down without me having to change that?

Re: Automatic disconnect after file transfer #57175 26/10/03 01:27 AM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
like i said, it was a lucky guess;] i don't use DCC.


new username: tidy_trax
Re: Automatic disconnect after file transfer #57176 26/10/03 03:16 PM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
But since he wants it to shutdown after ALL DCC's are completed (not when he just set the feature on), I'd use a ($dccsh) && ($get(0) < 2) condition.


* cold edits his posts 24/7
Re: Automatic disconnect after file transfer #57177 27/10/03 04:39 AM
Joined: Dec 2002
Posts: 155
S
Strider Offline
Vogon poet
Offline
Vogon poet
S
Joined: Dec 2002
Posts: 155
Sorry, I didn't read that part in his initial post.

fackue: If you're going to use cold's condition, make sure that your DCC get windows close on completion.


Re: Automatic disconnect after file transfer #57178 01/11/03 06:38 AM
Joined: Oct 2003
Posts: 11
F
fackue Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Oct 2003
Posts: 11
Awesome, it works. Thanks you guys. Though it would be cool if it was implemented in mIRC, this script is so limited...

Anyways, here's the script, ready to load:
http://consolevision.com/members/fackue/tools/shutdown.zip