|
fackue
|
fackue
|
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.
|
|
|
|
pheonix
|
pheonix
|
i don't use DCC so this is a lucky guess :tongue:
on *:filercvd:{ if (!$get(0)) { run cmd /c shutdown -s } }
|
|
|
|
fackue
|
fackue
|
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.
|
|
|
|
pheonix
|
pheonix
|
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.
|
|
|
|
fackue
|
fackue
|
Thanks, I really appriciate it. I'll try it out next time I download something.
|
|
|
|
fackue
|
fackue
|
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: if ($dccsh) && (!$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: Dec 2002
Posts: 153
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 153 |
"/run rundll.exe user.exe,exitwindows" shuts down Win98.
|
|
|
|
fackue
|
fackue
|
'c:\command.com /c shutdown /s' gives "Bad command or file name".
|
|
|
|
Joined: Dec 2002
Posts: 153
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 153 |
Well, like I mentioned before (maybe you didn't see my reply), "/run rundll.exe user.exe,exitwindows" works fine with Windows 98.
|
|
|
|
fackue
|
fackue
|
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: 153
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 153 |
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 }
|
|
|
|
fackue
|
fackue
|
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?
|
|
|
|
pheonix
|
pheonix
|
like i said, it was a lucky guess;] i don't use DCC.
|
|
|
|
Joined: Feb 2003
Posts: 806
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 806 |
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.
|
|
|
|
Joined: Dec 2002
Posts: 153
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 153 |
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.
|
|
|
|
|