mIRC Home    About    Download    Register    News    Help

Print Thread
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.

Joined: May 2003
Posts: 2,265
P
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
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.

Joined: May 2003
Posts: 2,265
P
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
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.

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?

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
try shutdown /s


new username: tidy_trax
Joined: Dec 2002
Posts: 155
S
Vogon poet
Offline
Vogon poet
S
Joined: Dec 2002
Posts: 155
"/run rundll.exe user.exe,exitwindows" shuts down Win98.

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".

Joined: Dec 2002
Posts: 155
S
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.

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.
Joined: Dec 2002
Posts: 155
S
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 }

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?

Joined: May 2003
Posts: 2,265
P
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
Joined: Feb 2003
Posts: 810
C
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
Joined: Dec 2002
Posts: 155
S
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.


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


Link Copied to Clipboard